private void _torpedoInjection()
        {
            this._fieldCam[0].get_transform().set_position(new Vector3(-51f, 8f, 90f));
            this._fieldCam[0].get_transform().set_localRotation(Quaternion.Euler(new Vector3(10.5f, 70f, 0f)));
            this._fieldCam[1].get_transform().set_position(new Vector3(-51f, 8f, -90f));
            this._fieldCam[1].get_transform().set_localRotation(Quaternion.Euler(new Vector3(10.5f, 111f, 0f)));
            bool isFirst = false;

            using (List <PSTorpedoWake> .Enumerator enumerator = this._listPSTorpedoWake.GetEnumerator())
            {
                while (enumerator.MoveNext())
                {
                    PSTorpedoWake current = enumerator.get_Current();
                    current.SetActive(true);
                    current.Injection(iTween.EaseType.linear, false, false, delegate
                    {
                        if (!isFirst)
                        {
                            this._compTorpedoAttack();
                            isFirst = true;
                        }
                    });
                }
            }
        }
Example #2
0
 public void OnSetDestroy()
 {
     if (_listPSTorpedoWake != null)
     {
         foreach (PSTorpedoWake item in _listPSTorpedoWake)
         {
             UnityEngine.Object.Destroy(item);
         }
         _listPSTorpedoWake.Clear();
     }
     _listPSTorpedoWake = null;
     if (_torpedoProtect != null)
     {
         UnityEngine.Object.Destroy(_torpedoProtect.gameObject);
     }
     _torpedoProtect = null;
     Mem.Del(ref _isTorpedoHit);
     Mem.Del(ref _isProtect);
     Mem.Del(ref _actCallback);
     Mem.Del(ref stateType);
     Mem.Del(ref transform);
     Mem.DelListSafe(ref _listPSTorpedoWake);
     Mem.DelDictionarySafe(ref _dicIsCriticall);
     Mem.DelDictionarySafe(ref _dicIsMiss);
     if (_torpedoProtect != null)
     {
         UnityEngine.Object.Destroy(_torpedoProtect.gameObject);
     }
     _torpedoProtect  = null;
     _torpedoParticle = null;
     _clsRaigeki      = null;
     Mem.Del(ref _fieldCam);
 }
Example #3
0
        private PSTorpedoWake _createTorpedo(Vector3 injection, Vector3 target, bool isRescue)
        {
            PSTorpedoWake pSTorpedoWake = PSTorpedoWake.Instantiate(_torpedoParticle, BattleTaskManager.GetBattleField().transform, injection, target, 0, 0.6f, isDet: true, isMiss: false);

            pSTorpedoWake.SetActive(isActive: false);
            return(pSTorpedoWake);
        }
 private void _startZoomTorpedo()
 {
     if (this._listTorpedoWake != null)
     {
         using (List <PSTorpedoWake> .Enumerator enumerator = this._listTorpedoWake.GetEnumerator())
         {
             while (enumerator.MoveNext())
             {
                 PSTorpedoWake current = enumerator.get_Current();
                 current.SetActive(false);
                 Object.Destroy(current);
             }
         }
         this._listTorpedoWake.Clear();
     }
     this._listTorpedoWake = null;
     BattleTaskManager.GetBattleCameras().SetVerticalSplitCameras(false);
     if (this._dicIsAttack.get_Item(FleetType.Friend))
     {
         this._setTorpedoWakeZoom(true);
     }
     else if (this._dicIsAttack.get_Item(FleetType.Enemy))
     {
         this._setTorpedoWakeZoom(false);
     }
 }
        private PSTorpedoWake _createTorpedo(Vector3 injection, Vector3 target, bool isRescue)
        {
            PSTorpedoWake pSTorpedoWake = PSTorpedoWake.Instantiate(this._torpedoParticle, BattleTaskManager.GetBattleField().get_transform(), injection, target, 0, 0.6f, true, false);

            pSTorpedoWake.SetActive(false);
            return(pSTorpedoWake);
        }
