コード例 #1
0
 public override void Enter(Action _action, Track _track)
 {
     if (this.targetId != -1)
     {
         _action.ExpandGameObject(this.targetId);
         if (string.IsNullOrEmpty(this.objectName))
         {
             _action.SetGameObject(this.targetId, null);
         }
         else
         {
             _action.SetGameObject(this.targetId, GameObject.Find(this.objectName));
         }
     }
 }
コード例 #2
0
        public override void Process(Action _action, Track _track)
        {
            GameObject gameObject = _action.GetGameObject(this.parentId);

            if (gameObject != null)
            {
                GameObject go = _action.GetGameObject(this.targetId);
                if (this.isGetByName)
                {
                    Transform[] componentsInChildren = gameObject.GetComponentsInChildren <Transform>();
                    for (int i = 0; i < componentsInChildren.Length; i++)
                    {
                        if (componentsInChildren[i].gameObject.name == this.subObjectName)
                        {
                            go = componentsInChildren[i].gameObject;
                            break;
                        }
                    }
                }
                else if (gameObject.transform.childCount > 0)
                {
                    go = gameObject.transform.GetChild(0).gameObject;
                }
                _action.SetGameObject(this.targetId, go);
            }
        }
コード例 #3
0
        public override void Process(Action _action, Track _track)
        {
            PoolObjHandle <ActorRoot> ptr         = new PoolObjHandle <ActorRoot>(null);
            PoolObjHandle <ActorRoot> actorHandle = _action.GetActorHandle(this.srcId);

            if (!actorHandle)
            {
                if (ActionManager.Instance.isPrintLog)
                {
                }
                return;
            }
            if (this.bIsHostHeroGetCallActor)
            {
                this.HostHeroGetCallActor(ref actorHandle, ref ptr);
            }
            else if (this.bIsHostHeroGetMonster)
            {
                this.HostHeroGetMonster(ref actorHandle, ref ptr);
            }
            else if (this.bIsCallActorGetHostHero)
            {
                this.CallActorGetHostHero(ref actorHandle, ref ptr);
            }
            else if (this.bIsMonsterGetHostHero)
            {
                this.MonsterGetHostHero(ref actorHandle, ref ptr);
            }
            if (ptr && this.tempId >= 0)
            {
                _action.ExpandGameObject(this.tempId);
                _action.SetGameObject(this.tempId, ptr.handle.gameObject);
            }
        }
コード例 #4
0
 public override void Leave(Action _action, Track _track)
 {
     if (this.targetId >= 0 && _action.GetGameObject(this.targetId))
     {
         _action.SetGameObject(this.targetId, null);
     }
 }
コード例 #5
0
        public override void Enter(Action _action, Track _track)
        {
            GameObject gameObject = _action.GetGameObject(this.parentId);

            if (gameObject == null)
            {
                return;
            }
            if (this.targetId >= 0)
            {
                _action.ExpandGameObject(this.targetId);
                GameObject gameObject2 = _action.GetGameObject(this.targetId);
                if (gameObject2 != null)
                {
                    return;
                }
                if (this.isGetByName)
                {
                    Transform[] componentsInChildren = gameObject.GetComponentsInChildren <Transform>();
                    for (int i = 0; i < componentsInChildren.Length; i++)
                    {
                        if (componentsInChildren[i].gameObject.name == this.subObjectName)
                        {
                            gameObject2 = componentsInChildren[i].gameObject;
                            break;
                        }
                    }
                }
                else if (gameObject.transform.childCount > 0)
                {
                    gameObject2 = gameObject.transform.GetChild(0).gameObject;
                }
                _action.SetGameObject(this.targetId, gameObject2);
            }
        }
