예제 #1
0
 public static void Init()
 {
     LuaEnv.AddIniter(Init);
     InitLuaEnv();
     OnInit();
     StartHotfix();
     OperationTablePool = new RecyclePool <LuaBase>(() => luaEnv.NewTable());
 }
예제 #2
0
        public T Get <T>(long aoiId)
            where T : EntityComp
        {
            EntityComp protoData          = null;
            Type       protoType          = typeof(T);
            RecyclePool <EntityComp> pool = null;

            if (poolMap.TryGetValue(protoType, out pool))
            {
                protoData = pool.Alloc();
                Dictionary <long, EntityComp> comps = null;
                if (compListMap.TryGetValue(typeof(T), out comps))
                {
                    comps.Add(aoiId, protoData);
                }
            }
            return((T)protoData);
        }
예제 #3
0
 public void InitPool(RecyclePool <T> pool)
 {
     objectPool = pool;
 }