- 支持AssetBundle中加载的资源
- 支持多个AssetBundle平台的Build
- AssetBundle依赖的问题处理
- 完成AssetBundle简单管理
- prefab的卸载支持
- 异步加载支持
- 学习AssetBundle相关内容
- 显示当前加载资源
- 引用计数
- 卸载Resources.Load加载的资源
- 学习静态this扩展
- 应用静态this扩展
-
应用单例模板
-
学习单元测试
-
简单单例
public class SingletonExample { private static SingletonExample mInstance; private SingletonExample() { } public static SingletonExample Instance { get { if(mInstance == null) { mInstance = new SingletonExample(); } return mInstance; } } }
-
单例模板
public abstract class Singleton<T> where T : Singleton<T> { private static T mInstance; protected Singleton() { } public static T Instance { get { if (mInstance == null) { // 反射获得无参构造函数 ConstructorInfo[] ctors = typeof(T).GetConstructors(BindingFlags.Instance | BindingFlags.NonPublic); ConstructorInfo ctor = Array.Find(ctors, c => c.GetParameters().Length == 0); if(ctor == null) { throw new Exception("Non-public ctor() not found!"); } mInstance = ctor.Invoke(null) as T; } return mInstance; } } }
-
使用模板
public class SingletonExample : Singleton<SingletonExample> { private SingletonExample() { Debug.Log("singleton Example ctor"); } #if UNITY_EDITOR [UnityEditor.MenuItem("MFramework/Example/16.SingletonExample", false, 16)] #endif static void MenuClicked() { var instance = SingletonExample.Instance; instance = SingletonExample.Instance; } }
- Manager Of Managers雏形完成
- 第一次整理后的备份
- 第一次整理前的备份