Example #6
0
 private void _onTorpedoAttackFinished()
 {
     if (this._battleHpGauges != null)
     {
         this._battleHpGauges.Dispose();
     }
     this._battleHpGauges = null;
     if (this._listPSTorpedoWake != null)
     {
         using (List <PSTorpedoWake> .Enumerator enumerator = this._listPSTorpedoWake.GetEnumerator())
         {
             while (enumerator.MoveNext())
             {
                 PSTorpedoWake current = enumerator.get_Current();
                 Object.Destroy(current);
             }
         }
         this._listPSTorpedoWake.Clear();
     }
     this._listPSTorpedoWake = null;
     if (this._actCallback != null)
     {
         this._actCallback.Invoke();
     }
     this.OnSetDestroy();
 }
Example #7
0
 public bool Initialize(ShienModel_Rai model, PSTorpedoWake trupedoWake)
 {
     this._fieldCam = BattleTaskManager.GetBattleCameras().friendFieldCamera;
     this._fieldCam.ReqViewMode(CameraActor.ViewMode.NotViewModeCtrl);
     this._clsTorpedo  = model;
     this._torpedoWake = trupedoWake;
     this._fPhaseTime  = 0f;
     this._stateType   = ProdSupportTorpedoP1.StateType.None;
     return(true);
 }
 private void _onTorpedoAttackFinished()
 {
     deleteTorpedoWake();
     if (_onesTorpedoWake != null)
     {
         UnityEngine.Object.Destroy(_onesTorpedoWake);
     }
     _onesTorpedoWake = null;
     if (_actCallback != null)
     {
         _actCallback();
     }
 }
 public bool Initialize(RaigekiModel model, PSTorpedoWake psTorpedo, UITexture line)
 {
     _fieldCam    = BattleTaskManager.GetBattleCameras().friendFieldCamera;
     _isPlaying   = false;
     _isTC        = new bool[2];
     _clsTorpedo  = model;
     _torpedoWake = psTorpedo;
     _centerLine  = line;
     _fPhaseTime  = 0f;
     _stateType   = StateType.None;
     _dicIsAttack = new Dictionary <FleetType, bool>();
     _dicIsAttack.Add(FleetType.Friend, value: false);
     _dicIsAttack.Add(FleetType.Enemy, value: false);
     return(true);
 }
		public void Initialize(ShienModel_Rai model, PSTorpedoWake torpedoWake)
		{
			_fTime = 0f;
			stateType = StateType.None;
			_clsTorpedo = model;
			_isAttackE = false;
			_camFriend = BattleTaskManager.GetBattleCameras().friendFieldCamera;
			BattleShips battleShips = BattleTaskManager.GetBattleShips();
			battleShips.SetBollboardTarget(isFriend: false, _camFriend.transform);
			_torpedoParticle = torpedoWake;
			BattleTaskManager.GetTaskTorpedoSalvo();
			Transform prefabProdTorpedoResucueCutIn = BattleTaskManager.GetPrefabFile().prefabProdTorpedoResucueCutIn;
			_rescueCutIn = transform.SafeGetComponent<ProdAerialRescueCutIn>();
			_rescueCutIn._init();
		}
Example #11
0
 public void deleteTorpedoWake()
 {
     if (this._listTorpedoWake != null)
     {
         using (List <PSTorpedoWake> .Enumerator enumerator = this._listTorpedoWake.GetEnumerator())
         {
             while (enumerator.MoveNext())
             {
                 PSTorpedoWake current = enumerator.get_Current();
                 Object.Destroy(current);
             }
         }
         this._listTorpedoWake.Clear();
     }
     this._listTorpedoWake = null;
 }