コード例 #6
0
        public override void Process(Action _action, Track _track)
        {
            PoolObjHandle <ActorRoot> actorHandle = _action.GetActorHandle(this.TargetId);

            if (!actorHandle)
            {
                if (ActionManager.Instance.isPrintLog)
                {
                }
                return;
            }
            if (actorHandle && actorHandle.handle.TheActorMeta.ActorType == ActorTypeDef.Actor_Type_Hero)
            {
                HeroWrapper heroWrapper = actorHandle.handle.ActorControl as HeroWrapper;
                if (heroWrapper != null)
                {
                    PoolObjHandle <ActorRoot> callActor = heroWrapper.GetCallActor();
                    if (callActor)
                    {
                        callActor.handle.Suicide();
                    }
                    PoolObjHandle <ActorRoot> ptr = this.SpawnCallActor(_action, this.ConfigId, ref actorHandle);
                    heroWrapper.SetCallActor(ref ptr);
                    if (ptr && this.tempIdId >= 0)
                    {
                        _action.ExpandGameObject(this.tempIdId);
                        _action.SetGameObject(this.tempIdId, ptr.handle.gameObject);
                    }
                }
            }
        }
コード例 #7
0
 public override void Leave(Action _action, Track _track)
 {
     if (this.targetId == -1)
     {
         return;
     }
     _action.SetGameObject(this.targetId, null);
 }
コード例 #8
0
        private void EnterSpawnEye(Action _action, Track _track)
        {
            if (this.bUseSkin)
            {
                string resourceName = SkinResourceHelper.GetResourceName(_action, this.prefabName, this.bUseSkinAdvance);
            }
            else
            {
                string resourceName = this.prefabName;
            }
            VInt3                     vInt           = VInt3.zero;
            VInt3                     forward        = VInt3.forward;
            SkillUseContext           refParamObject = _action.refParams.GetRefParamObject <SkillUseContext>("SkillContext");
            COM_PLAYERCAMP            cOM_PLAYERCAMP = (refParamObject == null || !refParamObject.Originator) ? 0 : refParamObject.Originator.get_handle().TheActorMeta.ActorCamp;
            GameObject                gameObject     = _action.GetGameObject(this.parentId);
            PoolObjHandle <ActorRoot> actorHandle    = _action.GetActorHandle(this.parentId);
            PoolObjHandle <ActorRoot> actorHandle2   = _action.GetActorHandle(this.objectSpaceId);

            if (actorHandle2)
            {
                ActorRoot handle = actorHandle2.get_handle();
                if (this.superTranslation)
                {
                    VInt3 zero = VInt3.zero;
                    _action.refParams.GetRefParam("_BulletPos", ref zero);
                    vInt = IntMath.Transform(zero, handle.forward, handle.location);
                }
                else if (this.modifyTranslation)
                {
                    vInt = IntMath.Transform(this.translation, handle.forward, handle.location);
                }
                if (this.modifyDirection)
                {
                    forward = actorHandle2.get_handle().forward;
                }
            }
            else if (this.bTargetPosition)
            {
                vInt = this.translation + this.targetPosition;
                if (this.modifyDirection && refParamObject != null && refParamObject.Originator)
                {
                    forward = refParamObject.Originator.get_handle().forward;
                }
            }
            else
            {
                if (this.modifyTranslation)
                {
                    vInt = this.translation;
                }
                if (this.modifyDirection && this.direction.x != 0 && this.direction.y != 0)
                {
                    forward = this.direction;
                    forward.NormalizeTo(1000);
                }
            }
            if (this.targetId >= 0)
            {
                _action.ExpandGameObject(this.targetId);
                GameObject gameObject2 = _action.GetGameObject(this.targetId);
                if (this.recreateExisting && gameObject2 != null)
                {
                    if (this.applyActionSpeedToAnimation)
                    {
                        _action.RemoveTempObject(Action.PlaySpeedAffectedType.ePSAT_Anim, gameObject2);
                    }
                    if (this.applyActionSpeedToParticle)
                    {
                        _action.RemoveTempObject(Action.PlaySpeedAffectedType.ePSAT_Fx, gameObject2);
                    }
                    ActorHelper.DetachActorRoot(gameObject2);
                    ActionManager.DestroyGameObject(gameObject2);
                    _action.SetGameObject(this.targetId, null);
                }
                GameObject gameObject3 = null;
                if (!(gameObject2 == null))
                {
                    return;
                }
                ActorStaticData        actorStaticData   = default(ActorStaticData);
                IGameActorDataProvider actorDataProvider = Singleton <ActorDataCenter> .get_instance().GetActorDataProvider(GameActorDataProviderType.StaticBattleDataProvider);

                ActorMeta actorMeta  = default(ActorMeta);
                ActorMeta actorMeta2 = actorMeta;
                actorMeta2.ActorType = ActorTypeDef.Actor_Type_EYE;
                actorMeta2.ActorCamp = cOM_PLAYERCAMP;
                actorMeta2.ConfigId  = this.EyeCfgIdByMonster;
                actorMeta2.EnCId     = this.EyeCfgIdByMonster;
                actorMeta            = actorMeta2;
                actorDataProvider.GetActorStaticData(ref actorMeta, ref actorStaticData);
                CActorInfo exists = null;
                if (!string.IsNullOrEmpty(actorStaticData.TheResInfo.ResPath))
                {
                    CActorInfo actorInfo = CActorInfo.GetActorInfo(actorStaticData.TheResInfo.ResPath, 0);
                    if (actorInfo != null)
                    {
                        exists = (CActorInfo)Object.Instantiate(actorInfo);
                    }
                }
                PoolObjHandle <ActorRoot> poolObjHandle = default(PoolObjHandle <ActorRoot>);
                if (exists)
                {
                    if (refParamObject.Originator && !PathfindingUtility.IsValidTarget(refParamObject.Originator.get_handle(), vInt) && !Singleton <GameFowManager> .get_instance().m_pFieldObj.FindNearestNotBrickFromWorldLocNonFow(ref vInt, refParamObject.Originator.get_handle()))
                    {
                        vInt = refParamObject.Originator.get_handle().location;
                    }
                    poolObjHandle = Singleton <GameObjMgr> .get_instance().SpawnActorEx(null, ref actorMeta, vInt, forward, false, true);

                    if (poolObjHandle)
                    {
                        this.actorRoot = poolObjHandle;
                        gameObject3    = poolObjHandle.get_handle().gameObject;
                        poolObjHandle.get_handle().InitActor();
                        this.CreateEye();
                        poolObjHandle.get_handle().PrepareFight();
                        poolObjHandle.get_handle().StartFight();
                    }
                }
                if (!poolObjHandle)
                {
                    return;
                }
                if (!gameObject3)
                {
                    throw new Exception("Age:SpawnObjectDuration Spawn Exception");
                }
                gameObject3.transform.localScale = Vector3.one;
                if (GameSettings.DynamicParticleLOD)
                {
                    bool flag        = true;
                    int  particleLOD = GameSettings.ParticleLOD;
                    if (refParamObject != null && refParamObject.Originator && refParamObject.Originator.get_handle().TheActorMeta.PlayerId == Singleton <GamePlayerCenter> .GetInstance().GetHostPlayer().PlayerId)
                    {
                        flag = false;
                    }
                    if (!flag && particleLOD > 1)
                    {
                        GameSettings.ParticleLOD = 1;
                    }
                    MonoSingleton <SceneMgr> .GetInstance().m_dynamicLOD = flag;
                }
                this.actorRoot.get_handle().location = vInt;
                this.actorRoot.get_handle().forward  = forward;
                if (this.actorRoot.get_handle().shape != null)
                {
                    this.actorRoot.get_handle().shape.ConditionalUpdateShape();
                }
                if (this.actorRoot.get_handle().TheActorMeta.ActorType == ActorTypeDef.Actor_Type_EYE)
                {
                    this.actorRoot.get_handle().TheActorMeta.ConfigId = this.EyeCfgIdByMonster;
                }
                if (refParamObject != null)
                {
                    refParamObject.EffectPos = this.actorRoot.get_handle().location;
                    if (this.actorRoot.get_handle().TheActorMeta.ActorType == ActorTypeDef.Actor_Type_EYE)
                    {
                        DebugHelper.Assert(this.actorRoot.get_handle().TheActorMeta.ActorCamp == cOM_PLAYERCAMP);
                        this.actorRoot.get_handle().TheActorMeta.ActorCamp = cOM_PLAYERCAMP;
                    }
                }
                SpawnEyeEventParam spawnEyeEventParam = new SpawnEyeEventParam(refParamObject.Originator, vInt);
                Singleton <GameSkillEventSys> .GetInstance().SendEvent <SpawnEyeEventParam>(GameSkillEventDef.Event_SpawnEye, refParamObject.Originator, ref spawnEyeEventParam, GameSkillEventChannel.Channel_HostCtrlActor);
            }
        }
コード例 #9
0
        private void EnterSpawnBullet(Action _action, Track _track)
        {
            string resourceName;

            if (this.bUseSkin)
            {
                resourceName = SkinResourceHelper.GetResourceName(_action, this.prefabName, this.bUseSkinAdvance);
            }
            else
            {
                resourceName = this.prefabName;
            }
            VInt3                     vInt           = VInt3.zero;
            VInt3                     forward        = VInt3.forward;
            SkillUseContext           refParamObject = _action.refParams.GetRefParamObject <SkillUseContext>("SkillContext");
            COM_PLAYERCAMP            camp           = (refParamObject == null || !refParamObject.Originator) ? 0 : refParamObject.Originator.get_handle().TheActorMeta.ActorCamp;
            GameObject                gameObject     = _action.GetGameObject(this.parentId);
            PoolObjHandle <ActorRoot> actorHandle    = _action.GetActorHandle(this.parentId);
            PoolObjHandle <ActorRoot> actorHandle2   = _action.GetActorHandle(this.objectSpaceId);

            if (actorHandle2)
            {
                ActorRoot handle = actorHandle2.get_handle();
                if (this.superTranslation)
                {
                    VInt3 zero = VInt3.zero;
                    _action.refParams.GetRefParam("_BulletPos", ref zero);
                    vInt = IntMath.Transform(zero, handle.forward, handle.location);
                }
                else if (this.modifyTranslation)
                {
                    vInt = IntMath.Transform(this.translation, handle.forward, handle.location);
                }
                if (this.modifyDirection)
                {
                    forward = actorHandle2.get_handle().forward;
                }
            }
            else if (this.bTargetPosition)
            {
                vInt = this.translation + this.targetPosition;
                if (this.modifyDirection && refParamObject != null && refParamObject.Originator)
                {
                    forward = refParamObject.Originator.get_handle().forward;
                }
            }
            else
            {
                if (this.modifyTranslation)
                {
                    vInt = this.translation;
                }
                if (this.modifyDirection && this.direction.x != 0 && this.direction.y != 0)
                {
                    forward = this.direction;
                    forward.NormalizeTo(1000);
                }
            }
            if (this.targetId >= 0)
            {
                _action.ExpandGameObject(this.targetId);
                GameObject gameObject2 = _action.GetGameObject(this.targetId);
                if (this.recreateExisting && gameObject2 != null)
                {
                    if (this.applyActionSpeedToAnimation)
                    {
                        _action.RemoveTempObject(Action.PlaySpeedAffectedType.ePSAT_Anim, gameObject2);
                    }
                    if (this.applyActionSpeedToParticle)
                    {
                        _action.RemoveTempObject(Action.PlaySpeedAffectedType.ePSAT_Fx, gameObject2);
                    }
                    ActorHelper.DetachActorRoot(gameObject2);
                    ActionManager.DestroyGameObject(gameObject2);
                    _action.SetGameObject(this.targetId, null);
                }
                bool flag = true;
                if (!(gameObject2 == null))
                {
                    return;
                }
                if (this.bForbidBulletInObstacle && !PathfindingUtility.IsValidTarget(refParamObject.Originator.get_handle(), vInt))
                {
                    bool  flag2 = false;
                    VInt3 vInt2 = PathfindingUtility.FindValidTarget(refParamObject.Originator.get_handle(), vInt, refParamObject.Originator.get_handle().location, 10000, out flag2);
                    if (flag2)
                    {
                        VInt vInt3 = 0;
                        PathfindingUtility.GetGroundY(vInt2, out vInt3);
                        vInt2.y = vInt3.i;
                        vInt    = vInt2;
                    }
                    else
                    {
                        vInt = refParamObject.Originator.get_handle().location;
                    }
                }
                GameObject gameObject3 = MonoSingleton <SceneMgr> .GetInstance().Spawn("TempObject", SceneObjType.Bullet, vInt, forward);

                if (!gameObject3)
                {
                    throw new Exception("Age:SpawnObjectDuration Spawn Exception");
                }
                gameObject3.transform.localScale = Vector3.one;
                bool flag3       = true;
                int  particleLOD = GameSettings.ParticleLOD;
                if (GameSettings.DynamicParticleLOD)
                {
                    if (refParamObject != null && refParamObject.Originator && refParamObject.Originator.get_handle().TheActorMeta.PlayerId == Singleton <GamePlayerCenter> .GetInstance().GetHostPlayer().PlayerId)
                    {
                        flag3 = false;
                    }
                    if (!flag3 && particleLOD > 1)
                    {
                        GameSettings.ParticleLOD = 1;
                    }
                    MonoSingleton <SceneMgr> .GetInstance().m_dynamicLOD = flag3;
                }
                this.m_particleObj = MonoSingleton <SceneMgr> .GetInstance().GetPooledGameObjLOD(resourceName, true, SceneObjType.ActionRes, gameObject3.transform.position, gameObject3.transform.rotation, out flag);

                if (GameSettings.DynamicParticleLOD)
                {
                    MonoSingleton <SceneMgr> .GetInstance().m_dynamicLOD = false;
                }
                if (this.m_particleObj == null)
                {
                    if (GameSettings.DynamicParticleLOD)
                    {
                        MonoSingleton <SceneMgr> .GetInstance().m_dynamicLOD = flag3;
                    }
                    this.m_particleObj = MonoSingleton <SceneMgr> .GetInstance().GetPooledGameObjLOD(this.prefabName, true, SceneObjType.ActionRes, gameObject3.transform.position, gameObject3.transform.rotation, out flag);

                    if (GameSettings.DynamicParticleLOD)
                    {
                        MonoSingleton <SceneMgr> .GetInstance().m_dynamicLOD = false;
                    }
                }
                if (GameSettings.DynamicParticleLOD)
                {
                    GameSettings.ParticleLOD = particleLOD;
                }
                if (this.m_particleObj != null)
                {
                    this.m_particleObj.transform.SetParent(gameObject3.transform);
                    this.m_particleObj.transform.localPosition = Vector3.zero;
                    this.m_particleObj.transform.localRotation = Quaternion.identity;
                }
                this.actorRoot = ActorHelper.AttachActorRoot(gameObject3, ActorTypeDef.Actor_Type_Bullet, camp, null);
                _action.SetGameObject(this.targetId, gameObject3);
                this.actorRoot.get_handle().location = vInt;
                this.actorRoot.get_handle().forward  = forward;
                VCollisionShape.InitActorCollision(this.actorRoot, this.m_particleObj, _action.actionName);
                if (this.actorRoot.get_handle().shape != null)
                {
                    this.actorRoot.get_handle().shape.ConditionalUpdateShape();
                }
                if (this.bInvisibleBullet && this.actorRoot.get_handle().ActorControl != null)
                {
                    BulletWrapper bulletWrapper = this.actorRoot.get_handle().ActorControl as BulletWrapper;
                    if (bulletWrapper != null)
                    {
                        bulletWrapper.InitForInvisibleBullet();
                    }
                }
                this.actorRoot.get_handle().InitActor();
                if (refParamObject != null)
                {
                    refParamObject.EffectPos = this.actorRoot.get_handle().location;
                    if (this.actorRoot.get_handle().TheActorMeta.ActorType != ActorTypeDef.Actor_Type_EYE)
                    {
                        this.CreateBullet();
                    }
                }
                if (this.applyActionSpeedToAnimation)
                {
                    _action.AddTempObject(Action.PlaySpeedAffectedType.ePSAT_Anim, gameObject3);
                }
                if (this.applyActionSpeedToParticle)
                {
                    _action.AddTempObject(Action.PlaySpeedAffectedType.ePSAT_Fx, gameObject3);
                }
                this.actorRoot.get_handle().StartFight();
                if (this.enableLayer || this.enableTag)
                {
                    if (this.enableLayer)
                    {
                        gameObject3.layer = this.layer;
                    }
                    if (this.enableTag)
                    {
                        gameObject3.tag = this.tag;
                    }
                    Transform[] componentsInChildren = gameObject3.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;
                        }
                    }
                }
                if (flag)
                {
                    ParticleHelper.Init(gameObject3, this.scaling);
                }
                PoolObjHandle <ActorRoot> actorHandle3 = _action.GetActorHandle(this.targetId);
                this.SetParent(ref actorHandle, ref actorHandle3, this.translation);
                if (this.modifyScaling)
                {
                    gameObject3.transform.localScale = this.scaling;
                }
            }
            else
            {
                GameObject gameObject4;
                if (this.modifyDirection)
                {
                    gameObject4 = MonoSingleton <SceneMgr> .GetInstance().InstantiateLOD(this.prefabName, true, SceneObjType.ActionRes, (Vector3)vInt, Quaternion.LookRotation((Vector3)forward));
                }
                else
                {
                    gameObject4 = MonoSingleton <SceneMgr> .GetInstance().InstantiateLOD(this.prefabName, true, SceneObjType.ActionRes, (Vector3)vInt);
                }
                if (gameObject4 == null)
                {
                    return;
                }
                if (this.applyActionSpeedToAnimation)
                {
                    _action.AddTempObject(Action.PlaySpeedAffectedType.ePSAT_Anim, gameObject4);
                }
                if (this.applyActionSpeedToParticle)
                {
                    _action.AddTempObject(Action.PlaySpeedAffectedType.ePSAT_Fx, gameObject4);
                }
                if (this.enableLayer)
                {
                    gameObject4.layer = this.layer;
                    Transform[] componentsInChildren2 = gameObject4.GetComponentsInChildren <Transform>();
                    for (int j = 0; j < componentsInChildren2.Length; j++)
                    {
                        componentsInChildren2[j].gameObject.layer = this.layer;
                    }
                }
                if (this.enableTag)
                {
                    gameObject4.tag = this.tag;
                    Transform[] componentsInChildren3 = gameObject4.GetComponentsInChildren <Transform>();
                    for (int k = 0; k < componentsInChildren3.Length; k++)
                    {
                        componentsInChildren3[k].gameObject.tag = this.tag;
                    }
                }
                if (gameObject4.GetComponent <ParticleSystem>() && this.modifyScaling)
                {
                    ParticleSystem[] componentsInChildren4 = gameObject4.GetComponentsInChildren <ParticleSystem>();
                    for (int l = 0; l < componentsInChildren4.Length; l++)
                    {
                        componentsInChildren4[l].startSize            *= this.scaling.x;
                        componentsInChildren4[l].startLifetime        *= this.scaling.y;
                        componentsInChildren4[l].startSpeed           *= this.scaling.z;
                        componentsInChildren4[l].transform.localScale *= this.scaling.x;
                    }
                }
                PoolObjHandle <ActorRoot> poolObjHandle = ActorHelper.GetActorRoot(gameObject4);
                this.SetParent(ref actorHandle, ref poolObjHandle, this.translation);
                if (this.modifyScaling)
                {
                    gameObject4.transform.localScale = this.scaling;
                }
            }
        }
