Knight Gameplay Framework

repository·master·Indexed 18 days ago

https://github.com/winddyhe/knight

A 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.

Tokens
104.7K
Snippets
173
Records
550
Agent score
60%

What's inside Knight

  1. Overview of UI Interaction Components

    master
    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.
  2. Overview of HybridCLR for Unity Hot Update

    master

    HybridCLR 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, and async 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.
  3. Overview of Knight framework features

    master

    Knight 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 hybridclr solution.
    • 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.
  4. Overview of HybridCLR for Unity Hot Updates

    master

    HybridCLR 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 like MonoBehaviour, ScriptableObject, and DOTS.
    • 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.
  5. Overview of the knight GamePlay framework

    master

    knight 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 PackageManager to enable plug-and-play functionality at runtime.

    Note: The framework is currently optimized for Unity version 6000.0.26f1.

  6. Overview of TextMesh Pro features

    master

    TextMesh 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.
  7. Overview of Unity Mathematics types and functions

    master

    Unity 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)
    • quaternion
    • float3x3
    • float4x4

    Supported Elementary Functions

    • Comparison/Absolute: min, max, fabs, etc.
    • Trigonometric/Geometric: sin, cos, sqrt, normalize, dot, cross, etc.
  8. Use Visual Components for GUI creation

    master

    The com.unity.ugui package 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.
  9. Use the Dropdown component

    master

    The 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.
  10. Overview of the Auto Layout system

    master

    The 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).