Example #12
0
        public static PSTorpedoWake Instantiate(PSTorpedoWake prefab, Transform parent, Vector3 injectionVec, Vector3 target, int attacker, float _time, bool isDet, bool isMiss)
        {
            PSTorpedoWake pSTorpedoWake = UnityEngine.Object.Instantiate(prefab);

            pSTorpedoWake._init();
            ((Component)pSTorpedoWake._psTorpedoWake).transform.parent = parent;
            pSTorpedoWake.transform.parent             = BattleTaskManager.GetBattleField().transform;
            pSTorpedoWake.transform.position           = injectionVec;
            pSTorpedoWake.transform.transform.rotation = Quaternion.Euler(new Vector3(-180f, 0f, 0f));
            pSTorpedoWake._vecTarget    = target;
            pSTorpedoWake._attakerIndex = attacker;
            pSTorpedoWake._moveTime     = _time;
            pSTorpedoWake._psTorpedoWake.Stop();
            pSTorpedoWake._isDetonation = isDet;
            pSTorpedoWake._isMiss       = isMiss;
            return(pSTorpedoWake);
        }
Example #13
0
        public void Initialize(ShienModel_Rai model, PSTorpedoWake torpedoWake)
        {
            this._fTime      = 0f;
            this.stateType   = ProdSupportTorpedoP2.StateType.None;
            this._clsTorpedo = model;
            this._isAttackE  = false;
            this._camFriend  = BattleTaskManager.GetBattleCameras().friendFieldCamera;
            BattleShips battleShips = BattleTaskManager.GetBattleShips();

            battleShips.SetBollboardTarget(false, this._camFriend.get_transform());
            this._torpedoParticle = torpedoWake;
            TaskBattleTorpedoSalvo taskTorpedoSalvo = BattleTaskManager.GetTaskTorpedoSalvo();
            Transform prefabProdTorpedoResucueCutIn = BattleTaskManager.GetPrefabFile().prefabProdTorpedoResucueCutIn;

            this._rescueCutIn = this.transform.SafeGetComponent <ProdAerialRescueCutIn>();
            this._rescueCutIn._init();
        }
 public bool Initialize(RaigekiModel model, PSTorpedoWake psTorpedo)
 {
     this._fTime             = 0f;
     this._isTorpedoHit      = new bool[2];
     this._isProtect         = new bool[2];
     this.stateType          = ProdTorpedoSalvoPhase3.StateType.None;
     this._clsRaigeki        = model;
     this._torpedoParticle   = psTorpedo;
     this._fBattleship       = BattleTaskManager.GetBattleShips().dicFriendBattleShips;
     this._eBattleship       = BattleTaskManager.GetBattleShips().dicEnemyBattleShips;
     this._listPSTorpedoWake = new List <PSTorpedoWake>();
     this._fieldCam          = new BattleFieldCamera[2];
     this._fieldCam[0]       = BattleTaskManager.GetBattleCameras().friendFieldCamera;
     this._fieldCam[1]       = BattleTaskManager.GetBattleCameras().enemyFieldCamera;
     this._torpedoProtect    = this.transform.SafeGetComponent <ProdTorpedoProtect>();
     this._torpedoProtect._init();
     return(true);
 }
        private bool _createTorpedoWakeOnes(bool isFriend)
        {
            FleetType key = (!isFriend) ? FleetType.Enemy : FleetType.Friend;
            Dictionary <int, UIBattleShip> dictionary  = (!isFriend) ? BattleTaskManager.GetBattleShips().dicEnemyBattleShips : BattleTaskManager.GetBattleShips().dicFriendBattleShips;
            Dictionary <int, UIBattleShip> dictionary2 = (!isFriend) ? BattleTaskManager.GetBattleShips().dicFriendBattleShips : BattleTaskManager.GetBattleShips().dicEnemyBattleShips;

            if (_dicIsAttack[key])
            {
                for (int i = 0; i < dictionary.Count; i++)
                {
                    ShipModel_Battle shipModel = dictionary[i].shipModel;
                    ShipModel_Battle attackTo  = _clsTorpedo.GetAttackTo(shipModel);
                    if (shipModel != null && attackTo != null)
                    {
                        Vector3 position = dictionary[i].transform.position;
                        Vector3 vector;
                        if (isFriend)
                        {
                            Vector3 position2 = dictionary2[attackTo.Index].transform.position;
                            vector = new Vector3(position2.x, position.y, position.z - 1f);
                        }
                        else
                        {
                            Vector3 position3 = dictionary2[attackTo.Index].transform.position;
                            vector = new Vector3(position3.x, position.y, position.z + 1f);
                        }
                        Vector3            injection    = vector;
                        RaigekiDamageModel attackDamage = _clsTorpedo.GetAttackDamage(attackTo.Index, (!isFriend) ? true : false);
                        int     key2      = (!attackDamage.GetProtectEffect(shipModel.TmpId)) ? attackTo.Index : 0;
                        float   num       = (!isFriend) ? (-20f) : 20f;
                        float   num2      = (attackDamage.GetHitState(shipModel.TmpId) != 0) ? 0f : (-3f);
                        Vector3 position4 = dictionary2[key2].transform.position;
                        _onesTorpedoWake = _instantiateTorpedo(target: new Vector3(position4.x + num2, position4.y, position4.z + num), injection: injection, index: i, _time: 2.65f, isDet: false, isMiss: false, isD: true);
                        _setCameraPosition(injection.x);
                        _straightTarget = position4;
                        Vector3 pointOfGaze = dictionary2[key2].pointOfGaze;
                        _straightTargetGazeY = pointOfGaze.y;
                        break;
                    }
                }
            }
            return((_onesTorpedoWake != null) ? true : false);
        }
