Esempio n. 1
0
        public static PoolObjHandle <ActorRoot> AttachActorRoot(GameObject go, ActorTypeDef actorType, bool isFirstTime = true)
        {
            DebugHelper.Assert(!Singleton <BattleLogic> .instance.isFighting || Singleton <GameLogic> .instance.bInLogicTick);
            ActorConfig component = null;

            if (isFirstTime)
            {
                component = go.AddComponent <ActorConfig>();
            }
            else
            {
                component = go.GetComponent <ActorConfig>();
                if (null == component)
                {
                    component = go.AddComponent <ActorConfig>();
                }
            }
            ActorMeta theActorMeta = new ActorMeta {
                ActorType = actorType
            };
            PoolObjHandle <ActorRoot> handle = component.AttachActorRoot(go, ref theActorMeta, null);

            handle.handle.Spawned();
            return(handle);
        }
Esempio n. 2
0
        public static PoolObjHandle <ActorRoot> AttachActorRoot(GameObject go)
        {
            DebugHelper.Assert((!Singleton <BattleLogic> .instance.isFighting || Singleton <GameLogic> .instance.bInLogicTick) || Singleton <FrameSynchr> .instance.isCmdExecuting);
            ActorConfig component = go.GetComponent <ActorConfig>();

            if (null == component)
            {
                component = go.AddComponent <ActorConfig>();
            }
            ActorMeta theActorMeta = new ActorMeta {
                ActorType = ActorTypeDef.Invalid
            };
            PoolObjHandle <ActorRoot> handle = component.AttachActorRoot(go, ref theActorMeta, null);

            handle.handle.Spawned();
            return(handle);
        }
Esempio n. 3
0
        public static PoolObjHandle <ActorRoot> AttachActorRoot(GameObject go)
        {
            DebugHelper.Assert(!Singleton <BattleLogic> .get_instance().isFighting || Singleton <GameLogic> .get_instance().bInLogicTick || Singleton <FrameSynchr> .get_instance().isCmdExecuting);
            ActorConfig actorConfig = go.GetComponent <ActorConfig>();

            if (null == actorConfig)
            {
                actorConfig = go.AddComponent <ActorConfig>();
            }
            ActorMeta actorMeta  = default(ActorMeta);
            ActorMeta actorMeta2 = actorMeta;

            actorMeta2.ActorType = ActorTypeDef.Invalid;
            actorMeta            = actorMeta2;
            PoolObjHandle <ActorRoot> result = actorConfig.AttachActorRoot(go, ref actorMeta, null);

            result.get_handle().Spawned();
            return(result);
        }
Esempio n. 4
0
        public static PoolObjHandle <ActorRoot> AttachActorRoot(GameObject go, ActorTypeDef actorType, COM_PLAYERCAMP camp, CActorInfo actorInfo)
        {
            DebugHelper.Assert(!Singleton <BattleLogic> .instance.isFighting || Singleton <GameLogic> .instance.bInLogicTick || Singleton <FrameSynchr> .instance.isCmdExecuting);
            ActorConfig actorConfig = go.GetComponent <ActorConfig>();

            if (null == actorConfig)
            {
                actorConfig = go.AddComponent <ActorConfig>();
            }
            ActorMeta actorMeta  = default(ActorMeta);
            ActorMeta actorMeta2 = actorMeta;

            actorMeta2.ActorType = actorType;
            actorMeta2.ActorCamp = camp;
            actorMeta            = actorMeta2;
            PoolObjHandle <ActorRoot> result = actorConfig.AttachActorRoot(go, ref actorMeta, actorInfo);

            result.handle.Spawned();
            return(result);
        }