public void Play()
 {
     _disAnimation = Observable.Interval(TimeSpan.FromSeconds(0.10000000149011612)).Subscribe(delegate
     {
         base.transform.LTRotateLocal(Vector3.forward * XorRandom.GetFLim(0.45f, 3.3f), 0.1f);
     });
 }
 public void Play()
 {
     this._disAnimation = Observable.Interval(TimeSpan.FromSeconds(0.10000000149011612)).Subscribe(delegate(long x)
     {
         base.get_transform().LTRotateLocal(Vector3.get_forward() * XorRandom.GetFLim(0.45f, 3.3f), 0.1f);
     });
 }
 public bool Reset()
 {
     this._isEyeOpen           = true;
     this._fEyeInterval        = XorRandom.GetFLim(1f, 3f);
     this._uiSprite.spriteName = "mini_08_a_01";
     return(true);
 }
Exemple #4
0
 private void FixedUpdate()
 {
     if (!_isShake)
     {
         return;
     }
     if (_fShakeIntensity > 0f)
     {
         if (_isShakePos)
         {
             base.transform.position = _vOriginPosition + XorRandom.GetInsideUnitSphere(_fShakeIntensity);
         }
         if (_isShakeRot)
         {
             base.transform.rotation = new Quaternion(_quaOriginRotation.x + XorRandom.GetFLim(0f - _fShakeIntensity, _fShakeIntensity) * 2f, _quaOriginRotation.y + XorRandom.GetFLim(0f - _fShakeIntensity, _fShakeIntensity) * 2f, _quaOriginRotation.z + XorRandom.GetFLim(0f - _fShakeIntensity, _fShakeIntensity) * 2f, _quaOriginRotation.w + XorRandom.GetFLim(0f - _fShakeIntensity, _fShakeIntensity) * 2f);
         }
         _fShakeIntensity -= _fShakeDecay;
     }
     else
     {
         Observable.TimerFrame(2, FrameCountType.EndOfFrame).Subscribe(delegate
         {
             _isShake = false;
             if (_actCallback != null)
             {
                 _actCallback();
             }
         });
     }
 }
Exemple #5
0
        public void setSmoke()
        {
            if (this.count <= 5)
            {
                this.count = 5;
            }
            this._listPS  = new List <ParticleSystem>();
            this._listPos = new List <Vector3>();
            for (int i = 0; i < this.count; i++)
            {
                this._listPS.Add(this.Instantiate());
            }
            Vector3 position = base.get_transform().get_position();
            float   fMin     = this.randMinPos.x + (this.randMaxPos.x - this.randMinPos.x) * 0.8f;
            float   fMin2    = this.randMinPos.x + (this.randMaxPos.x - this.randMinPos.x) * 0.5f;
            float   fMin3    = this.randMinPos.y + (this.randMaxPos.y - this.randMinPos.y) * 0.8f;
            float   fMin4    = this.randMinPos.y + (this.randMaxPos.y - this.randMinPos.y) * 0.5f;

            this._listPos.Add(new Vector3(position.x, position.y + XorRandom.GetFLim(this.randMinPos.y, this.randMaxPos.y), position.z + this.randMaxPos.z));
            this._listPos.Add(new Vector3(position.x + XorRandom.GetFLim(fMin, this.randMaxPos.x), position.y + XorRandom.GetFLim(this.randMinPos.y, this.randMaxPos.y), position.z + XorRandom.GetFLim(fMin4, this.randMaxPos.y)));
            this._listPos.Add(new Vector3(position.x - XorRandom.GetFLim(fMin, this.randMaxPos.x), position.y + XorRandom.GetFLim(this.randMinPos.y, this.randMaxPos.y), position.z + XorRandom.GetFLim(fMin4, this.randMaxPos.y)));
            this._listPos.Add(new Vector3(position.x + XorRandom.GetFLim(fMin2, this.randMaxPos.x), position.y + XorRandom.GetFLim(this.randMinPos.y, this.randMaxPos.y), position.z - XorRandom.GetFLim(fMin3, this.randMaxPos.y)));
            this._listPos.Add(new Vector3(position.x - XorRandom.GetFLim(fMin2, this.randMaxPos.x), position.y + XorRandom.GetFLim(this.randMinPos.y, this.randMaxPos.y), position.z - XorRandom.GetFLim(fMin3, this.randMaxPos.y)));
            float[] array  = new float[2];
            float[] array2 = new float[2];
            for (int j = 0; j < this.count - 5; j++)
            {
                array[0]  = XorRandom.GetFLim(this.randMinPos.x, this.randMaxPos.x);
                array[1]  = XorRandom.GetFLim(this.randMaxPos.x * -1f, this.randMinPos.x * -1f);
                array2[0] = XorRandom.GetFLim(this.randMinPos.z, this.randMaxPos.z);
                array2[1] = XorRandom.GetFLim(this.randMaxPos.z * -1f, this.randMinPos.z * -1f);
                this._listPos.Add(new Vector3(position.x + array[XorRandom.GetILim(0, 1)], position.y + XorRandom.GetFLim(this.randMinPos.y, this.randMaxPos.y), position.z + array2[XorRandom.GetILim(0, 1)]));
            }
        }