Example #16
0
        private void _createTorpedoWakeOnes()
        {
            Dictionary <int, UIBattleShip> dicFriendBattleShips = BattleTaskManager.GetBattleShips().dicFriendBattleShips;
            Dictionary <int, UIBattleShip> dicEnemyBattleShips  = BattleTaskManager.GetBattleShips().dicEnemyBattleShips;
            bool isTC = false;

            for (int i = 0; i < this._clsTorpedo.ShienShips.Length; i++)
            {
                if (this._clsTorpedo.ShienShips[i] != null)
                {
                    if (this._clsTorpedo.ShienShips[i].ShipType == 4)
                    {
                        isTC = true;
                    }
                }
            }
            this._listTorpedoWake = new List <PSTorpedoWake>();
            List <ShipModel_Defender> defenders = this._clsTorpedo.GetDefenders(false);

            for (int j = 0; j < defenders.get_Count(); j++)
            {
                DamageModel attackDamage      = this._clsTorpedo.GetAttackDamage(defenders.get_Item(j).TmpId);
                Vector3     vecStraightTarget = (!attackDamage.GetProtectEffect()) ? dicEnemyBattleShips.get_Item(j).get_transform().get_position() : dicEnemyBattleShips.get_Item(0).get_transform().get_position();
                Vector3     injection         = new Vector3(vecStraightTarget.x, vecStraightTarget.y, dicFriendBattleShips.get_Item(0).get_transform().get_position().z - 1f);
                Vector3     target            = (attackDamage.GetHitState() != BattleHitStatus.Miss) ? new Vector3(vecStraightTarget.x, vecStraightTarget.y, vecStraightTarget.z + 20f) : new Vector3(vecStraightTarget.x - 3f, vecStraightTarget.y, vecStraightTarget.z + 20f);
                this._listTorpedoWake.Add(this._createTorpedo(true, injection, target, 2.65f, false, false));
                this._setTopCamera(injection.x);
                this._vecStraightTarget         = vecStraightTarget;
                this._fStraightTargetGazeHeight = dicEnemyBattleShips.get_Item(j).pointOfGaze.y;
            }
            using (List <PSTorpedoWake> .Enumerator enumerator = this._listTorpedoWake.GetEnumerator())
            {
                while (enumerator.MoveNext())
                {
                    PSTorpedoWake current = enumerator.get_Current();
                    current.Injection(iTween.EaseType.linear, true, isTC, delegate
                    {
                    });
                }
            }
        }
