Exemple #1
0
 public static void Init()
 {
     LuaEnv.AddIniter(Init);
     InitLuaEnv();
     OnInit();
     StartHotfix();
     OperationTablePool = new RecyclePool <LuaBase>(() => luaEnv.NewTable());
 }
Exemple #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);
        }
Exemple #3
0
 public void InitPool(RecyclePool <T> pool)
 {
     objectPool = pool;
 }