void onEntityCreated(Pool pool, Entity entity) {
            entity.componentNames = _componentNames;

            var entityBehaviour = new GameObject().AddComponent<EntityBehaviour>();
            entityBehaviour.Init(_pool, entity, _componentNames, _componentTypes);
            entityBehaviour.transform.SetParent(_entitiesContainer, false);
        }
Exemple #2
0
 void addDebugComponent(Entity entity)
 {
     var debugBehaviour = new GameObject().AddComponent<EntityDebugBehaviour>();
     debugBehaviour.Init(this, entity, _debugIndex);
     debugBehaviour.transform.SetParent(_entitiesContainer, false);
     var debugComponent = new DebugComponent();
     debugComponent.debugBehaviour = debugBehaviour;
     entity.AddComponent(_debugIndex, debugComponent);
 }
Exemple #3
0
 /// <summary>
 /// 
 /// </summary>
 /// <param name="fullUrl"></param>
 /// <param name="saveFullPath">完整的保存路径!</param>
 /// <param name="useContinue">是否断点续传</param>
 /// <param name="useCache">如果存在则不下载了!</param>
 /// <param name="expireDays"></param>
 /// <param name="timeout"></param>
 public static KHttpDownloader Load(string fullUrl, string saveFullPath, bool useContinue = false,
     bool useCache = false, int expireDays = 1, int timeout = 5)
 {
     var downloader = new GameObject("HttpDownloader+" + fullUrl).AddComponent<KHttpDownloader>();
     downloader.Init(fullUrl, saveFullPath, useContinue, useCache, expireDays, timeout);
     DontDestroyOnLoad(downloader.gameObject);
     return downloader;
 }
 void onEntityCreated(Pool pool, Entity entity)
 {
     var entityBehaviour = new GameObject().AddComponent<EntityBehaviour>();
     entityBehaviour.Init(pool, entity);
     entityBehaviour.transform.SetParent(_entitiesContainer, false);
 }
 void onEntityCreated(Context context, Entity entity)
 {
     var entityBehaviour = new GameObject().AddComponent<EntityBehaviour>();
     entityBehaviour.Init(context, entity);
     entityBehaviour.transform.SetParent(_gameObject.transform, false);
 }