Skip to content

GameFrameX/com.gameframex.unity.ui.fairygui

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

177 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

GameFrameX Logo

GameFrameX UI FairyGUI

Version License Documentation

All-in-One Solution for Indie Game Development ยท Empowering Indie Developers' Dreams

๐Ÿ“– Documentation โ€ข ๐Ÿš€ Quick Start โ€ข ๐Ÿ’ฌ QQ Group: 612311526


๐ŸŒ Language: English | ็ฎ€ไฝ“ไธญๆ–‡ | ็น้ซ”ไธญๆ–‡ | ๆ—ฅๆœฌ่ชž | ํ•œ๊ตญ์–ด


Project Overview

GameFrameX UI FairyGUI is a Unity UI adapter that wraps the FairyGUI framework into the GameFrameX modular game framework. It provides complete UI lifecycle management (open/close/recycle/animate) with async asset loading via YooAsset.

Key Features

  • Complete UI Lifecycle โ€” Open, close, recycle, and animate UI forms with a unified API
  • Async Asset Loading โ€” YooAsset-backed async loading for FairyGUI packages and resources
  • Object Pooling โ€” UI form instances are pooled for reuse, minimizing GC allocations
  • Singleton Deduplication โ€” Automatically prevents duplicate form creation
  • Loading Queue โ€” Coalesces concurrent open requests for the same form
  • Attribute-Driven Configuration โ€” Control UI groups, show/hide animations via C# attributes
  • MVVM Binding Support โ€” Automatic cleanup of bindable property events with BindablePropertyExtension
  • Dual Asset Loading โ€” Supports both Resources.Load and YooAsset AssetBundle loading
  • IL2CPP Safe โ€” Preserve attributes prevent code stripping on IL2CPP builds

Architecture

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚              Your UI Panels (FUI)            โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚                  UIManager                   โ”‚
โ”‚    (Open / Close / Recycle / Loading Queue)  โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚ FormHelperโ”‚UIGroup   โ”‚ PackageComponent      โ”‚
โ”‚ (Create/  โ”‚Helper    โ”‚ (AddPackage /         โ”‚
โ”‚  Release) โ”‚(Depth)   โ”‚  RemovePackage)       โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚         FairyGUI Runtime + YooAsset          โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
Component Description
UIManager Central UI manager handling open/close/recycle lifecycle
FUI Base class for all FairyGUI panels โ€” inherit from this
FairyGUIPackageComponent MonoBehaviour managing FairyGUI package loading/unloading
FairyGUIFormHelper Handles form instantiation, creation, and release
FairyGUIUIGroupHelper Manages UI group depth and layering
FairyGUILoadAsyncResourceHelper Bridges FairyGUI resource requests to YooAsset
FairyGUIPathFinderHelper Path-based GObject lookup utility

Quick Start

Installation

Choose one of the following methods:

Method 1: manifest.json

Add the following to your project's Packages/manifest.json under dependencies:

{
  "com.gameframex.unity.ui.fairygui": "https://github.com/AlianBlank/com.gameframex.unity.ui.fairygui.git"
}

Method 2: Unity Package Manager (Git URL)

Open Unity Package Manager โ†’ Add package from git URL:

https://github.com/gameframex/com.gameframex.unity.ui.fairygui.git

Method 3: Manual

Download the repository and place it in your Unity project's Packages/ directory. Unity will auto-detect it.

Dependencies

Package Version Description
com.gameframex.unity โ‰ฅ 1.1.1 Core framework runtime
com.gameframex.unity.ui โ‰ฅ 1.0.0 Base UI abstraction layer
com.gameframex.unity.asset โ‰ฅ 1.0.6 Asset loading system
com.gameframex.unity.event โ‰ฅ 1.0.0 Event system
FairyGUI Runtime โ€” FairyGUI library
YooAsset โ€” Asset management
UniTask โ€” Async/await support

Basic Usage

  1. Add FairyGUIPackageComponent to your scene (via GameFrameX โ†’ FairyGUIPackage menu)

  2. Create a UI panel by inheriting from FUI:

using GameFrameX.UI.FairyGUI.Runtime;

[OptionUIGroup("Default")]
public class MyPanel : FUI
{
    protected override void OnInit()
    {
        // Initialize UI elements
    }

    protected override void OnOpen(object userData)
    {
        // Handle open logic
    }

    protected override void OnClose()
    {
        // Handle close logic
    }
}
  1. Open the panel through the framework's UI component:
// Open a UI panel asynchronously
await GameEntry.GetComponent<UIComponent>().OpenUIFormAsync("MyPackage", "MyPanel");

Usage Examples

Show/Hide Animations

Use attributes to configure animations:

[OptionUIShowAnimation(typeof(FadeInAnimation))]
[OptionUIHideAnimation(typeof(FadeOutAnimation))]
public class AnimatedPanel : FUI { }

Path-Based Object Lookup

// Get the hierarchical path of a GObject
string path = gObject.GetUIPath();

// Resolve a GObject from path
GObject obj = FairyGUIPathFinderHelper.GetUIFromPath("GRoot/Group/MyButton");

MVVM Binding with Auto-Cleanup

// Automatically unregisters events when the GObject is destroyed
myProperty.ClearWithGObjectDestroyed(gObject);

Platform Support

Platform Supported
Android โœ…
iOS โœ…
Windows โœ…
macOS โœ…
WebGL โœ…

Minimum Unity version: 2019.4

Documentation & Resources

Community & Support

Changelog

See CHANGELOG.md for release history.

License

This project is dual-licensed under the MIT License and Apache License 2.0. See LICENSE.md for details.

About

GameFrameX Unity UI FairyGUI adapter integrating FairyGUI component management with the framework UI system

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages