Beispiel #1
0
 public void SetActorMesh(GameObject InActorMesh)
 {
     if (InActorMesh != this.ActorMesh)
     {
         this.ObjLinker.OnActorMeshChanged(InActorMesh);
         this.ActorMesh          = InActorMesh;
         this.ActorMeshAnimation = ((!(this.ActorMesh != null)) ? null : this.ActorMesh.GetComponent <Animation>());
         if (this.ActorMesh != null)
         {
             if (this._bVisible)
             {
                 MMGame_Math.SetLayer(this.ActorMesh, "Actor", "Particles", true);
             }
             else
             {
                 MMGame_Math.SetLayer(this.ActorMesh, "Hide", true);
             }
         }
         if (this.ActorControl != null)
         {
             this.ActorControl.UpdateAnimPlaySpeed();
         }
         if (this.MatHurtEffect != null)
         {
             this.MatHurtEffect.OnMeshChanged();
         }
     }
 }
Beispiel #2
0
 private void HidePrefab(GameObject _prefab)
 {
     if (_prefab != null)
     {
         MMGame_Math.SetLayer(_prefab, "Hide", false);
     }
 }
        public void onActorDead(ref GameDeadEventParam prm)
        {
            if (!prm.bImmediateRevive || !this.actorPtr || this.actorPtr != prm.src)
            {
                return;
            }
            GameObject pooledGameObjLOD = MonoSingleton <SceneMgr> .GetInstance().GetPooledGameObjLOD("Prefab_Skill_Effects/tongyong_effects/Huanling_Effect/fuhuodun_buff_01", true, SceneObjType.ActionRes, this.actorPtr.get_handle().myTransform.position);

            if (pooledGameObjLOD != null)
            {
                string text = "Particles";
                if (this.actorPtr.get_handle().gameObject.layer == LayerMask.NameToLayer("Hide"))
                {
                    text = "Hide";
                }
                MMGame_Math.SetLayer(pooledGameObjLOD, text, false);
                pooledGameObjLOD.transform.SetParent(this.actorPtr.get_handle().myTransform);
                ParticleSystem component = pooledGameObjLOD.GetComponent <ParticleSystem>();
                if (component != null)
                {
                    component.Play(true);
                }
                Singleton <CGameObjectPool> .GetInstance().RecycleGameObjectDelay(pooledGameObjLOD, 5000, null);
            }
        }
        private void CreateParticle(string _resName, ref PoolObjHandle <ActorRoot> _origin, ref PoolObjHandle <ActorRoot> _target)
        {
            if (!_target)
            {
                return;
            }
            string resourceName = SkinResourceHelper.GetResourceName(ref _origin, _resName, true);

            this.particleObj = MonoSingleton <SceneMgr> .GetInstance().GetPooledGameObjLOD(resourceName, true, SceneObjType.ActionRes, _target.get_handle().myTransform.position);

            if (this.particleObj == null)
            {
                this.particleObj = MonoSingleton <SceneMgr> .GetInstance().GetPooledGameObjLOD(_resName, true, SceneObjType.ActionRes, _target.get_handle().myTransform.position);
            }
            if (this.particleObj != null)
            {
                string text = "Particles";
                if (_target.get_handle().gameObject.layer == LayerMask.NameToLayer("Hide"))
                {
                    text = "Hide";
                }
                MMGame_Math.SetLayer(this.particleObj, text, false);
                this.particleObj.transform.SetParent(_target.get_handle().myTransform);
                ParticleSystem component = this.particleObj.GetComponent <ParticleSystem>();
                if (component != null)
                {
                    component.Play(true);
                }
            }
        }
Beispiel #5
0
 private void ShowPrefab(GameObject _prefab)
 {
     if (_prefab != null)
     {
         MMGame_Math.SetLayer(_prefab, "Actor", "Particles", false);
     }
 }
Beispiel #6
0
        public static bool SetObjWithColVisibleByFowAttached(GameObject inObj, GameFowManager fowMgr, COM_PLAYERCAMP inHostCamp, PoolObjHandle <ActorRoot> inAttachActor)
        {
            if (inObj == null)
            {
                return(false);
            }
            if (!inAttachActor || inAttachActor.get_handle().shape == null)
            {
                return(GameFowCollector.SetObjVisibleByFow(inObj, fowMgr, inHostCamp));
            }
            VCollisionShape shape    = inAttachActor.get_handle().shape;
            VInt3           location = inAttachActor.get_handle().location;

            location = new VInt3(location.x, location.z, 0);
            bool flag = fowMgr.IsSurfaceCellVisible(location, inHostCamp);

            if (flag)
            {
                MMGame_Math.SetLayer(inObj, "Actor", "Particles", true);
            }
            else
            {
                flag = shape.AcceptFowVisibilityCheck(inHostCamp, fowMgr);
                if (flag)
                {
                    MMGame_Math.SetLayer(inObj, "Actor", "Particles", true);
                }
                else
                {
                    MMGame_Math.SetLayer(inObj, "Hide", true);
                }
            }
            return(flag);
        }
