Giter Site home page Giter Site logo

yomunsam / tinax Goto Github PK

View Code? Open in Web Editor NEW
788.0 25.0 95.0 3.7 MB

TinaX Framework : Unity based Game Client Framework | 基于 Unity 的游戏客户端开发框架

Home Page: https://tinax.corala.space

License: Other

C# 100.00%
framework tinax unity unity3d

tinax's Introduction

TinaX

Documentation is being written.

Sorry, English is not the author ’s native language, writing English documentation is more difficult for the author.

This means that English documents will be completed slightly later than Chinese documents 中文文档.

If you can, please help us to participate in the preparation of English documentation.

Unity-based Game Client Framework

LICENSE 996.icu LICENSE GitHub stars

TinaX Framework is a simple, complete, out-of-the-box development framework based on the Unity engine. TinaX's goal is to be a framework that adapts to different project and team sizes.

  • Support all Unity target platforms except WebGL
  • Use C#/Lua to develop games and support hot code updates
  • Introduce the various modules of the project as needed and replace them freely
  • "Asynchronous First" design concept
  • "Interface-oriented" weak coupling design

Environmental Requirements

Unity

  • Version used to develop TinaX: Unity 2019.4.0f1
  • Recommended version for production: Unity 2019.4.x LTS
  • Minimum compatible version of theory: Unity 2019.4.x

C#

  • Unity Api Compatibility Level: .NET 4.X/.NET Standard 2.0
  • C# 7.2

Community communication


Learn TinaX

Packages: TinaX Framework uses Unity packages to organize and manage the modules of each function. By installing different Packages, you can add different functional modules to the project. No matter what stage your project is in, you can easily access TinaX.

Example: You can view Example Project in this repository

The description of each Packages is as follows:

TinaX.Core

TinaX.Core is the basic package of TinaX. It is responsible for startup and managing all services, providing common basic functions, providing event system, dependency injection, etc.


TinaX.VFS

Virtual File System (VFS) is TinaX's assets management service. It simulates the directory structure of "Assets/xxx" in the Unity project at runtime, and implements assets loading, dependency management, version management and update, memory gc, etc.


TinaX.UIKit

UIKit provides uGUI-based UI management services for TinaX, such as open, close, hide the UI, avoiding full-screen UIs from each other, and UI startup parameters.

And it provides related content such as component extensions and extensible UI animations.


TinaX.I18N

I18N (Internationalized) support services based on the form of key / value make your application more friendly to users in different languages and regions around the world.


TinaX.Lua

Provides Lua language runtime for TinaX. This service is based on Tencent/xLua.


TinaX.ILRuntime

Provides hot-updatable C# runtime for TinaX. The service is based on ILRuntime.





Excellent Unity project recommendation

  • QFramework : Your first K.I.S.S Unity 3D Framework.
  • xasset : A lightweight assets management framework.
  • CatLib : CatLib lightweight dependency injection container

tinax's People

Contributors

yomunsam avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

tinax's Issues

[BUG]疑似bug : Cloud Build

Bug描述

image

Unity Cloud Build时候选择Clean Build时,首次Build出的包中不包含业务逻辑部分的全部assetbundle包,但是有framework部分的。
观察log发现,疑似Clean Build时候,.asset配置文件全部没读出来,先记下来,到底是Unity的锅还是framework的锅就不好说了

复现方式

喵叽

其他

Add more example about Dialog, Menu

Hi!
This framework is awesome!
For easy to getting start, could you please add more example for demo using Panel, Dialog and How to use the controller class to handle logic code
Thank so much!

[BUG]

Bug描述

在静音状态下,切换到另一首歌时,又有声音

复现方式

静音后静静等待第二首歌播放

其他

对新的XCore的改进构想

当前版本的框架在XCore中注册了各种功能模块
image

然后具体各个模块的配置,加载逻辑等等,是用Unity的.asset的配置功能放在Assets目录下的某个固定位置的。
image

改进的构想首先是脱离对.asset的默认依赖,一方面,Assets目录看起来更干净了,
image

对应的,我们可以直接把配置写在XCore的注册阶段,就大概像这样

IXCore core = XCore.CreateDefault()
    .AddILRuntime(options =>
    {
        options.LoadAssemblies.Add("Assets/Game/Assemblies/TinaDev.Hot.dll.bytes",
            "Assets/Game/Assemblies/TinaDev.Hot.pdb.bytes"); 
    })
    .AddVFS(options =>
    {
        options.AddSimpleGroup(
            "Assets/App/Scenes",
            "Assets/App/UI",
            "Assets/Arts/UI/Images"
        );
    });