Example #17
0
        private void _torpedoInjection()
        {
            this._camFriend.get_transform().set_position(new Vector3(-38f, 8f, -74f));
            this._camFriend.get_transform().set_localRotation(Quaternion.Euler(new Vector3(9.5f, 137.5f, 0f)));
            bool isFirst = false;

            using (List <PSTorpedoWake> .Enumerator enumerator = this._listPSTorpedoWake.GetEnumerator())
            {
                while (enumerator.MoveNext())
                {
                    PSTorpedoWake current = enumerator.get_Current();
                    current.Injection(iTween.EaseType.linear, false, false, delegate
                    {
                        if (!isFirst)
                        {
                            this._setShinking();
                            this._compTorpedoAttack();
                            isFirst = true;
                        }
                    });
                }
            }
        }
 public void OnSetDestroy()
 {
     if (this._listPSTorpedoWake != null)
     {
         using (List <PSTorpedoWake> .Enumerator enumerator = this._listPSTorpedoWake.GetEnumerator())
         {
             while (enumerator.MoveNext())
             {
                 PSTorpedoWake current = enumerator.get_Current();
                 Object.Destroy(current);
             }
         }
         this._listPSTorpedoWake.Clear();
     }
     this._listPSTorpedoWake = null;
     if (this._torpedoProtect != null)
     {
         Object.Destroy(this._torpedoProtect.get_gameObject());
     }
     this._torpedoProtect = null;
     Mem.Del <bool[]>(ref this._isTorpedoHit);
     Mem.Del <bool[]>(ref this._isProtect);
     Mem.Del <Action>(ref this._actCallback);
     Mem.Del <ProdTorpedoSalvoPhase3.StateType>(ref this.stateType);
     Mem.Del <Transform>(ref this.transform);
     Mem.DelListSafe <PSTorpedoWake>(ref this._listPSTorpedoWake);
     Mem.DelDictionarySafe <FleetType, bool[]>(ref this._dicIsCriticall);
     Mem.DelDictionarySafe <FleetType, bool[]>(ref this._dicIsMiss);
     if (this._torpedoProtect != null)
     {
         Object.Destroy(this._torpedoProtect.get_gameObject());
     }
     this._torpedoProtect  = null;
     this._torpedoParticle = null;
     this._clsRaigeki      = null;
     Mem.Del <BattleFieldCamera[]>(ref this._fieldCam);
 }
		private PSTorpedoWake _createTorpedo(Vector3 injection, Vector3 target, float time, bool isDet)
		{
			return PSTorpedoWake.Instantiate(_torpedoParticle, BattleTaskManager.GetBattleField().transform, injection, target, 0, time, isDet, isMiss: false);
		}
Example #20
0
 private PSTorpedoWake _createTorpedo(bool isOnes, Vector3 injection, Vector3 target, float _time, bool isDet, bool isMiss)
 {
     return(PSTorpedoWake.Instantiate((!isOnes) ? this._torpedoWake : ParticleFile.Load <PSTorpedoWake>(ParticleFileInfos.BattlePSTorpedowakeD), BattleTaskManager.GetBattleField().get_transform(), new Vector3(injection.x, injection.y + 1f, injection.z), new Vector3(target.x, target.y + 1f, target.z), 0, _time, isDet, isMiss));
 }
 private PSTorpedoWake _instantiateTorpedo(Vector3 injection, Vector3 target, int index, float _time, bool isDet, bool isMiss, bool isD)
 {
     return(PSTorpedoWake.Instantiate(injectionVec: new Vector3(injection.x, injection.y + 1f, injection.z), target: new Vector3(target.x, target.y + 1f, target.z), prefab: (!isD) ? _torpedoWake : ParticleFile.Load <PSTorpedoWake>(ParticleFileInfos.BattlePSTorpedowakeD), parent: BattleTaskManager.GetBattleField().transform, attacker: index, _time: _time, isDet: isDet, isMiss: isMiss));
 }
Example #22
0
 private PSTorpedoWake _createTorpedo(Vector3 injection, Vector3 target, float time, bool isDet)
 {
     return(PSTorpedoWake.Instantiate(this._torpedoParticle, BattleTaskManager.GetBattleField().get_transform(), injection, target, 0, time, isDet, false));
 }