Exemplo 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);
        }
Exemplo n.º 2
0
        public static void DetachActorRoot(GameObject go)
        {
            ActorConfig component = go.GetComponent <ActorConfig>();

            if (component != null)
            {
                component.DetachActorRoot();
            }
        }
Exemplo n.º 3
0
 public override void OnRelease()
 {
     this.CharInfo           = null;
     this.ObjLinker          = null;
     this.ActorMesh          = null;
     this.ActorMeshAnimation = null;
     this.isRecycled         = true;
     base.OnRelease();
 }
Exemplo n.º 4
0
        public static void DetachActorRoot(GameObject go)
        {
            ActorConfig component = go.GetComponent <ActorConfig>();

            if (component != null)
            {
                DebugHelper.Assert(!component.GetActorHandle() || component.GetActorHandle().get_handle().TheActorMeta.ActorType == ActorTypeDef.Actor_Type_Bullet);
                component.DetachActorRoot();
            }
        }
Exemplo n.º 5
0
 public override void OnRelease()
 {
     this.CharInfo           = null;
     this.ObjLinker          = null;
     this.myTransform        = null;
     this.ActorMesh          = null;
     this.ActorMeshAnimation = null;
     this.isRecycled         = true;
     this.ShadowEffect       = null;
     base.OnRelease();
 }
Exemplo n.º 6
0
 public override void OnUse()
 {
     base.OnUse();
     this.name               = string.Empty;
     this.isMovable          = true;
     this.isRotatable        = true;
     this.myTransform        = null;
     this.ActorMesh          = null;
     this.ActorMeshAnimation = null;
     this._bVisible          = true;
     this._bInitVisibleDelay = 0;
     this._bInCamera         = false;
     this.ObjID              = 0u;
     this.TheActorMeta       = default(ActorMeta);
     this.TheStaticData      = default(ActorStaticData);
     this.SelfPtr.Release();
     this.ObjLinker                   = null;
     this.ActorControl                = null;
     this.ActorAgent                  = null;
     this.MovementComponent           = null;
     this.SkillControl                = null;
     this.ValueComponent              = null;
     this.HurtControl                 = null;
     this.HudControl                  = null;
     this.AnimControl                 = null;
     this.BuffHolderComp              = null;
     this.MatHurtEffect               = null;
     this.ShadowEffect                = null;
     this.EquipComponent              = null;
     this.DefaultAttackModeControl    = null;
     this.LockTargetAttackModeControl = null;
     this.PetControl                  = null;
     this.OriginalActorMesh           = null;
     this.OriginalMeshAnim            = null;
     this.shape = null;
     this.slotList.Clear();
     this.bChildUpdate             = false;
     this.SMNode                   = null;
     this._location                = VInt3.zero;
     this._forward                 = VInt3.forward;
     this._rotation                = Quaternion.identity;
     this.groundY                  = 0;
     this.hasReachedNavEdge        = false;
     this.pickFlyY                 = 0;
     this.AttackOrderReady         = true;
     this.bOneKiller               = false;
     this.CharInfo                 = null;
     this.HorizonMarker            = null;
     this.BornPos                  = VInt3.zero;
     this.isRecycled               = false;
     this.BornPos                  = VInt3.zero;
     this.PositionRecords          = null;
     this.PositionRecordsLastStamp = 0f;
 }
Exemplo n.º 7
0
 public static PoolObjHandle <ActorRoot> GetActorRoot(GameObject go)
 {
     if (go != null)
     {
         ActorConfig component = go.GetComponent <ActorConfig>();
         if (component != null)
         {
             return(component.GetActorHandle());
         }
     }
     return(new PoolObjHandle <ActorRoot>(null));
 }
Exemplo n.º 8
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);
        }
Exemplo n.º 9
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);
        }
Exemplo n.º 10
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);
        }
Exemplo n.º 11
0
 public void Play(GameObject inSrc, GameObject inDest, ref Vector3 inDestPos)
 {
     this.SrcObj       = inSrc;
     this.DestObj      = inDest;
     this.DestPosition = inDestPos;
     this.m_bWorking   = true;
     if (inSrc != null)
     {
         ActorConfig component = inSrc.GetComponent <ActorConfig>();
         if (component != null)
         {
             this.SrcActorHandle = component.GetActorHandle();
         }
     }
     if (inDest != null)
     {
         ActorConfig config2 = inDest.GetComponent <ActorConfig>();
         if (config2 != null)
         {
             this.DestActorHandle = config2.GetActorHandle();
         }
     }
 }
Exemplo n.º 12
0
 public void AddStaticActor(ActorConfig actor)
 {
     this.staticActors.Add(actor);
 }