然后在此基础上,我们可以更方便的扩展一些配置来源,比如我们依然可以使用.asset配置文件:

IXCore core = XCore.CreateDefault()
    .AddILRuntime(options =>
    {
        options.SetOptionsFromUnityAssets("Assets/xxx/xxx");
    });

在上面这个实现中,SetOptionsFromUnityAssets可以是异步的,并且实际执行的时机是在对应的服务启动阶段。

以及,我们可以使用更像现代 .NET 的写法:

IXCore core = XCore.CreateDefault()
    .AddILRuntime((options, configuration) =>
    {
        configuration.Bind(options);
    })

其中上面这个configuration对应的是IConfiguration接口,在当前版本中也是存在的,它是对Microsoft.Extensions.Configuration的简化搬运,而这个接口也是可以自定义各种配置提供者来源,比如常见的从json文件、从命令行参数、从热更新补丁、从服务器等。


如此设计的优点是可定制的自由度更高


当前这个设计的一大弊端就是,对于小项目来说变得麻烦了。问题在于Editor功能,比如说Editor功能要对资产打包Assetbundle的话,以前Edtior功能是直接读.asset配置文件的,而现在runtime的配置必须把程序跑起来才能确定,对于Editor来说就没法解决了。

解决方法的构想的话,

  1. 在Editor需要获取配置的时候,先把XCore实例跑起来,然后Editor功能都写成依赖XCore的服务。这个感觉会有坑
  2. 单独再写一遍编辑器下的配置内容。
  3. 约定大于配置,继续默认用.asset

下面这段只是构想阶段,还没实现

比方说,在默认情况下,我们写runtime的XCore:

IXCore core = XCore.CreateDefault()
    .AddILRuntime()

这时候对于这个功能模块来说它就默认继续使用.asset配置,于是对应的,我们不需要对Editor做任何改动,它还是继续去读.asset好了。就和当前版本的情况一样。

而比如说,我们runtime下添加了自定义配置:

IXCore core = XCore.CreateDefault()
    .AddILRuntime(options =>{
        options.LoadAssemblies.Add("Assets/Game/Assemblies/TinaDev.Hot.dll.bytes",
            "Assets/Game/Assemblies/TinaDev.Hot.pdb.bytes"); 
    });

对应的我们可能就得给Editor也专门写一段代码:

#if UNITY_EDITOR
using TinaXEditor.XILRuntime;

public static class XILRuntimeDefine
{
    [EditorXILRuntimeOptions]
    public static XILRuntimeOptions GetOptions()
    {
        var options =  new XILRuntimeOptions();
        options.EditorLoadAssemblyPaths.Add("Assets/Game/Assemblies/TinaDev.Hot.dll.bytes",
            "Assets/Game/Assemblies/TinaDev.Hot.pdb.bytes");
    }

}
#endif


不过,这个设定其实并不需要XCore做任何特殊处理,完全是各个功能模块可以各自考虑的问题,也许我们可以把部分配置内容比较简单的模块先这么搞搞看

[BUG] 依赖资源被提前释放的问题

Bug描述

假设有ab包A,B,c

其中,AB依赖c

首先加载A, 这时候依赖c也会跟着被加载,没问题,

然后在异步加载B的同时卸载A包,就出问题了:

  1. B的异步加载流程首先检查依赖c,发现已经被加载了,
  2. 在异步加载B本体的过程中,卸载A(此时c的引用计数器是1)会导致c的引用计数器归零,触发c的卸载
  3. B包异步加载结束之后,对BB的依赖c执行计数器+1,于是c的计数器为1,但AB包已经被卸载了

[BUG] 在IL2CPP模式下启动游戏有一定几率卡死

Bug描述

TinaX6.5.x预览版本,
使用IL2CPP方式构建的真机包中,有一定几率在启动时卡死,不会触发任何业务逻辑层面的入口代码。

在Android、iOS平台复现必现,UWP IL2CPP不会触发bug

复现方式

其他

[BUG] 一个智障的命名错误,

Bug描述

先给记录一下
image

当然,修是不可能修的,因为目前正在整体重构这段内容。测完没什么问题的话直接覆盖到这边

复现方式

其他

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.