Knight Gameplay Framework
repository·master·Indexed 18 days ago
https://github.com/winddyhe/knightA modular gameplay framework for Unity featuring Assetbundle resource management, C# hot-patching via hybridclr, and an MVMC-based UI framework. It provides a layered architecture consisting of CoreLib, ThirdLib, and Framework layers, integrating tools for local game saves, networking with TouchSocket and Protobuf, and an Async/Await logic system powered by UniTask.
What's inside Knight
- The UI system provides a set of interaction components designed to handle various user input methods, including mouse events, touch events, keyboard navigation, and controller input. These components allow developers to implement standard UI behaviors such as clicking, toggling, sliding, and text input within the Unity environment.
Overview of Unity UI (uGUI)
masterUnity UI (uGUI) is a GameObject-based UI system used to develop user interfaces for games and applications. It relies on Components and the Game view to arrange, position, and style UI elements.
Note: uGUI cannot be used to create or modify the user interfaces of the Unity Editor itself; it is strictly for in-game/application UI.
Overview of HybridCLR for Unity Hot Update
masterHybridCLR is a high-performance, low-memory, near-zero-cost C# hot update solution for Unity across all platforms. It transforms the standard IL2CPP AOT (Ahead-of-Time) runtime into a hybrid "AOT + Interpreter" runtime. This allows for the dynamic loading of assemblies, enabling seamless C# code hot updates on platforms like Android, iOS, Consoles, and WebGL.
Key advantages include:
- Seamless Workflow: Supports standard Unity components like
MonoBehaviour,ScriptableObject, and DOTS. You can attach hot-updated scripts directly to GameObjects in the editor. - Full C# Support: Supports generics, reflection, inheritance, and multi-threading (including
volatile,ThreadStatic, andasync Task) without requiring special code generation or manual workarounds. - High Performance: Uses a highly efficient register interpreter and a unique Differential Hybrid Execution (DHE) technology. DHE allows modified or new functions to run in interpreter mode while unchanged functions continue to run at native AOT speeds.
- Memory Efficiency: Hot-updated classes occupy the same memory footprint as standard C# classes.
- Hot Reloading: Supports 100% assembly unloading.
- Security: Supports modern DLL encryption techniques.
- Seamless Workflow: Supports standard Unity components like
Overview of Knight framework features
masterKnight is a Unity-based gameplay framework designed to allow developers to focus on game content by providing easy-to-use interfaces for core systems.
Key modules include:
- Assetbundle Resource Management: Handles packaging, downloading, loading, and version management.
- hybridclr C# Hotfix Module: Provides C# hot-reloading capabilities based on the
hybridclrsolution. - MVMC UI Framework: A UI architecture based on the MVMC (Model-View-Model-Controller) pattern.
- Modular Architecture: Modules are separated into individual Packages and managed via the Unity PackageManager, allowing them to be plugged in or removed as needed.
Overview of HybridCLR for Unity Hot Updates
masterHybridCLR is a full-platform native C# hot update solution for Unity. It transforms the standard il2cpp runtime from a pure AOT (Ahead-of-time) runtime into an "AOT + Interpreter" hybrid runtime. This allows for the dynamic loading of assemblies, enabling C# code hot updates on platforms like Android, iOS, Consoles, and WebGL.
Key benefits include:
- Seamless Workflow: Works with existing Unity development habits; no special code generation or manual code changes are required for most tasks.
- High Compatibility: Supports inheritance, generics, reflection, multi-threading (
volatile,ThreadStatic,async Task), and Unity-specific components likeMonoBehaviour,ScriptableObject, andDOTS. - Performance: Uses an efficient register interpreter and Differential Hybrid Execution (DHE) to run unmodified functions in native AOT mode while running changed/added functions in interpreter mode.
- Memory Efficiency: Hot-updated classes occupy the same memory space as ordinary C# classes.
Overview of the knight GamePlay framework
masterknight is a Unity-based GamePlay framework designed to allow developers to focus on game content by providing high-level interfaces for common game development tasks.
Key features include:
- Resource Management: A complete module for Assetbundle packaging, downloading, loading, and version management.
- Hot Update: A C# hot update module built on top of
hybridclr. - UI Framework: An MVMC-based (Model-View-Model-Controller) UI framework.
- Modular Architecture: Modules are separated using the Unity Package approach and managed via a
PackageManagerto enable plug-and-play functionality at runtime.
Note: The framework is currently optimized for Unity version
6000.0.26f1.Overview of TextMesh Pro features
masterTextMesh Pro is a set of Unity tools for 2D and 3D text that provides significantly more control over formatting and layout than standard Unity UI Text or Text Mesh systems. Key features include:
- Spacing & Layout: Control over character, word, line, and paragraph spacing, as well as kerning and justified text.
- Rich Text: Support for links and more than thirty rich text tags.
- Assets: Support for multiple fonts and sprites.
- Styling: Support for custom styles.
- Rendering: Advanced text rendering using custom shaders.
Overview of Unity Mathematics types and functions
masterUnity Mathematics is a C# math library designed with a shader-like syntax (similar to HLSL or SIMD). It is optimized for use with the Burst compiler to compile C# code into highly efficient native code.
Supported Vector and Matrix Types
floatN(e.g.,float2,float3,float4)quaternionfloat3x3float4x4
Supported Elementary Functions
- Comparison/Absolute:
min,max,fabs, etc. - Trigonometric/Geometric:
sin,cos,sqrt,normalize,dot,cross, etc.
Use Visual Components for GUI creation
masterThe
com.unity.uguipackage provides Visual Components designed to simplify the creation of user interfaces and provide GUI-specific functionality. These components are the building blocks for constructing complex UI layouts in Unity.Available Visual Components include:
- Text: For displaying textual information.
- Image: For displaying 2D sprites.
- Raw Image: For displaying textures directly.
- Mask: For clipping the rendering of child elements.
Add simple effects to Text and Image graphics
masterThecom.unity.uguipackage provides UI Effect Components that allow you to add visual effects like shadows and outlines directly toTextandImagegraphics components. These components are designed to be attached to the same GameObject as your UI graphic to modify its rendering.Use the Dropdown component
masterThe Dropdown component allows users to select a single option from a list. The control displays the currently selected option and opens a list of options when clicked. The list closes when an option is selected, when the control itself is clicked, or when clicking anywhere else within the Canvas.
Key Properties
- Value: The index of the currently selected option (0 is the first option, 1 is the second, etc.).
- Options: The list of possible options. Each option can include a text string and an optional image.
- Interactable: Determines if the component accepts input.
- Transition: Visual response settings to user actions.
- Navigation: Sequence of controls for navigation.
- Template: The Rect Transform of the template used to generate the dropdown list.
- Caption Text / Caption Image: Components used to display the text or image of the currently selected option.
- Item Text / Item Image: Components used to display the text or image for each item within the list.
Overview of the Auto Layout system
masterThe Auto Layout system in Unity UI (UGUI) allows you to arrange UI elements within nested layout groups (horizontal, vertical, or grids) and enables elements to automatically resize based on their contained content.
Key components of the system include:
- Layout Element: Defines size constraints (min, preferred, flexible).
- Content Size Fitter: Automatically adjusts the size of the object based on its content.
- Aspect Ratio Fitter: Maintains a specific aspect ratio for the RectTransform.
- Layout Groups: Components that arrange children in specific patterns (Horizontal, Vertical, or Grid).