• Stars
    star
    1,520
  • Rank 29,875 (Top 0.7 %)
  • Language
    C#
  • License
    MIT License
  • Created over 7 years ago
  • Updated 12 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

An MVVM & Databinding framework that can use C# and Lua to develop games

Loxodon Framework(Unity-MVVM)

license release openupm npm

(δΈ­ζ–‡η‰ˆ)

MVVM and Databinding for Unity3d(C# & XLua & ILRuntime)

Developed by Clark

Requires Unity 2018.4 or higher.

LoxodonFramework is a lightweight MVVM(Model-View-ViewModel) framework built specifically to target Unity3D. Databinding and localization are supported.It has a very flexible extensibility.It makes your game development faster and easier.

For tutorials,examples and support,please see the project.You can also discuss the project in the Unity Forums.

The plugin is compatible with MacOSX,Windows,Linux,UWP,WebGL,IOS and Android,and provides all the source code of the project.

If you like this framework or think it is useful, please write a review on AssetStore or give me a STAR or FORK it on Github, thank you!

Tested in Unity 3D on the following platforms:
PC/Mac/Linux
IOS
Android
UWP(window10)
WebGL

Installation

For detailed installation steps, please refer to the installation documentation.

English manual

Key Features:

  • MVVM Framework;
  • Multiple platforms;
  • Higher Extensibility;
  • async&await (C#&Lua)
  • try&catch&finally for lua
  • XLua support(You can make your game in lua.);
  • Asynchronous result and asynchronous task are supported;
  • Scheduled Executor and Multi-threading;
  • Messaging system support;
  • Preferences can be encrypted;
  • Localization support;
  • Databinding support:
    • Field binding;
    • Property binding;
    • Dictionary,list and array binding;
    • Event binding;
    • Unity3d's EventBase binding;
    • Static property and field binding;
    • Method binding;
    • Command binding;
    • ObservableProperty,ObservableDictionary and ObservableList binding;
    • Expression binding;

Notes

  • .Net2.0 and .Net2.0 Subset,please use version 1.9.x.
  • LoxodonFramework 2.0 supports .Net4.x and .Net Standard2.0
  • LoxodonFramework 2.0 supports Mono and IL2CPP

Plugins

Quick Start

Create a view and view model of the progress bar.

public class ProgressBarViewModel : ViewModelBase
{
    private string tip;
    private bool enabled;
    private float value;
    public ProgressBarViewModel()
    {
    }

    public string Tip
    {
        get { return this.tip; }
        set { this.Set<string>(ref this.tip, value, nameof(Tip)); }
    }

    public bool Enabled
    {
        get { return this.enabled; }
        set { this.Set<bool>(ref this.enabled, value, nameof(Enabled)); }
    }

    public float Value
    {
        get { return this.value; }
        set { this.Set<float>(ref this.value, value, nameof(Value)); }
    }
}

public class ProgressBarView : UIView
{
    public GameObject progressBar;
    public Text progressTip;
    public Text progressText;
    public Slider progressSlider;

    protected override void Awake()
    {
        var bindingSet = this.CreateBindingSet<ProgressBar, ProgressBarViewModel>();

        bindingSet.Bind(this.progressBar).For(v => v.activeSelf).To(vm => vm.Enabled).OneWay();
        bindingSet.Bind(this.progressTip).For(v => v.text).To(vm => vm.Tip).OneWay();
        bindingSet.Bind(this.progressText).For(v => v.text)
            .ToExpression(vm => string.Format("{0:0.00}%", vm.Value * 100)).OneWay();
        bindingSet.Bind(this.progressSlider).For(v => v.value).To(vm => vm.Value).OneWay();

        bindingSet.Build();
    }
}


IEnumerator Unzip(ProgressBarViewModel progressBar)
{
    progressBar.Tip = "Unziping";
    progressBar.Enabled = true;//Display the progress bar

    for(int i=0;i<30;i++)
    {            
        //TODO:Add unzip code here.

        progressBar.Value = (i/(float)30);            
        yield return null;
    }

    progressBar.Enabled = false;//Hide the progress bar
    progressBar.Tip = "";        
}

Tutorials and Examples

Introduction

  • Window View

  • Localization

  • Databinding

  • Variable Example

  • ListView Binding

Contact Us

Email: [email protected]
Website: https://vovgou.github.io/loxodon-framework/
QQ Group: 622321589 15034148