Exemple #6
0
        public void setSmoke()
        {
            if (count <= 5)
            {
                count = 5;
            }
            _listPS  = new List <ParticleSystem>();
            _listPos = new List <Vector3>();
            for (int i = 0; i < count; i++)
            {
                _listPS.Add(Instantiate());
            }
            Vector3 position = base.transform.position;
            float   fMin     = randMinPos.x + (randMaxPos.x - randMinPos.x) * 0.8f;
            float   fMin2    = randMinPos.x + (randMaxPos.x - randMinPos.x) * 0.5f;
            float   fMin3    = randMinPos.y + (randMaxPos.y - randMinPos.y) * 0.8f;
            float   fMin4    = randMinPos.y + (randMaxPos.y - randMinPos.y) * 0.5f;

            _listPos.Add(new Vector3(position.x, position.y + XorRandom.GetFLim(randMinPos.y, randMaxPos.y), position.z + randMaxPos.z));
            _listPos.Add(new Vector3(position.x + XorRandom.GetFLim(fMin, randMaxPos.x), position.y + XorRandom.GetFLim(randMinPos.y, randMaxPos.y), position.z + XorRandom.GetFLim(fMin4, randMaxPos.y)));
            _listPos.Add(new Vector3(position.x - XorRandom.GetFLim(fMin, randMaxPos.x), position.y + XorRandom.GetFLim(randMinPos.y, randMaxPos.y), position.z + XorRandom.GetFLim(fMin4, randMaxPos.y)));
            _listPos.Add(new Vector3(position.x + XorRandom.GetFLim(fMin2, randMaxPos.x), position.y + XorRandom.GetFLim(randMinPos.y, randMaxPos.y), position.z - XorRandom.GetFLim(fMin3, randMaxPos.y)));
            _listPos.Add(new Vector3(position.x - XorRandom.GetFLim(fMin2, randMaxPos.x), position.y + XorRandom.GetFLim(randMinPos.y, randMaxPos.y), position.z - XorRandom.GetFLim(fMin3, randMaxPos.y)));
            float[] array  = new float[2];
            float[] array2 = new float[2];
            for (int j = 0; j < count - 5; j++)
            {
                array[0]  = XorRandom.GetFLim(randMinPos.x, randMaxPos.x);
                array[1]  = XorRandom.GetFLim(randMaxPos.x * -1f, randMinPos.x * -1f);
                array2[0] = XorRandom.GetFLim(randMinPos.z, randMaxPos.z);
                array2[1] = XorRandom.GetFLim(randMaxPos.z * -1f, randMinPos.z * -1f);
                _listPos.Add(new Vector3(position.x + array[XorRandom.GetILim(0, 1)], position.y + XorRandom.GetFLim(randMinPos.y, randMaxPos.y), position.z + array2[XorRandom.GetILim(0, 1)]));
            }
        }
 public Fairy(Transform parent, string objName)
 {
     this._isEyeOpen    = true;
     this._fEyeInterval = XorRandom.GetFLim(1f, 3f);
     Util.FindParentToChild <UISprite>(ref this._uiSprite, parent, objName);
     this._uiSprite.type          = UIBasicSprite.Type.Filled;
     this._uiSprite.flip          = UIBasicSprite.Flip.Nothing;
     this._uiSprite.fillDirection = UIBasicSprite.FillDirection.Vertical;
     this._uiSprite.fillAmount    = 0.55f;
     this._uiSprite.invert        = true;
     this._uiSprite.spriteName    = "mini_08_a_01";
     this._dicFairyPos            = new Dictionary <bool, Vector3>();
     this._dicFairyPos.Add(false, Vector3.get_down() * 20f);
     this._dicFairyPos.Add(true, Vector3.get_up() * 40f);
 }
Exemple #8
0
 public Fairy(Transform parent, string objName)
 {
     _isEyeOpen    = true;
     _fEyeInterval = XorRandom.GetFLim(1f, 3f);
     Util.FindParentToChild(ref _uiSprite, parent, objName);
     _uiSprite.type          = UIBasicSprite.Type.Filled;
     _uiSprite.flip          = UIBasicSprite.Flip.Nothing;
     _uiSprite.fillDirection = UIBasicSprite.FillDirection.Vertical;
     _uiSprite.fillAmount    = 0.55f;
     _uiSprite.invert        = true;
     _uiSprite.spriteName    = "mini_08_a_01";
     _dicFairyPos            = new Dictionary <bool, Vector3>();
     _dicFairyPos.Add(key: false, Vector3.down * 20f);
     _dicFairyPos.Add(key: true, Vector3.up * 40f);
 }
 public void Update(bool isDecide)
 {
     if (isDecide && this._fEyeInterval >= 0f && (this._uiSprite.spriteName == "mini_08_a_01" || this._uiSprite.spriteName == "mini_08_a_02"))
     {
         this._uiSprite.spriteName = ((!this._isEyeOpen) ? "mini_08_a_04" : "mini_08_a_03");
     }
     this._fEyeInterval -= Time.get_deltaTime();
     if (this._fEyeInterval <= 0f)
     {
         this._isEyeOpen = !this._isEyeOpen;
         if (isDecide)
         {
             this._uiSprite.spriteName = ((!this._isEyeOpen) ? "mini_08_a_04" : "mini_08_a_03");
         }
         else
         {
             this._uiSprite.spriteName = ((!this._isEyeOpen) ? "mini_08_a_02" : "mini_08_a_01");
         }
         this._fEyeInterval = ((!this._isEyeOpen) ? XorRandom.GetFLim(0.1f, 0.5f) : XorRandom.GetFLim(0.5f, 1.5f));
     }
 }