Beispiel #7
0
        public static bool SetObjVisibleByFowAttached(GameObject obj, GameFowManager fowMgr, COM_PLAYERCAMP inHostCamp, PoolObjHandle <ActorRoot> inAttachActor)
        {
            if (obj == null)
            {
                return(false);
            }
            bool flag;

            if (inAttachActor)
            {
                VInt3 location = inAttachActor.get_handle().location;
                location = new VInt3(location.x, location.z, 0);
                flag     = fowMgr.IsSurfaceCellVisible(location, inHostCamp);
                if (flag)
                {
                    MMGame_Math.SetLayer(obj, "Actor", "Particles", true);
                }
                else
                {
                    MMGame_Math.SetLayer(obj, "Hide", true);
                }
            }
            else
            {
                flag = GameFowCollector.SetObjVisibleByFow(obj, fowMgr, inHostCamp);
            }
            return(flag);
        }
 private static void ReviveTower(ActorRoot inActor, int inParam)
 {
     if (inActor != null && inActor.ActorControl != null && inActor.ActorControl.IsDeadState)
     {
         inActor.ActorControl.Revive(false);
         inActor.RecoverOriginalActorMesh();
         if (inActor.ActorMesh != null)
         {
             MMGame_Math.SetLayer(inActor.ActorMesh, "Actor", "Particles", true);
         }
     }
 }
Beispiel #9
0
        public override void Enter(Action _action, Track _track)
        {
            Player hostPlayer = Singleton <GamePlayerCenter> .GetInstance().GetHostPlayer();

            if (hostPlayer != null && hostPlayer.Captain)
            {
                DebugHelper.Assert(hostPlayer.Captain, "Captain Hero is NULL!!");
                if (this.bShow)
                {
                    MMGame_Math.SetLayer(hostPlayer.Captain.get_handle().ActorMesh, "Actor", false);
                }
                else
                {
                    MMGame_Math.SetLayer(hostPlayer.Captain.get_handle().ActorMesh, "Hide", false);
                }
            }
        }
Beispiel #10
0
        public static bool SetObjVisibleByFow(GameObject obj, GameFowManager fowMgr, COM_PLAYERCAMP inHostCamp)
        {
            if (obj == null)
            {
                return(false);
            }
            VInt3 worldLoc = (VInt3)obj.transform.position;

            worldLoc = new VInt3(worldLoc.x, worldLoc.z, 0);
            bool flag = fowMgr.IsSurfaceCellVisible(worldLoc, inHostCamp);

            if (flag)
            {
                MMGame_Math.SetLayer(obj, "Actor", "Particles", true);
            }
            else
            {
                MMGame_Math.SetLayer(obj, "Hide", true);
            }
            return(flag);
        }
        private void OnHeroSoulLevelChange()
        {
            if (!this.actorPtr || this.actorPtr.get_handle().ActorControl.IsDeadState || !this.actorPtr.get_handle().Visible || !this.actorPtr.get_handle().InCamera || this.actorPtr.get_handle().ValueComponent.actorSoulLevel <= 1)
            {
                return;
            }
            Vector3 position = this.actor.myTransform.position;

            position = new Vector3(position.x, position.y + 0.24f, position.z);
            Quaternion rot            = Quaternion.Euler(-90f, 0f, 0f);
            bool       flag           = false;
            string     levelUpEftPath = ((HeroWrapper)this.actorPtr.get_handle().ActorControl).GetLevelUpEftPath(this.actorPtr.get_handle().ValueComponent.actorSoulLevel);
            GameObject gameObject     = null;

            if (!string.IsNullOrEmpty(levelUpEftPath))
            {
                gameObject = MonoSingleton <SceneMgr> .GetInstance().GetPooledGameObjLOD(levelUpEftPath, true, SceneObjType.ActionRes, position, rot, out flag);
            }
            if (null == gameObject)
            {
                gameObject = MonoSingleton <SceneMgr> .GetInstance().GetPooledGameObjLOD(EffectPlayComponent.s_heroSoulLevelUpEftPath, true, SceneObjType.ActionRes, position, rot, out flag);
            }
            if (null == gameObject)
            {
                return;
            }
            Singleton <CGameObjectPool> .GetInstance().RecycleGameObjectDelay(gameObject, 5000, null);

            Transform transform = (!this.actor.ActorMesh) ? this.actor.myTransform : this.actor.ActorMesh.transform;
            string    text      = "Particles";

            if (transform && transform.gameObject.layer == LayerMask.NameToLayer("Hide"))
            {
                text = "Hide";
            }
            gameObject.transform.SetParent(transform);
            MMGame_Math.SetLayer(gameObject, text, false);
            Singleton <CSoundManager> .get_instance().PlayBattleSound("Level_Up", this.actorPtr, base.gameObject);
        }
