Esempio n. 1
0
        /// <summary>
        /// 每小时(的第几分第几秒), 有些需求要求每个小时的0分0秒, 这种需求不多
        /// </summary>
        public static TaskInfo AddTaskHourly(int min, int sec, Action callback)
        {
            TaskInfo task = m_TaskPool.Alloc();

            task.SetInfo(TaskType.Hourly, callback, 0, 0, 0, 0, 0, min, sec);
            task.AddToNextLoop();
            return(task);
        }
Esempio n. 2
0
 public void Init(int sceneId, int aoiId, int resId, int entityType, Action <LuaTable> onBodycreated)
 {
     AoiId        = aoiId;
     SceneId      = sceneId;
     ResId        = resId;
     EntityType   = entityType;
     OnBodyCreate = onBodycreated;
     StatusTable  = m_StatusTablePool.Alloc() as LuaTable;
     CompTable    = m_CompTablePool.Alloc() as LuaTable;
     TransTable   = m_TransTablePool.Alloc() as LuaTable;
 }
Esempio n. 3
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);
        }