Exemple #10
0
 public void Update(bool isDecide)
 {
     if (isDecide && _fEyeInterval >= 0f && (_uiSprite.spriteName == "mini_08_a_01" || _uiSprite.spriteName == "mini_08_a_02"))
     {
         _uiSprite.spriteName = ((!_isEyeOpen) ? "mini_08_a_04" : "mini_08_a_03");
     }
     _fEyeInterval -= Time.deltaTime;
     if (_fEyeInterval <= 0f)
     {
         _isEyeOpen = !_isEyeOpen;
         if (isDecide)
         {
             _uiSprite.spriteName = ((!_isEyeOpen) ? "mini_08_a_04" : "mini_08_a_03");
         }
         else
         {
             _uiSprite.spriteName = ((!_isEyeOpen) ? "mini_08_a_02" : "mini_08_a_01");
         }
         _fEyeInterval = ((!_isEyeOpen) ? XorRandom.GetFLim(0.1f, 0.5f) : XorRandom.GetFLim(0.5f, 1.5f));
     }
 }
 public void PlayLineAnimation()
 {
     this._mrLine.get_transform().LTCancel();
     this._mrLine.get_transform().LTRotateAroundLocal(Vector3.get_up(), XorRandom.GetFLim(0.1f, 1f) * 50f, XorRandom.GetFLim(2.5f, 4.6f)).setEase(LeanTweenType.linear).setLoopPingPong();
 }
 public void PlayLineAnimation()
 {
     ((Component)_mrLine).transform.LTCancel();
     ((Component)_mrLine).transform.LTRotateAroundLocal(Vector3.up, XorRandom.GetFLim(0.1f, 1f) * 50f, XorRandom.GetFLim(2.5f, 4.6f)).setEase(LeanTweenType.linear).setLoopPingPong();
 }
 private void _createExplotion()
 {
     _listBombCritical = new List <bool>();
     _listExplosion    = new List <ParticleSystem>();
     if (_attackState == AttackState.FriendExplosion)
     {
         for (int i = 0; i < _eBattleship.Count; i++)
         {
             _battleHpGauges.Show(i, _eHpPos[i], new Vector3(0.35f, 0.35f, 0.35f), isScale: false);
             BattleHPGauges battleHpGauges = _battleHpGauges;
             int            num            = i;
             Vector3        damagePosition = _battleHpGauges.GetDamagePosition(i);
             battleHpGauges.SetDamagePosition(num, new Vector3(damagePosition.x, -525f, 0f));
             _battleHpGauges.PlayHp(i, null);
         }
         _setShinking(FleetType.Friend);
         Vector3 position3 = default(Vector3);
         for (int j = 0; j < _fBakuraiModel.Length; j++)
         {
             if (_fBakuraiModel[j] == null || !_fBakuraiModel[j].IsBakugeki())
             {
                 continue;
             }
             ShipModel_Battle defender = _fBakuraiModel[j].Defender;
             int       num2            = (!_fBakuraiModel[j].GetProtectEffect()) ? defender.Index : defender.Index;
             bool      flag            = (_fBakuraiModel[j].GetHitState() == BattleHitStatus.Miss) ? true : false;
             FleetType fleetType       = FleetType.Enemy;
             _dicHitType[num2] = setHitType(fleetType, num2, flag, HitType.Bomb);
             HitType hitType = _dicHitType[num2];
             if (!flag)
             {
                 if (hitType == HitType.Bomb)
                 {
                     Vector3 position  = _eBattleship[num2].transform.position;
                     float   x         = position.x;
                     Vector3 position2 = _eBattleship[num2].transform.position;
                     position3 = new Vector3(x, 3f, position2.z);
                     ParticleSystem val = (!((UnityEngine.Object)BattleTaskManager.GetParticleFile().explosionAerial == null)) ? UnityEngine.Object.Instantiate <ParticleSystem>(BattleTaskManager.GetParticleFile().explosionAerial) : BattleTaskManager.GetParticleFile().explosionAerial;
                     ((Component)val).SetActive(isActive: true);
                     ((Component)val).transform.parent   = BattleTaskManager.GetBattleField().transform;
                     ((Component)val).transform.position = position3;
                     _listExplosion.Add(val);
                     _listBombCritical.Add((_fBakuraiModel[j].GetHitState() == BattleHitStatus.Clitical) ? true : false);
                 }
             }
             else if (hitType == HitType.Miss)
             {
                 Vector3 position4 = _eBattleship[num2].transform.position;
                 float   fMin      = position4.x - 0.5f;
                 Vector3 position5 = _eBattleship[num2].transform.position;
                 float   fLim      = XorRandom.GetFLim(fMin, position5.x + 0.5f);
                 Vector3 position6 = _eBattleship[num2].transform.position;
                 float   fMin2     = position6.z - 1f;
                 Vector3 position7 = _eBattleship[num2].transform.position;
                 float   fLim2     = XorRandom.GetFLim(fMin2, position7.z + 1f);
                 float   num3      = fLim;
                 Vector3 position8 = _eBattleship[num2].transform.position;
                 fLim = ((!(num3 >= position8.x)) ? (fLim - 0.5f) : (fLim + 0.5f));
                 float   num4      = fLim2;
                 Vector3 position9 = _eBattleship[num2].transform.position;
                 fLim2 = ((!(num4 >= position9.z)) ? (fLim2 - 0.5f) : (fLim2 + 0.5f));
                 ParticleSystem val2 = (!((UnityEngine.Object)BattleTaskManager.GetParticleFile().splashMiss == null)) ? UnityEngine.Object.Instantiate <ParticleSystem>(BattleTaskManager.GetParticleFile().splashMiss) : BattleTaskManager.GetParticleFile().splashMiss;
                 ((Component)val2).SetActive(isActive: true);
                 ((Component)val2).transform.parent   = BattleTaskManager.GetBattleField().transform;
                 ((Component)val2).transform.position = new Vector3(fLim, 0f, fLim2);
                 _listMiss.Add(val2);
             }
         }
     }
     if (_listExplosion != null)
     {
         int count = _listExplosion.Count;
     }
     if (_listMiss != null)
     {
         int count2 = _listMiss.Count;
     }
     _isEx = true;
     if (_listExplosion != null)
     {
         KCV.Utils.SoundUtils.PlaySE((_listExplosion.Count <= 1) ? SEFIleInfos.SE_930 : SEFIleInfos.SE_931);
     }
     Observable.FromCoroutine(_explosionPlay).Subscribe(delegate
     {
         _isEx = true;
     });
     Observable.FromCoroutine(_missSplashPlay).Subscribe(delegate
     {
         _isMiss = true;
     });
     _playSE(FleetType.Friend);
 }
Exemple #14
0
 private void FixedUpdate()
 {
     if (this._isShake)
     {
         if (this._fShakeIntensity > 0f)
         {
             if (this._isShakePos)
             {
                 base.get_transform().set_position(this._vOriginPosition + XorRandom.GetInsideUnitSphere(this._fShakeIntensity));
             }
             if (this._isShakeRot)
             {
                 base.get_transform().set_rotation(new Quaternion(this._quaOriginRotation.x + XorRandom.GetFLim(-this._fShakeIntensity, this._fShakeIntensity) * 2f, this._quaOriginRotation.y + XorRandom.GetFLim(-this._fShakeIntensity, this._fShakeIntensity) * 2f, this._quaOriginRotation.z + XorRandom.GetFLim(-this._fShakeIntensity, this._fShakeIntensity) * 2f, this._quaOriginRotation.w + XorRandom.GetFLim(-this._fShakeIntensity, this._fShakeIntensity) * 2f));
             }
             this._fShakeIntensity -= this._fShakeDecay;
         }
         else
         {
             Observable.TimerFrame(2, FrameCountType.EndOfFrame).Subscribe(delegate(long _)
             {
                 this._isShake = false;
                 if (this._actCallback != null)
                 {
                     this._actCallback.Invoke();
                 }
             });
         }
     }
 }