Beispiel #12
0
        public void InitForInvisibleBullet()
        {
            if (this.actor == null)
            {
                return;
            }
            MMGame_Math.SetLayer(base.gameObject, "Actor", "Particles", true);
            this.actor.SkillControl   = this.actor.CreateLogicComponent <SkillComponent>(this.actor);
            this.actor.BuffHolderComp = this.actor.CreateLogicComponent <BuffHolderComponent>(this.actor);
            if (FogOfWar.enable)
            {
                this.actor.HorizonMarker = this.actor.CreateLogicComponent <HorizonMarkerByFow>(this.actor);
                Player hostPlayer = Singleton <GamePlayerCenter> .get_instance().GetHostPlayer();

                if (hostPlayer != null)
                {
                    if (this.actor.TheActorMeta.ActorCamp == hostPlayer.PlayerCamp)
                    {
                        this.actor.Visible = true;
                    }
                    else
                    {
                        VInt3 worldLoc = new VInt3(this.actor.location.x, this.actor.location.z, 0);
                        this.actor.Visible = Singleton <GameFowManager> .get_instance().IsSurfaceCellVisible(worldLoc, hostPlayer.PlayerCamp);
                    }
                }
            }
            else
            {
                this.actor.HorizonMarker = this.actor.CreateLogicComponent <HorizonMarker>(this.actor);
            }
            this.actor.MatHurtEffect = this.actor.CreateActorComponent <MaterialHurtEffect>(this.actor);
            if (this.actor.MatHurtEffect != null && this.actor.MatHurtEffect.mats != null)
            {
                this.actor.MatHurtEffect.mats.Clear();
                this.actor.MatHurtEffect.mats = null;
            }
        }
Beispiel #13
0
        public void UpdateSubParObjVisibility(bool inVisible)
        {
            int count = this.SubParObjList_.get_Count();

            if (count > 0)
            {
                for (int i = count - 1; i >= 0; i--)
                {
                    GameObject gameObject = this.SubParObjList_.get_Item(i);
                    if (gameObject == null)
                    {
                        this.SubParObjList_.RemoveAt(i);
                    }
                    else if (inVisible)
                    {
                        MMGame_Math.SetLayer(gameObject, "Actor", "Particles", true);
                    }
                    else
                    {
                        MMGame_Math.SetLayer(gameObject, "Hide", true);
                    }
                }
            }
        }
