Ejemplo n.º 1
0
 public void SetShowTargetInfo(uint _TargetID)
 {
     this.showInfoTargetID = _TargetID;
     if (ActorHelper.IsHostActor(ref this.actorPtr))
     {
         SelectTargetEventParam selectTargetEventParam = new SelectTargetEventParam(this.showInfoTargetID);
         Singleton <GameSkillEventSys> .GetInstance().SendEvent <SelectTargetEventParam>(GameSkillEventDef.Event_SelectTarget, base.GetActor(), ref selectTargetEventParam, GameSkillEventChannel.Channel_HostCtrlActor);
     }
 }
Ejemplo n.º 2
0
 public void ClearCommonAttackTarget()
 {
     if ((this.commonAttackTargetID != 0) && ActorHelper.IsHostActor(ref this.actorPtr))
     {
         SelectTargetEventParam param = new SelectTargetEventParam(this.commonAttackTargetID);
         Singleton <GameSkillEventSys> .GetInstance().SendEvent <SelectTargetEventParam>(GameSkillEventDef.Event_ClearTarget, base.GetActor(), ref param, GameSkillEventChannel.Channel_HostCtrlActor);
     }
     this.commonAttackTargetID = 0;
 }
Ejemplo n.º 3
0
 public void SetCommonAttackTarget(uint _targetID)
 {
     if (this.commonAttackTargetID != _targetID)
     {
         this.commonAttackTargetID = _targetID;
         if (ActorHelper.IsHostActor(ref this.actorPtr))
         {
             SelectTargetEventParam param = new SelectTargetEventParam(this.commonAttackTargetID);
             Singleton <GameSkillEventSys> .GetInstance().SendEvent <SelectTargetEventParam>(GameSkillEventDef.Event_SelectTarget, base.GetActor(), ref param, GameSkillEventChannel.Channel_HostCtrlActor);
         }
     }
 }
Ejemplo n.º 4
0
        private void OnClearTarget(ref SelectTargetEventParam _param)
        {
            PoolObjHandle <ActorRoot> actor = Singleton <GameObjMgr> .GetInstance().GetActor(_param.commonAttackTargetID);

            if (actor && this.indicatePrefab != null)
            {
                this.targetObj = new PoolObjHandle <ActorRoot>(null);
                this.HidePrefab(this.indicatePrefab);
                MonoSingleton <SceneMgr> .GetInstance().AddToRoot(this.indicatePrefab, SceneObjType.ActionRes);

                if (actor.get_handle().TheActorMeta.ActorType == ActorTypeDef.Actor_Type_Hero && this.lockHeroPrefab != null)
                {
                    this.HidePrefab(this.lockHeroPrefab);
                    MonoSingleton <SceneMgr> .GetInstance().AddToRoot(this.lockHeroPrefab, SceneObjType.ActionRes);
                }
            }
        }
Ejemplo n.º 5
0
        private void OnSelectTarget(ref SelectTargetEventParam _param)
        {
            Vector3 zero = Vector3.zero;
            PoolObjHandle <ActorRoot> actor = Singleton <GameObjMgr> .GetInstance().GetActor(_param.commonAttackTargetID);

            if (((actor != 0) && (this.indicatePrefab != null)) && !ActorHelper.IsHostActor(ref actor))
            {
                this.targetObj = actor;
                this.indicatePrefab.SetActive(true);
                if (this.targetObj.handle.CharInfo != null)
                {
                    this.SetPrefabScaler(this.indicatePrefab, this.targetObj.handle.CharInfo.iCollisionSize.x);
                }
                else
                {
                    this.SetPrefabScaler(this.indicatePrefab, 400);
                }
                zero    = actor.handle.gameObject.transform.position;
                zero.y += 0.2f;
                this.indicatePrefab.transform.position = zero;
                this.indicatePrefab.transform.SetParent(actor.handle.gameObject.transform);
                this.indicatePrefab.SetLayer("Actor");
                if (this.lockHeroPrefab != null)
                {
                    if (actor.handle.TheActorMeta.ActorType == ActorTypeDef.Actor_Type_Hero)
                    {
                        float num = 0f;
                        if (actor.handle.CharInfo != null)
                        {
                            num = ((float)actor.handle.CharInfo.iBulletHeight) / 1000f;
                        }
                        this.lockHeroPrefab.SetActive(true);
                        zero.y += num;
                        this.lockHeroPrefab.transform.position = zero;
                        this.lockHeroPrefab.transform.SetParent(actor.handle.gameObject.transform);
                        this.lockHeroPrefab.SetLayer("Actor");
                    }
                    else
                    {
                        this.lockHeroPrefab.SetActive(false);
                        MonoSingleton <SceneMgr> .GetInstance().AddToRoot(this.lockHeroPrefab, SceneObjType.ActionRes);
                    }
                }
            }
        }
Ejemplo n.º 6
0
        private void OnSelectTarget(ref SelectTargetEventParam _param)
        {
            Vector3 position = Vector3.zero;
            PoolObjHandle <ActorRoot> actor = Singleton <GameObjMgr> .GetInstance().GetActor(_param.commonAttackTargetID);

            if (actor && this.indicatePrefab != null && !ActorHelper.IsHostActor(ref actor))
            {
                this.targetObj = actor;
                this.ShowPrefab(this.indicatePrefab);
                if (this.targetObj.get_handle().CharInfo != null)
                {
                    this.SetPrefabScaler(this.indicatePrefab, this.targetObj.get_handle().CharInfo.iCollisionSize.x);
                }
                else
                {
                    this.SetPrefabScaler(this.indicatePrefab, 400);
                }
                position    = actor.get_handle().myTransform.position;
                position.y += 0.2f;
                this.indicateTransform.position = position;
                this.indicateTransform.SetParent(actor.get_handle().myTransform);
                this.indicateTransform.localRotation = Quaternion.Euler(90f, 0f, 0f);
                if (this.lockHeroPrefab != null)
                {
                    if (actor.get_handle().TheActorMeta.ActorType == ActorTypeDef.Actor_Type_Hero)
                    {
                        float num = 0f;
                        if (actor.get_handle().CharInfo != null)
                        {
                            num = (float)actor.get_handle().CharInfo.iBulletHeight / 1000f;
                        }
                        position.y += num;
                        this.lockHeroTransform.position = position;
                        this.lockHeroTransform.SetParent(actor.get_handle().myTransform);
                        this.ShowPrefab(this.lockHeroPrefab);
                    }
                    else
                    {
                        this.HidePrefab(this.lockHeroPrefab);
                        MonoSingleton <SceneMgr> .GetInstance().AddToRoot(this.lockHeroPrefab, SceneObjType.ActionRes);
                    }
                }
            }
        }