Exemple #15
0
        private void _createExplotion(bool isFriend)
        {
            _listBombCritical = new List <bool>();
            _listExplosion    = new List <ParticleSystem>();
            _listMiss         = new List <ParticleSystem>();
            FleetType key = (!isFriend) ? FleetType.Enemy : FleetType.Friend;

            if (isFriend)
            {
                Dictionary <int, UIBattleShip> fBattleship = _fBattleship;
            }
            else
            {
                Dictionary <int, UIBattleShip> eBattleship = _eBattleship;
            }
            Dictionary <int, UIBattleShip> dictionary = (!isFriend) ? _fBattleship : _eBattleship;
            Vector3 position3 = default(Vector3);

            for (int i = 0; i < _dicBakuraiModel[key].Length; i++)
            {
                if (_dicBakuraiModel[key][i] == null || !_dicBakuraiModel[key][i].IsBakugeki())
                {
                    continue;
                }
                ShipModel_Battle defender = _dicBakuraiModel[key][i].Defender;
                int       num             = (!_dicBakuraiModel[key][i].GetProtectEffect()) ? defender.Index : defender.Index;
                bool      flag            = (_dicBakuraiModel[key][i].GetHitState() == BattleHitStatus.Miss) ? true : false;
                FleetType fleetType       = isFriend ? FleetType.Enemy : FleetType.Friend;
                _dicHitType[fleetType][num] = setHitType(fleetType, num, flag, HitType.Bomb);
                HitType hitType = (!isFriend) ? _dicHitType[FleetType.Friend][num] : _dicHitType[FleetType.Enemy][num];
                if (!flag)
                {
                    if (hitType == HitType.Bomb)
                    {
                        Vector3 position  = dictionary[num].transform.position;
                        float   x         = position.x;
                        Vector3 position2 = dictionary[num].transform.position;
                        position3 = new Vector3(x, 3f, position2.z);
                        ParticleSystem val = (!((UnityEngine.Object)BattleTaskManager.GetParticleFile().explosionAerial == null)) ? UnityEngine.Object.Instantiate <ParticleSystem>(BattleTaskManager.GetParticleFile().explosionAerial) : BattleTaskManager.GetParticleFile().explosionAerial;
                        ((Component)val).SetActive(isActive: true);
                        ((Component)val).transform.parent   = BattleTaskManager.GetBattleField().transform;
                        ((Component)val).transform.position = position3;
                        _listExplosion.Add(val);
                        _listBombCritical.Add((_dicBakuraiModel[key][i].GetHitState() == BattleHitStatus.Clitical) ? true : false);
                    }
                }
                else if (hitType == HitType.Miss)
                {
                    Vector3 position4 = dictionary[num].transform.position;
                    float   fMin      = position4.x - 0.5f;
                    Vector3 position5 = dictionary[num].transform.position;
                    float   fLim      = XorRandom.GetFLim(fMin, position5.x + 0.5f);
                    Vector3 position6 = dictionary[num].transform.position;
                    float   fMin2     = position6.z - 1f;
                    Vector3 position7 = dictionary[num].transform.position;
                    float   fLim2     = XorRandom.GetFLim(fMin2, position7.z + 1f);
                    float   num2      = fLim;
                    Vector3 position8 = dictionary[num].transform.position;
                    fLim = ((!(num2 >= position8.x)) ? (fLim - 0.5f) : (fLim + 0.5f));
                    float   num3      = fLim2;
                    Vector3 position9 = dictionary[num].transform.position;
                    fLim2 = ((!(num3 >= position9.z)) ? (fLim2 - 0.5f) : (fLim2 + 0.5f));
                    ParticleSystem val2 = (!((UnityEngine.Object)BattleTaskManager.GetParticleFile().splashMiss == null)) ? UnityEngine.Object.Instantiate <ParticleSystem>(BattleTaskManager.GetParticleFile().splashMiss) : BattleTaskManager.GetParticleFile().splashMiss;
                    ((Component)val2).SetActive(isActive: true);
                    ((Component)val2).transform.parent   = BattleTaskManager.GetBattleField().transform;
                    ((Component)val2).transform.position = new Vector3(fLim, 0f, fLim2);
                    _listMiss.Add(val2);
                }
            }
        }