Beispiel #14
0
        private GameObject InstParObj(string prefabName, Action _action, bool bCheckParLife)
        {
            Vector3    pos         = this.bindPosOffset;
            Quaternion rot         = this.bindRotOffset;
            GameObject gameObject  = _action.GetGameObject(this.targetId);
            GameObject gameObject2 = _action.GetGameObject(this.objectSpaceId);
            Transform  transform   = null;
            Transform  transform2  = null;

            if (this.bindPointName.get_Length() == 0)
            {
                if (gameObject != null)
                {
                    transform = gameObject.transform;
                }
                else if (gameObject2 != null)
                {
                    transform2 = gameObject2.transform;
                }
            }
            else if (gameObject != null)
            {
                Transform transform3 = SubObject.FindSubObject(gameObject, this.bindPointName).transform;
                if (transform3 != null)
                {
                    transform = transform3;
                }
                else if (gameObject != null)
                {
                    transform = gameObject.transform;
                }
            }
            else if (gameObject2 != null)
            {
                Transform transform3 = SubObject.FindSubObject(gameObject2, this.bindPointName).transform;
                if (transform3 != null)
                {
                    transform2 = transform3;
                }
                else if (gameObject != null)
                {
                    transform2 = gameObject2.transform;
                }
            }
            if (transform != null)
            {
                pos = transform.localToWorldMatrix.MultiplyPoint(this.bindPosOffset);
                rot = transform.rotation * this.bindRotOffset;
            }
            else if (transform2 != null)
            {
                pos = transform2.localToWorldMatrix.MultiplyPoint(this.bindPosOffset);
                rot = transform2.rotation * this.bindRotOffset;
            }
            if (transform2 && transform2.gameObject.layer == LayerMask.NameToLayer("Hide"))
            {
                return(null);
            }
            bool       flag             = false;
            GameObject pooledGameObjLOD = MonoSingleton <SceneMgr> .GetInstance().GetPooledGameObjLOD(prefabName, true, SceneObjType.ActionRes, pos, rot, out flag);

            if (pooledGameObjLOD == null)
            {
                return(null);
            }
            if (transform != null)
            {
                PoolObjHandle <ActorRoot> poolObjHandle = (!(transform.gameObject == gameObject)) ? ActorHelper.GetActorRoot(transform.gameObject) : _action.GetActorHandle(this.targetId);
                if (poolObjHandle && poolObjHandle.get_handle().ActorMesh)
                {
                    pooledGameObjLOD.transform.SetParent(poolObjHandle.get_handle().ActorMesh.transform);
                }
                else
                {
                    pooledGameObjLOD.transform.SetParent(transform);
                }
            }
            string text = "Particles";

            if (transform && transform.gameObject.layer == LayerMask.NameToLayer("Hide"))
            {
                text = "Hide";
            }
            MMGame_Math.SetLayer(this.particleObject, text, false);
            if (!bCheckParLife)
            {
                this.NonAutoDestructParList.Add(pooledGameObjLOD);
            }
            if (flag)
            {
                ParticleHelper.Init(this.particleObject, this.scaling);
            }
            if (this.applyActionSpeedToParticle)
            {
                _action.AddTempObject(Action.PlaySpeedAffectedType.ePSAT_Fx, pooledGameObjLOD);
            }
            return(pooledGameObjLOD);
        }
        public override void Process(Action _action, Track _track)
        {
            if (MonoSingleton <Reconnection> .GetInstance().isProcessingRelayRecover)
            {
                return;
            }
            SkillUseContext skillUseContext = null;
            Vector3         vector          = this.bindPosOffset;
            Quaternion      quaternion      = this.bindRotOffset;
            GameObject      gameObject      = _action.GetGameObject(this.targetId);
            GameObject      gameObject2     = _action.GetGameObject(this.objectSpaceId);
            Transform       transform       = null;
            Transform       transform2      = null;

            if (this.bindPointName.get_Length() == 0)
            {
                if (gameObject != null)
                {
                    transform = gameObject.transform;
                }
                else if (gameObject2 != null)
                {
                    transform2 = gameObject2.transform;
                }
            }
            else
            {
                Transform transform3 = null;
                if (gameObject != null)
                {
                    GameObject gameObject3 = SubObject.FindSubObject(gameObject, this.bindPointName);
                    if (gameObject3 != null)
                    {
                        transform3 = gameObject3.transform;
                    }
                    if (transform3 != null)
                    {
                        transform = transform3;
                    }
                    else if (gameObject != null)
                    {
                        transform = gameObject.transform;
                    }
                }
                else if (gameObject2 != null)
                {
                    GameObject gameObject3 = SubObject.FindSubObject(gameObject2, this.bindPointName);
                    if (gameObject3 != null)
                    {
                        transform3 = gameObject3.transform;
                    }
                    if (transform3 != null)
                    {
                        transform2 = transform3;
                    }
                    else if (gameObject != null)
                    {
                        transform2 = gameObject2.transform;
                    }
                }
            }
            if (this.bBulletPos)
            {
                VInt3 zero = VInt3.zero;
                _action.refParams.GetRefParam("_BulletPos", ref zero);
                vector     = (Vector3)zero;
                quaternion = Quaternion.identity;
                if (this.bBulletDir)
                {
                    VInt3 zero2 = VInt3.zero;
                    if (_action.refParams.GetRefParam("_BulletDir", ref zero2))
                    {
                        quaternion = Quaternion.LookRotation((Vector3)zero2);
                    }
                }
            }
            else if (transform != null)
            {
                vector     = transform.localToWorldMatrix.MultiplyPoint(this.bindPosOffset);
                quaternion = transform.rotation * this.bindRotOffset;
            }
            else if (transform2 != null)
            {
                if (gameObject2 != null)
                {
                    PoolObjHandle <ActorRoot> actorHandle = _action.GetActorHandle(this.objectSpaceId);
                    if (actorHandle)
                    {
                        vector     = (Vector3)IntMath.Transform((VInt3)this.bindPosOffset, actorHandle.get_handle().forward, actorHandle.get_handle().location);
                        quaternion = Quaternion.LookRotation((Vector3)actorHandle.get_handle().forward) * this.bindRotOffset;
                    }
                }
                else
                {
                    vector     = transform2.localToWorldMatrix.MultiplyPoint(this.bindPosOffset);
                    quaternion = transform2.rotation * this.bindRotOffset;
                }
                if (this.bBulletDir)
                {
                    VInt3 zero3 = VInt3.zero;
                    if (_action.refParams.GetRefParam("_BulletDir", ref zero3))
                    {
                        quaternion  = Quaternion.LookRotation((Vector3)zero3);
                        quaternion *= this.bindRotOffset;
                    }
                }
                else if (this.bBullerPosDir)
                {
                    skillUseContext = _action.refParams.GetRefParamObject <SkillUseContext>("SkillContext");
                    if (skillUseContext != null)
                    {
                        PoolObjHandle <ActorRoot> originator = skillUseContext.Originator;
                        if (originator)
                        {
                            Vector3 a = transform2.position;
                            if (gameObject2 != null)
                            {
                                PoolObjHandle <ActorRoot> actorHandle2 = _action.GetActorHandle(this.objectSpaceId);
                                if (actorHandle2)
                                {
                                    a = (Vector3)actorHandle2.get_handle().location;
                                }
                            }
                            Vector3 forward = a - (Vector3)originator.get_handle().location;
                            quaternion  = Quaternion.LookRotation(forward);
                            quaternion *= this.bindRotOffset;
                        }
                    }
                }
            }
            if (this.bEnableOptCull && transform2 && transform2.gameObject.layer == LayerMask.NameToLayer("Hide") && !FogOfWar.enable)
            {
                return;
            }
            if (this.bEnableOptCull && MonoSingleton <GlobalConfig> .get_instance().bEnableParticleCullOptimize&& !MonoSingleton <CameraSystem> .get_instance().CheckVisiblity(new Bounds(vector, new Vector3((float)this.extend, (float)this.extend, (float)this.extend))))
            {
                return;
            }
            bool   flag = false;
            string prefabName;

            if (this.bUseSkin)
            {
                prefabName = SkinResourceHelper.GetResourceName(_action, this.resourceName, this.bUseSkinAdvance);
            }
            else
            {
                prefabName = this.resourceName;
            }
            if (skillUseContext == null)
            {
                skillUseContext = _action.refParams.GetRefParamObject <SkillUseContext>("SkillContext");
            }
            bool flag2       = true;
            int  particleLOD = GameSettings.ParticleLOD;

            if (GameSettings.DynamicParticleLOD)
            {
                if (skillUseContext != null && skillUseContext.Originator && skillUseContext.Originator.get_handle().TheActorMeta.PlayerId == Singleton <GamePlayerCenter> .GetInstance().GetHostPlayer().PlayerId)
                {
                    flag2 = false;
                }
                if (!flag2 && particleLOD > 1)
                {
                    GameSettings.ParticleLOD = 1;
                }
                MonoSingleton <SceneMgr> .GetInstance().m_dynamicLOD = flag2;
            }
            this.particleObject = MonoSingleton <SceneMgr> .GetInstance().GetPooledGameObjLOD(prefabName, true, SceneObjType.ActionRes, vector, quaternion, out flag);

            if (GameSettings.DynamicParticleLOD)
            {
                MonoSingleton <SceneMgr> .GetInstance().m_dynamicLOD = false;
            }
            if (this.particleObject == null)
            {
                if (GameSettings.DynamicParticleLOD)
                {
                    MonoSingleton <SceneMgr> .GetInstance().m_dynamicLOD = flag2;
                }
                this.particleObject = MonoSingleton <SceneMgr> .GetInstance().GetPooledGameObjLOD(this.resourceName, true, SceneObjType.ActionRes, vector, quaternion, out flag);

                if (GameSettings.DynamicParticleLOD)
                {
                    MonoSingleton <SceneMgr> .GetInstance().m_dynamicLOD = false;
                }
                if (this.particleObject == null)
                {
                    if (GameSettings.DynamicParticleLOD)
                    {
                        GameSettings.ParticleLOD = particleLOD;
                    }
                    return;
                }
            }
            if (GameSettings.DynamicParticleLOD)
            {
                GameSettings.ParticleLOD = particleLOD;
            }
            if (!this.particleObject)
            {
                return;
            }
            ParticleHelper.IncParticleActiveNumber();
            if (transform != null)
            {
                PoolObjHandle <ActorRoot> poolObjHandle = (!(transform.gameObject == gameObject)) ? ActorHelper.GetActorRoot(transform.gameObject) : _action.GetActorHandle(this.targetId);
                if (poolObjHandle && poolObjHandle.get_handle().ActorMesh)
                {
                    this.particleObject.transform.parent = poolObjHandle.get_handle().ActorMesh.transform;
                }
                else
                {
                    this.particleObject.transform.parent = transform.parent;
                    if (poolObjHandle && poolObjHandle.get_handle().TheActorMeta.ActorCamp != Singleton <GamePlayerCenter> .get_instance().GetHostPlayer().PlayerCamp&& FogOfWar.enable)
                    {
                        if (poolObjHandle.get_handle().HorizonMarker != null)
                        {
                            poolObjHandle.get_handle().HorizonMarker.AddSubParObj(this.particleObject);
                        }
                        else
                        {
                            BulletWrapper bulletWrapper = poolObjHandle.get_handle().ActorControl as BulletWrapper;
                            if (bulletWrapper != null)
                            {
                                bulletWrapper.AddSubParObj(this.particleObject);
                            }
                        }
                    }
                }
            }
            string text = "Particles";

            if (transform && transform.gameObject.layer == LayerMask.NameToLayer("Hide"))
            {
                text = "Hide";
            }
            if (transform == null && transform2 != null && FogOfWar.enable)
            {
                PoolObjHandle <ActorRoot> actorRoot = ActorHelper.GetActorRoot(transform2.gameObject);
                if (actorRoot && actorRoot.get_handle().TheActorMeta.ActorCamp != Singleton <GamePlayerCenter> .get_instance().GetHostPlayer().PlayerCamp)
                {
                    if (transform2.gameObject.layer == LayerMask.NameToLayer("Hide"))
                    {
                        text = "Hide";
                    }
                    PoolObjHandle <ActorRoot> actorHandle3 = _action.GetActorHandle(this.VirtualAttachBulletId);
                    Singleton <GameFowManager> .get_instance().m_collector.AddVirtualParentParticle(this.particleObject, actorHandle3, this.bUseAttachBulletShape);
                }
            }
            MMGame_Math.SetLayer(this.particleObject, text, false);
            if (flag)
            {
                ParticleHelper.Init(this.particleObject, this.scaling);
            }
            Singleton <CGameObjectPool> .GetInstance().RecycleGameObjectDelay(this.particleObject, Mathf.Max(_action.length, (int)(this.lifeTime * 1000f)), new CGameObjectPool.OnDelayRecycleDelegate(TriggerParticleTick.OnRecycleTickObj));

            if (this.applyActionSpeedToParticle && this.particleObject != null)
            {
                _action.AddTempObject(Action.PlaySpeedAffectedType.ePSAT_Fx, this.particleObject);
            }
        }