コード例 #10
0
        public override void Enter(Action _action, Track _track)
        {
            string resourceName;

            if (this.bUseSkin)
            {
                resourceName = SkinResourceHelper.GetResourceName(_action, this.prefabName);
            }
            else
            {
                resourceName = this.prefabName;
            }
            VInt3                     zero           = VInt3.zero;
            VInt3                     forward        = VInt3.forward;
            SkillUseContext           refParamObject = null;
            GameObject                gameObject     = _action.GetGameObject(this.parentId);
            PoolObjHandle <ActorRoot> actorHandle    = _action.GetActorHandle(this.parentId);
            PoolObjHandle <ActorRoot> handle2        = _action.GetActorHandle(this.objectSpaceId);

            if (handle2 != 0)
            {
                ActorRoot handle = handle2.handle;
                if (this.superTranslation)
                {
                    VInt3 num3 = VInt3.zero;
                    _action.refParams.GetRefParam("_BulletPos", ref num3);
                    zero = IntMath.Transform(num3, handle.forward, handle.location);
                }
                else if (this.modifyTranslation)
                {
                    zero = IntMath.Transform(this.translation, handle.forward, handle.location);
                }
                if (this.modifyDirection)
                {
                    forward = handle2.handle.forward;
                }
            }
            else if (this.bTargetPosition)
            {
                zero = this.translation + this.targetPosition;
                if (this.modifyDirection)
                {
                    if (refParamObject == null)
                    {
                        refParamObject = _action.refParams.GetRefParamObject <SkillUseContext>("SkillContext");
                    }
                    if ((refParamObject != null) && (refParamObject.Originator != 0))
                    {
                        forward = refParamObject.Originator.handle.forward;
                    }
                }
            }
            else
            {
                if (this.modifyTranslation)
                {
                    zero = this.translation;
                }
                if ((this.modifyDirection && (this.direction.x != 0)) && (this.direction.y != 0))
                {
                    forward = this.direction;
                    forward.NormalizeTo(0x3e8);
                }
            }
            if (this.targetId >= 0)
            {
                _action.ExpandGameObject(this.targetId);
                GameObject obj3 = _action.GetGameObject(this.targetId);
                if (this.recreateExisting && (obj3 != null))
                {
                    if (this.applyActionSpeedToAnimation)
                    {
                        _action.RemoveTempObject(Action.PlaySpeedAffectedType.ePSAT_Anim, obj3);
                    }
                    if (this.applyActionSpeedToParticle)
                    {
                        _action.RemoveTempObject(Action.PlaySpeedAffectedType.ePSAT_Fx, obj3);
                    }
                    ActorHelper.DetachActorRoot(obj3);
                    ActionManager.DestroyGameObject(obj3);
                    _action.SetGameObject(this.targetId, null);
                }
                GameObject go     = null;
                bool       isInit = true;
                if (obj3 == null)
                {
                    go = MonoSingleton <SceneMgr> .GetInstance().Spawn("TempObject", SceneObjType.Bullet, zero, forward);

                    if (go != null)
                    {
                        go.transform.localScale = Vector3.one;
                        bool flag2       = true;
                        int  particleLOD = GameSettings.ParticleLOD;
                        if (refParamObject == null)
                        {
                            refParamObject = _action.refParams.GetRefParamObject <SkillUseContext>("SkillContext");
                        }
                        if ((refParamObject != null) && (((refParamObject.Originator != 0) && (refParamObject.Originator.handle.TheActorMeta.PlayerId == Singleton <GamePlayerCenter> .GetInstance().GetHostPlayer().PlayerId)) || ((refParamObject.TargetActor != 0) && (refParamObject.TargetActor.handle.TheActorMeta.PlayerId == Singleton <GamePlayerCenter> .GetInstance().GetHostPlayer().PlayerId))))
                        {
                            flag2 = false;
                        }
                        if (!flag2 && (particleLOD > 1))
                        {
                            GameSettings.ParticleLOD = 1;
                        }
                        MonoSingleton <SceneMgr> .GetInstance().m_dynamicLOD = flag2;

                        this.particleObj = MonoSingleton <SceneMgr> .GetInstance().GetPooledGameObjLOD(resourceName, true, SceneObjType.ActionRes, go.transform.position, go.transform.rotation, out isInit);

                        MonoSingleton <SceneMgr> .GetInstance().m_dynamicLOD = false;

                        if (this.particleObj == null)
                        {
                            MonoSingleton <SceneMgr> .GetInstance().m_dynamicLOD = flag2;

                            this.particleObj = MonoSingleton <SceneMgr> .GetInstance().GetPooledGameObjLOD(this.prefabName, true, SceneObjType.ActionRes, go.transform.position, go.transform.rotation, out isInit);

                            MonoSingleton <SceneMgr> .GetInstance().m_dynamicLOD = false;
                        }
                        GameSettings.ParticleLOD = particleLOD;
                        if (this.particleObj != null)
                        {
                            this.particleObj.transform.SetParent(go.transform);
                            this.particleObj.transform.localPosition = Vector3.zero;
                            this.particleObj.transform.localRotation = Quaternion.identity;
                        }
                        if (this.sightRadius > 0)
                        {
                            this.actorRoot = ActorHelper.AttachActorRoot(go, ActorTypeDef.Actor_Type_EYE, false);
                        }
                        else
                        {
                            this.actorRoot = ActorHelper.AttachActorRoot(go, ActorTypeDef.Actor_Type_Bullet, false);
                        }
                        if (this.actorRoot.handle.ObjLinker != null)
                        {
                            this.actorRoot.handle.ObjLinker.ActorStart();
                        }
                        this.actorRoot.handle.location = zero;
                        this.actorRoot.handle.forward  = forward;
                        _action.SetGameObject(this.targetId, go);
                        VCollisionShape.InitActorCollision((ActorRoot)this.actorRoot, this.particleObj);
                        if (this.actorRoot.handle.shape != null)
                        {
                            this.actorRoot.handle.shape.ConditionalUpdateShape();
                        }
                        if (refParamObject == null)
                        {
                            refParamObject = _action.refParams.GetRefParamObject <SkillUseContext>("SkillContext");
                        }
                        if (refParamObject != null)
                        {
                            refParamObject.EffectPos = this.actorRoot.handle.location;
                            if (refParamObject.Originator != 0)
                            {
                                COM_PLAYERCAMP actorCamp = refParamObject.Originator.handle.TheActorMeta.ActorCamp;
                                this.CreateEye(actorCamp);
                            }
                        }
                        if (this.applyActionSpeedToAnimation)
                        {
                            _action.AddTempObject(Action.PlaySpeedAffectedType.ePSAT_Anim, go);
                        }
                        if (this.applyActionSpeedToParticle)
                        {
                            _action.AddTempObject(Action.PlaySpeedAffectedType.ePSAT_Fx, go);
                        }
                        if (this.enableLayer || this.enableTag)
                        {
                            if (this.enableLayer)
                            {
                                go.layer = this.layer;
                            }
                            if (this.enableTag)
                            {
                                go.tag = this.tag;
                            }
                            Transform[] componentsInChildren = go.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;
                                }
                            }
                        }
                        if (isInit)
                        {
                            ParticleHelper.Init(go, this.scaling);
                        }
                        PoolObjHandle <ActorRoot> newActor = _action.GetActorHandle(this.targetId);
                        this.SetParent(ref actorHandle, ref newActor, this.translation);
                        if (this.modifyScaling)
                        {
                            go.transform.localScale = this.scaling;
                        }
                    }
                }
            }
            else
            {
                GameObject obj5;
                if (this.modifyDirection)
                {
                    obj5 = MonoSingleton <SceneMgr> .GetInstance().InstantiateLOD(this.prefabName, true, SceneObjType.ActionRes, (Vector3)zero, Quaternion.LookRotation((Vector3)forward));
                }
                else
                {
                    obj5 = MonoSingleton <SceneMgr> .GetInstance().InstantiateLOD(this.prefabName, true, SceneObjType.ActionRes, (Vector3)zero);
                }
                if (obj5 != null)
                {
                    if (this.applyActionSpeedToAnimation)
                    {
                        _action.AddTempObject(Action.PlaySpeedAffectedType.ePSAT_Anim, obj5);
                    }
                    if (this.applyActionSpeedToParticle)
                    {
                        _action.AddTempObject(Action.PlaySpeedAffectedType.ePSAT_Fx, obj5);
                    }
                    if (this.enableLayer)
                    {
                        obj5.layer = this.layer;
                        Transform[] transformArray2 = obj5.GetComponentsInChildren <Transform>();
                        for (int j = 0; j < transformArray2.Length; j++)
                        {
                            transformArray2[j].gameObject.layer = this.layer;
                        }
                    }
                    if (this.enableTag)
                    {
                        obj5.tag = this.tag;
                        Transform[] transformArray3 = obj5.GetComponentsInChildren <Transform>();
                        for (int k = 0; k < transformArray3.Length; k++)
                        {
                            transformArray3[k].gameObject.tag = this.tag;
                        }
                    }
                    if ((obj5.GetComponent <ParticleSystem>() != null) && this.modifyScaling)
                    {
                        ParticleSystem[] systemArray = obj5.GetComponentsInChildren <ParticleSystem>();
                        for (int m = 0; m < systemArray.Length; m++)
                        {
                            ParticleSystem system1 = systemArray[m];
                            system1.startSize *= this.scaling.x;
                            ParticleSystem system2 = systemArray[m];
                            system2.startLifetime *= this.scaling.y;
                            ParticleSystem system3 = systemArray[m];
                            system3.startSpeed *= this.scaling.z;
                            Transform transform = systemArray[m].transform;
                            transform.localScale = (Vector3)(transform.localScale * this.scaling.x);
                        }
                    }
                    PoolObjHandle <ActorRoot> actorRoot = ActorHelper.GetActorRoot(obj5);
                    this.SetParent(ref actorHandle, ref actorRoot, this.translation);
                    if (this.modifyScaling)
                    {
                        obj5.transform.localScale = this.scaling;
                    }
                }
            }
        }