Beispiel #16
0
        public override void Enter(Action _action, Track _track)
        {
            SkillUseContext skillUseContext = null;
            Vector3         vector          = this.bindPosOffset;
            Quaternion      quaternion      = this.bindRotOffset;
            GameObject      gameObject      = _action.GetGameObject(this.targetId);
            GameObject      gameObject2     = _action.GetGameObject(this.objectSpaceId);
            Transform       transform       = null;
            Transform       transform2      = null;

            if (this.bindPointName.get_Length() == 0)
            {
                if (gameObject != null)
                {
                    transform = gameObject.transform;
                    PoolObjHandle <ActorRoot> actorHandle = _action.GetActorHandle(this.targetId);
                    this.followTransform = transform;
                }
                else if (gameObject2 != null)
                {
                    transform2 = gameObject2.transform;
                }
            }
            else if (gameObject != null)
            {
                GameObject gameObject3 = SubObject.FindSubObject(gameObject, this.bindPointName);
                if (gameObject3 != null)
                {
                    transform = gameObject3.transform;
                }
                else if (gameObject != null)
                {
                    transform = gameObject.transform;
                }
            }
            else if (gameObject2 != null)
            {
                GameObject gameObject3 = SubObject.FindSubObject(gameObject2, this.bindPointName);
                if (gameObject3 != null)
                {
                    transform2 = gameObject3.transform;
                }
                else if (gameObject != null)
                {
                    transform2 = gameObject2.transform;
                }
            }
            if (this.bEnableOptCull && transform2 && transform2.gameObject.layer == LayerMask.NameToLayer("Hide") && !FogOfWar.enable)
            {
                return;
            }
            if (this.bBulletPos)
            {
                VInt3 zero = VInt3.zero;
                _action.refParams.GetRefParam("_BulletPos", ref zero);
                vector     = (Vector3)zero;
                quaternion = Quaternion.identity;
                if (this.bBulletDir)
                {
                    VInt3 zero2 = VInt3.zero;
                    if (_action.refParams.GetRefParam("_BulletDir", ref zero2))
                    {
                        quaternion = Quaternion.LookRotation((Vector3)zero2);
                    }
                }
            }
            else if (transform != null)
            {
                vector     = transform.localToWorldMatrix.MultiplyPoint(this.bindPosOffset);
                quaternion = transform.rotation * this.bindRotOffset;
            }
            else if (transform2 != null)
            {
                if (gameObject2 != null)
                {
                    PoolObjHandle <ActorRoot> actorHandle2 = _action.GetActorHandle(this.objectSpaceId);
                    if (actorHandle2)
                    {
                        vector     = (Vector3)IntMath.Transform((VInt3)this.bindPosOffset, actorHandle2.get_handle().forward, actorHandle2.get_handle().location);
                        quaternion = Quaternion.LookRotation((Vector3)actorHandle2.get_handle().forward) * this.bindRotOffset;
                    }
                }
                else
                {
                    vector     = transform2.localToWorldMatrix.MultiplyPoint(this.bindPosOffset);
                    quaternion = transform2.rotation * this.bindRotOffset;
                }
                if (this.bBulletDir)
                {
                    VInt3 zero3 = VInt3.zero;
                    if (_action.refParams.GetRefParam("_BulletDir", ref zero3))
                    {
                        quaternion  = Quaternion.LookRotation((Vector3)zero3);
                        quaternion *= this.bindRotOffset;
                    }
                }
                else if (this.bBullerPosDir)
                {
                    skillUseContext = _action.refParams.GetRefParamObject <SkillUseContext>("SkillContext");
                    if (skillUseContext != null)
                    {
                        PoolObjHandle <ActorRoot> originator = skillUseContext.Originator;
                        if (originator)
                        {
                            Vector3 a = transform2.position;
                            if (gameObject2 != null)
                            {
                                PoolObjHandle <ActorRoot> actorHandle3 = _action.GetActorHandle(this.objectSpaceId);
                                if (actorHandle3)
                                {
                                    a = (Vector3)actorHandle3.get_handle().location;
                                }
                            }
                            Vector3 forward = a - (Vector3)originator.get_handle().location;
                            quaternion  = Quaternion.LookRotation(forward);
                            quaternion *= this.bindRotOffset;
                        }
                    }
                }
            }
            bool   flag = false;
            string prefabName;

            if (this.bUseSkin)
            {
                prefabName = SkinResourceHelper.GetResourceName(_action, this.resourceName, this.bUseSkinAdvance);
            }
            else
            {
                prefabName = this.resourceName;
            }
            if (skillUseContext == null)
            {
                skillUseContext = _action.refParams.GetRefParamObject <SkillUseContext>("SkillContext");
            }
            bool flag2       = true;
            int  particleLOD = GameSettings.ParticleLOD;

            if (GameSettings.DynamicParticleLOD)
            {
                if (skillUseContext != null && skillUseContext.Originator && skillUseContext.Originator.get_handle().TheActorMeta.PlayerId == Singleton <GamePlayerCenter> .GetInstance().GetHostPlayer().PlayerId)
                {
                    flag2 = false;
                }
                if (!flag2 && particleLOD > 1)
                {
                    GameSettings.ParticleLOD = 1;
                }
                MonoSingleton <SceneMgr> .GetInstance().m_dynamicLOD = flag2;
            }
            this.particleObject = MonoSingleton <SceneMgr> .GetInstance().GetPooledGameObjLOD(prefabName, true, SceneObjType.ActionRes, vector, quaternion, out flag);

            if (this.particleObject != null)
            {
                this.particleTransform = this.particleObject.transform;
            }
            if (GameSettings.DynamicParticleLOD)
            {
                MonoSingleton <SceneMgr> .GetInstance().m_dynamicLOD = false;
            }
            if (this.particleObject == null)
            {
                if (GameSettings.DynamicParticleLOD)
                {
                    MonoSingleton <SceneMgr> .GetInstance().m_dynamicLOD = flag2;
                }
                this.particleObject = MonoSingleton <SceneMgr> .GetInstance().GetPooledGameObjLOD(this.resourceName, true, SceneObjType.ActionRes, vector, quaternion, out flag);

                if (GameSettings.DynamicParticleLOD)
                {
                    MonoSingleton <SceneMgr> .GetInstance().m_dynamicLOD = false;
                }
                if (this.particleObject == null)
                {
                    if (GameSettings.DynamicParticleLOD)
                    {
                        GameSettings.ParticleLOD = particleLOD;
                    }
                    return;
                }
                this.particleTransform = this.particleObject.transform;
            }
            if (GameSettings.DynamicParticleLOD)
            {
                GameSettings.ParticleLOD = particleLOD;
            }
            ParticleHelper.IncParticleActiveNumber();
            if (transform != null)
            {
                if (!this.bOnlyFollowPos)
                {
                    PoolObjHandle <ActorRoot> arg_5A7_0 = (!(transform.gameObject == gameObject)) ? ActorHelper.GetActorRoot(transform.gameObject) : _action.GetActorHandle(this.targetId);
                    this.particleTransform.parent = transform;
                }
                else
                {
                    this.offsetPosition = vector - transform.position;
                }
            }
            if (flag)
            {
                if (this.enableLayer || this.enableTag)
                {
                    Transform[] componentsInChildren = this.particleObject.GetComponentsInChildren <Transform>();
                    for (int i = 0; i < componentsInChildren.Length; i++)
                    {
                        if (this.enableLayer)
                        {
                            componentsInChildren[i].gameObject.layer = this.layer;
                        }
                        if (this.enableTag)
                        {
                            componentsInChildren[i].gameObject.tag = this.tag;
                        }
                    }
                }
                ParticleSystem[] componentsInChildren2 = this.particleObject.GetComponentsInChildren <ParticleSystem>();
                if (componentsInChildren2 != null)
                {
                    for (int j = 0; j < componentsInChildren2.Length; j++)
                    {
                        componentsInChildren2[j].startSize            *= this.scaling.x;
                        componentsInChildren2[j].startLifetime        *= this.scaling.y;
                        componentsInChildren2[j].startSpeed           *= this.scaling.z;
                        componentsInChildren2[j].transform.localScale *= this.scaling.x;
                    }
                    ParticleSystemPoolComponent cachedComponent = Singleton <CGameObjectPool> .GetInstance().GetCachedComponent <ParticleSystemPoolComponent>(this.particleObject, true);

                    ParticleSystemPoolComponent.ParticleSystemCache[] array = new ParticleSystemPoolComponent.ParticleSystemCache[componentsInChildren2.Length];
                    for (int k = 0; k < array.Length; k++)
                    {
                        array[k].par        = componentsInChildren2[k];
                        array[k].emmitState = componentsInChildren2[k].enableEmission;
                    }
                    cachedComponent.cache = array;
                }
            }
            else
            {
                ParticleSystemPoolComponent cachedComponent2 = Singleton <CGameObjectPool> .GetInstance().GetCachedComponent <ParticleSystemPoolComponent>(this.particleObject, false);

                if (null != cachedComponent2)
                {
                    ParticleSystemPoolComponent.ParticleSystemCache[] cache = cachedComponent2.cache;
                    if (cache != null)
                    {
                        for (int l = 0; l < cache.Length; l++)
                        {
                            if (cache[l].par.enableEmission != cache[l].emmitState)
                            {
                                cache[l].par.enableEmission = cache[l].emmitState;
                            }
                        }
                    }
                }
            }
            string text = "Particles";

            if (transform && transform.gameObject.layer == LayerMask.NameToLayer("Hide"))
            {
                text = "Hide";
            }
            if (transform == null && transform2 != null && FogOfWar.enable)
            {
                PoolObjHandle <ActorRoot> actorRoot = ActorHelper.GetActorRoot(transform2.gameObject);
                if (actorRoot && actorRoot.get_handle().TheActorMeta.ActorCamp != Singleton <GamePlayerCenter> .get_instance().GetHostPlayer().PlayerCamp)
                {
                    if (transform2.gameObject.layer == LayerMask.NameToLayer("Hide"))
                    {
                        text = "Hide";
                    }
                    PoolObjHandle <ActorRoot> actorHandle4 = _action.GetActorHandle(this.VirtualAttachBulletId);
                    Singleton <GameFowManager> .get_instance().m_collector.AddVirtualParentParticle(this.particleObject, actorHandle4, this.bUseAttachBulletShape);
                }
            }
            MMGame_Math.SetLayer(this.particleObject, text, false);
            if (this.applyActionSpeedToParticle)
            {
                _action.AddTempObject(Action.PlaySpeedAffectedType.ePSAT_Fx, this.particleObject);
            }
        }