Exemple #1
0
 protected void PlayDamageVoice(UIBattleShip ship, DamagedStates iStates)
 {
     if (iStates != DamagedStates.Tyuuha && iStates != DamagedStates.Taiha)
     {
         ShipUtils.PlayMildCaseVoice(this._clsHougekiModel.Defender);
     }
 }
Exemple #2
0
        public void Restored(ShipModel_Defender defender)
        {
            UIBattleShip uIBattleShip = (!defender.IsFriend()) ? _dicEnemyBattleShips[defender.Index] : _dicFriendBattleShips[defender.Index];

            uIBattleShip.SetActive(isActive: true);
            uIBattleShip.Restored(defender);
        }
        private bool InitMoveCameraTo2D(object data)
        {
            BattleFieldCamera       cam                  = BattleTaskManager.GetBattleCameras().fieldCameras.get_Item(0);
            BattleShips             battleShips          = BattleTaskManager.GetBattleShips();
            ProdDetectionStartCutIn pdsc                 = ProdDetectionStartCutIn.Instantiate(BattleTaskManager.GetPrefabFile().prefabProdDetectionStartCutIn.GetComponent <ProdDetectionStartCutIn>(), BattleTaskManager.GetBattleCameras().cutInCamera.get_transform());
            ShipModel_Battle        detectionPrimaryShip = ShipUtils.GetDetectionPrimaryShip(this._clsSakuteki.planes_f, true);
            UIBattleShip            uIBattleShip         = (detectionPrimaryShip == null) ? battleShips.flagShipFriend : battleShips.dicFriendBattleShips.get_Item(detectionPrimaryShip.Index);
            Vector3 vector           = Mathe.NormalizeDirection(uIBattleShip.pointOfGaze, Vector3.get_zero()) * 30f;
            Vector3 fixChasingCamera = new Vector3(uIBattleShip.pointOfGaze.x, uIBattleShip.pointOfGaze.y, uIBattleShip.pointOfGaze.z + vector.z);

            cam.pointOfGaze = uIBattleShip.pointOfGaze;
            cam.ReqViewMode(CameraActor.ViewMode.FixChasing);
            cam.SetFixChasingCamera(fixChasingCamera);
            Vector3   endCamPos = new Vector3(uIBattleShip.pointOfGaze.x, 50f, uIBattleShip.pointOfGaze.z + vector.z * 6f);
            Transform transform = uIBattleShip.get_transform();
            Vector3   position  = BattleTaskManager.GetBattleShips().dicFriendBattleShips.get_Item(0).get_transform().get_position();

            this._psDetectionRipple = Util.Instantiate(ParticleFile.Load(ParticleFileInfos.BattlePSDetectionRipple), null, false, false).GetComponent <ParticleSystem>();
            this._psDetectionRipple.get_transform().set_parent(transform);
            this._psDetectionRipple.get_transform().set_position(new Vector3(position.x, position.y + 0.01f, position.z));
            this._psDetectionRipple.Play();
            pdsc.Play().Subscribe(delegate(bool _)
            {
                cam.get_transform().LTMove(endCamPos, 1.95f).setEase(LeanTweenType.easeInOutCubic);
                Mem.DelComponentSafe <ProdDetectionStartCutIn>(ref pdsc);
            });
            return(false);
        }
        private bool InitFriendFleetAdvent(object data)
        {
            this._dicPSClouds.get_Item(FleetType.Friend).SetActive(true);
            this._dicPSClouds.get_Item(FleetType.Friend).Play();
            BattleFieldCamera cam          = BattleTaskManager.GetBattleCameras().fieldCameras.get_Item(0);
            UIBattleShip      uIBattleShip = BattleTaskManager.GetBattleShips().dicFriendBattleShips.get_Item(0);
            Vector3           position     = BattleTaskManager.GetBattleField().dicFleetAnchor.get_Item(FleetType.Friend).get_position();

            position.y = uIBattleShip.pointOfGaze.y;
            ShipUtils.PlayBattleStartVoice(uIBattleShip.shipModel);
            cam.ReqViewMode(CameraActor.ViewMode.RotateAroundObject);
            cam.SetRotateAroundObjectCamera(position, BattleDefines.FLEET_ADVENT_START_CAM_POS.get_Item(0), -10f);
            List <float> rotDst = this.CalcCloseUpCamDist(cam.rotateDistance, 30f);

            cam.get_transform().LTValue(cam.rotateDistance, rotDst.get_Item(0), 1f).setEase(BattleDefines.FLEET_ADVENT_FLEET_CLOSEUP_EASEING_TYPE).setOnUpdate(delegate(float x)
            {
                cam.rotateDistance = x;
            }).setOnComplete(delegate
            {
                cam.get_transform().LTValue(cam.rotateDistance, rotDst.get_Item(1), 1f).setEase(BattleDefines.FLEET_ADVENT_FLEET_CLOSEUP_EASEING_TYPE).setOnUpdate(delegate(float x)
                {
                    cam.rotateDistance = x;
                }).setOnComplete(delegate
                {
                    this.EndPhase(BattleUtils.NextPhase(BattlePhase.FleetAdvent));
                });
            });
            return(false);
        }
Exemple #5
0
        protected virtual void PlayHpGaugeDamage(UIBattleShip ship, HitState iState)
        {
            BattleHitStatus status = BattleHitStatus.Normal;

            switch (iState)
            {
            case HitState.Miss:
                status = BattleHitStatus.Miss;
                break;

            case HitState.CriticalDamage:
                status = BattleHitStatus.Clitical;
                break;
            }
            if (this._clsHougekiModel != null)
            {
                UICircleHPGauge circleHPGauge = BattleTaskManager.GetPrefabFile().circleHPGauge;
                circleHPGauge.SetHPGauge(this._clsHougekiModel.Defender.MaxHp, this._clsHougekiModel.Defender.HpBefore, this._clsHougekiModel.Defender.HpAfter, this._clsHougekiModel.GetDamage(), status, this._clsHougekiModel.Defender.IsFriend());
                Vector3 damagePosition = (!this._clsHougekiModel.Defender.IsFriend()) ? new Vector3(280f, -125f, 0f) : new Vector3(-500f, -125f, 0f);
                circleHPGauge.SetDamagePosition(damagePosition);
                circleHPGauge.Play(delegate
                {
                });
            }
        }
        private bool InitFriendFleetAdvent(object data)
        {
            ((Component)_dicPSClouds[FleetType.Friend]).SetActive(isActive: true);
            _dicPSClouds[FleetType.Friend].Play();
            BattleFieldCamera cam          = BattleTaskManager.GetBattleCameras().fieldCameras[0];
            UIBattleShip      uIBattleShip = BattleTaskManager.GetBattleShips().dicFriendBattleShips[0];
            Vector3           position     = BattleTaskManager.GetBattleField().dicFleetAnchor[FleetType.Friend].position;
            Vector3           pointOfGaze  = uIBattleShip.pointOfGaze;

            position.y = pointOfGaze.y;
            ShipUtils.PlayBattleStartVoice(uIBattleShip.shipModel);
            cam.ReqViewMode(CameraActor.ViewMode.RotateAroundObject);
            cam.SetRotateAroundObjectCamera(position, BattleDefines.FLEET_ADVENT_START_CAM_POS[0], -10f);
            List <float> rotDst = CalcCloseUpCamDist(cam.rotateDistance, 30f);

            cam.transform.LTValue(cam.rotateDistance, rotDst[0], 1f).setEase(BattleDefines.FLEET_ADVENT_FLEET_CLOSEUP_EASEING_TYPE).setOnUpdate(delegate(float x)
            {
                cam.rotateDistance = x;
            })
            .setOnComplete((Action) delegate
            {
                cam.transform.LTValue(cam.rotateDistance, rotDst[1], 1f).setEase(BattleDefines.FLEET_ADVENT_FLEET_CLOSEUP_EASEING_TYPE).setOnUpdate(delegate(float x)
                {
                    cam.rotateDistance = x;
                })
                .setOnComplete((Action) delegate
                {
                    EndPhase(BattleUtils.NextPhase(BattlePhase.FleetAdvent));
                });
            });
            return(false);
        }
        private void _draw()
        {
            TargetObject = GameObject.Find("/BattleTaskManager/Stage/BattleField/FriendFleetAnchor/吹雪/ShipTexture/Object3D");
            to           = GameObject.Find("/BattleTaskManager/Stage/BattleField/FriendFleetAnchor/吹雪").GetComponent <UIBattleShip>();
            ShipOffset   = Resources.Load <mst_shipgraphbattle>("Data/mst_shipgraphbattle");
            if (!isDamaged)
            {
                offsetX   = ShipOffset.param[NowShip].foot_x;
                offsetY   = ShipOffset.param[NowShip].foot_y;
                ShipState = 9;
            }
            else
            {
                offsetX   = ShipOffset.param[NowShip].foot_d_x;
                offsetY   = ShipOffset.param[NowShip].foot_d_y;
                ShipState = 10;
            }
            TargetObject.transform.localPosition = new Vector3(offsetX, offsetY, 0f);
            Debug.Log("ShipNo: " + NowShip + " /ShipState =" + ShipState + "  offset(x,y)=" + offsetX + "," + offsetY);
            to.object3D.mainTexture = SingletonMonoBehaviour <ResourceManager> .Instance.ShipTexture.Load(NowShip, ShipState);

            if (to.object3D.mainTexture == null)
            {
                Debug.Log("Null Texture.");
            }
            to.object3D.MakePixelPerfect();
        }
Exemple #8
0
        public static UIBattleShip Instantiate(UIBattleShip prefab, Transform parent)
        {
            UIBattleShip uIBattleShip = UnityEngine.Object.Instantiate(prefab);

            uIBattleShip.transform.parent = parent;
            uIBattleShip.Init();
            return(uIBattleShip);
        }
Exemple #9
0
        public static UIBattleShip Instantiate(UIBattleShip prefab, Transform parent)
        {
            UIBattleShip uIBattleShip = Object.Instantiate <UIBattleShip>(prefab);

            uIBattleShip.get_transform().set_parent(parent);
            uIBattleShip.Init();
            return(uIBattleShip);
        }
Exemple #10
0
 protected virtual void PlayShipAnimation(UIBattleShip ship, UIBattleShip.AnimationName iName, float delay)
 {
     Observable.Timer(TimeSpan.FromSeconds((double)delay)).Subscribe(delegate(long _)
     {
         SoundUtils.PlayShellingSE(this._listBattleShips.get_Item(0).shipModel);
         ShipUtils.PlayShellingVoive(ship.shipModel);
         ship.PlayShipAnimation(iName);
     });
 }
 protected virtual void PlayShipAnimation(UIBattleShip ship, UIBattleShip.AnimationName iName, float delay)
 {
     Observable.Timer(TimeSpan.FromSeconds(delay)).Subscribe(delegate
     {
         SoundUtils.PlayShellingSE(_listBattleShips[0].shipModel);
         ShipUtils.PlayShellingVoive(ship.shipModel);
         ship.PlayShipAnimation(iName);
     });
 }
Exemple #12
0
        protected virtual void PlayDefenderGard(UIBattleShip ship, Vector3 defenderPos, BattleFieldCamera fieldCamera)
        {
            ParticleSystem explosionB3WhiteSmoke = BattleTaskManager.GetParticleFile().explosionB3WhiteSmoke;

            explosionB3WhiteSmoke.get_transform().set_parent(this.particleParent);
            explosionB3WhiteSmoke.SetLayer(Generics.Layers.UnRefrectEffects.IntLayer(), true);
            explosionB3WhiteSmoke.get_transform().set_position(Vector3.Lerp(fieldCamera.get_transform().get_position(), defenderPos, 0.9f));
            explosionB3WhiteSmoke.SetActive(true);
            explosionB3WhiteSmoke.Play();
            SoundUtils.PlayDamageSE(HitState.Gard, false);
            this.PlayDamageVoice(ship, this._clsHougekiModel.Defender.DamageEventAfter);
            this.PlayHpGaugeDamage(ship, this.hitState);
            fieldCamera.cameraShake.ShakeRot(null);
        }
Exemple #13
0
        protected virtual void PlayDefenderMiss(UIBattleShip ship, Vector3 defenderPos, BattleFieldCamera fieldCamera)
        {
            SoundUtils.PlayDamageSE(HitState.Miss, false);
            ParticleSystem splashMiss = BattleTaskManager.GetParticleFile().splashMiss;

            splashMiss.get_transform().set_parent(this.particleParent);
            splashMiss.SetLayer(Generics.Layers.UnRefrectEffects.IntLayer(), true);
            splashMiss.get_transform().set_position(Vector3.Lerp(fieldCamera.get_transform().get_position(), defenderPos, 1f));
            splashMiss.get_transform().positionY(0f);
            splashMiss.get_transform().set_localPosition(new Vector3(splashMiss.get_transform().get_localPosition().x, splashMiss.get_transform().get_localPosition().y, (!ship.shipModel.IsFriend()) ? -15f : 15f));
            splashMiss.SetActive(true);
            splashMiss.Play();
            this.PlayHpGaugeDamage(ship, this.hitState);
        }
        protected virtual void PlayDefenderGard(UIBattleShip ship, Vector3 defenderPos, BattleFieldCamera fieldCamera)
        {
            ParticleSystem explosionB3WhiteSmoke = BattleTaskManager.GetParticleFile().explosionB3WhiteSmoke;

            ((Component)explosionB3WhiteSmoke).transform.parent = particleParent;
            ((Component)explosionB3WhiteSmoke).SetLayer(Generics.Layers.UnRefrectEffects.IntLayer(), includeChildren: true);
            ((Component)explosionB3WhiteSmoke).transform.position = Vector3.Lerp(fieldCamera.transform.position, defenderPos, 0.9f);
            ((Component)explosionB3WhiteSmoke).SetActive(isActive: true);
            explosionB3WhiteSmoke.Play();
            SoundUtils.PlayDamageSE(HitState.Gard, isTorpedo: false);
            PlayDamageVoice(ship, _clsHougekiModel.Defender.DamageEventAfter);
            PlayHpGaugeDamage(ship, hitState);
            fieldCamera.cameraShake.ShakeRot(null);
        }
        protected virtual void PlayDefenderMiss(UIBattleShip ship, Vector3 defenderPos, BattleFieldCamera fieldCamera)
        {
            SoundUtils.PlayDamageSE(HitState.Miss, isTorpedo: false);
            ParticleSystem splashMiss = BattleTaskManager.GetParticleFile().splashMiss;

            ((Component)splashMiss).transform.parent = particleParent;
            ((Component)splashMiss).SetLayer(Generics.Layers.UnRefrectEffects.IntLayer(), includeChildren: true);
            ((Component)splashMiss).transform.position = Vector3.Lerp(fieldCamera.transform.position, defenderPos, 1f);
            ((Component)splashMiss).transform.positionY();
            Transform transform      = ((Component)splashMiss).transform;
            Vector3   localPosition  = ((Component)splashMiss).transform.localPosition;
            float     x              = localPosition.x;
            Vector3   localPosition2 = ((Component)splashMiss).transform.localPosition;

            transform.localPosition = new Vector3(x, localPosition2.y, (!ship.shipModel.IsFriend()) ? (-15f) : 15f);
            ((Component)splashMiss).SetActive(isActive: true);
            splashMiss.Play();
            PlayHpGaugeDamage(ship, hitState);
        }
Exemple #16
0
 public bool Init(BattleManager manager)
 {
     if (manager == null)
     {
         return(false);
     }
     _traFriendFleetAnchor = GameObject.Find("FriendFleetAnchor").transform;
     _traEnemyFleetAnchor  = GameObject.Find("EnemyFleetAnchor").transform;
     _dicFriendBattleShips = new Dictionary <int, UIBattleShip>();
     _dicEnemyBattleShips  = new Dictionary <int, UIBattleShip>();
     UniRx.IObservable <Unit> source = Observable.FromCoroutine(() => CreateBattleShips(manager.Ships_f, manager.FormationId_f, _traFriendFleetAnchor.gameObject, _dicFriendBattleShips, FleetType.Friend, manager.ShipCount_f, 0));
     UniRx.IObservable <Unit> other  = Observable.FromCoroutine(() => CreateBattleShips(manager.Ships_e, manager.FormationId_e, _traEnemyFleetAnchor.gameObject, _dicEnemyBattleShips, FleetType.Enemy, manager.ShipCount_e, 0));
     source.SelectMany(other).Subscribe(delegate
     {
         _uiOriginalShip = null;
         _isInitialize   = true;
     });
     return(true);
 }
Exemple #17
0
        private bool InitSearchNFlare(object data)
        {
            BattleCameras     battleCameras     = BattleTaskManager.GetBattleCameras();
            BattleFieldCamera battleFieldCamera = battleCameras.fieldCameras[0];

            battleFieldCamera.flareLayer.enabled = true;
            bool flag  = (_clsNightCombat.GetSearchLightShip(is_friend: true) != null) ? true : false;
            bool flag2 = (_clsNightCombat.GetFlareShip(is_friend: true) != null) ? true : false;

            if (flag || flag2)
            {
                if (_prodNightRadarDeployment != null)
                {
                    _prodNightRadarDeployment.RadarObjectConvergence();
                }
                Mem.DelComponentSafe(ref _prodNightRadarDeployment);
                ObserverActionQueue observerAction = BattleTaskManager.GetObserverAction();
                observerAction.Executions();
                BattleTaskManager.GetBattleShips().SetStandingPosition(StandingPositionType.OneRow);
                battleFieldCamera.ReqViewMode(CameraActor.ViewMode.Fix);
                battleFieldCamera.transform.position = _vCameraOriginPos;
                battleFieldCamera.transform.rotation = Quaternion.identity;
                ShipModel_BattleAll shipModel_BattleAll = (!flag) ? _clsNightCombat.GetFlareShip(is_friend: true) : _clsNightCombat.GetSearchLightShip(is_friend: true);
                if (shipModel_BattleAll != null)
                {
                    BattleField  battleField  = BattleTaskManager.GetBattleField();
                    UIBattleShip uIBattleShip = BattleTaskManager.GetBattleShips().dicFriendBattleShips[shipModel_BattleAll.Index];
                    Vector3      position     = uIBattleShip.transform.position;
                    float        x            = 0f - position.x;
                    battleField.dicFleetAnchor[FleetType.Friend].transform.AddPosX(x);
                    battleFieldCamera.transform.AddPosX(x);
                }
            }
            SearchLight_FlareBullet_PlayAnimation().Subscribe(delegate
            {
                OnSearchNFlareFinished();
            });
            return(false);
        }
Exemple #18
0
        private bool InitSearchNFlare(object data)
        {
            BattleCameras     battleCameras     = BattleTaskManager.GetBattleCameras();
            BattleFieldCamera battleFieldCamera = battleCameras.fieldCameras.get_Item(0);

            battleFieldCamera.flareLayer.set_enabled(true);
            bool searchLightShip = this._clsNightCombat.GetSearchLightShip(true) != null;
            bool flareShip       = this._clsNightCombat.GetFlareShip(true) != null;

            if (searchLightShip || flareShip)
            {
                if (this._prodNightRadarDeployment != null)
                {
                    this._prodNightRadarDeployment.RadarObjectConvergence();
                }
                Mem.DelComponentSafe <ProdNightRadarDeployment>(ref this._prodNightRadarDeployment);
                ObserverActionQueue observerAction = BattleTaskManager.GetObserverAction();
                observerAction.Executions();
                BattleTaskManager.GetBattleShips().SetStandingPosition(StandingPositionType.OneRow);
                battleFieldCamera.ReqViewMode(CameraActor.ViewMode.Fix);
                battleFieldCamera.get_transform().set_position(this._vCameraOriginPos);
                battleFieldCamera.get_transform().set_rotation(Quaternion.get_identity());
                ShipModel_BattleAll shipModel_BattleAll = (!searchLightShip) ? this._clsNightCombat.GetFlareShip(true) : this._clsNightCombat.GetSearchLightShip(true);
                if (shipModel_BattleAll != null)
                {
                    BattleField  battleField  = BattleTaskManager.GetBattleField();
                    UIBattleShip uIBattleShip = BattleTaskManager.GetBattleShips().dicFriendBattleShips.get_Item(shipModel_BattleAll.Index);
                    float        x            = -uIBattleShip.get_transform().get_position().x;
                    battleField.dicFleetAnchor.get_Item(FleetType.Friend).get_transform().AddPosX(x);
                    battleFieldCamera.get_transform().AddPosX(x);
                }
            }
            this.SearchLight_FlareBullet_PlayAnimation().Subscribe(delegate(int _)
            {
                this.OnSearchNFlareFinished();
            });
            return(false);
        }
        private void _draw()
        {
            this.TargetObject = GameObject.Find("/BattleTaskManager/Stage/BattleField/FriendFleetAnchor/吹雪/ShipTexture/Object3D");
            this.to           = GameObject.Find("/BattleTaskManager/Stage/BattleField/FriendFleetAnchor/吹雪").GetComponent <UIBattleShip>();
            this.ShipOffset   = Resources.Load <mst_shipgraphbattle>("Data/mst_shipgraphbattle");
            if (!this.isDamaged)
            {
                this.offsetX   = (float)this.ShipOffset.param.get_Item(this.NowShip).foot_x;
                this.offsetY   = (float)this.ShipOffset.param.get_Item(this.NowShip).foot_y;
                this.ShipState = 9;
            }
            else
            {
                this.offsetX   = (float)this.ShipOffset.param.get_Item(this.NowShip).foot_d_x;
                this.offsetY   = (float)this.ShipOffset.param.get_Item(this.NowShip).foot_d_y;
                this.ShipState = 10;
            }
            this.TargetObject.get_transform().set_localPosition(new Vector3(this.offsetX, this.offsetY, 0f));
            Debug.Log(string.Concat(new object[]
            {
                "ShipNo: ",
                this.NowShip,
                " /ShipState =",
                this.ShipState,
                "  offset(x,y)=",
                this.offsetX,
                ",",
                this.offsetY
            }));
            this.to.object3D.mainTexture = SingletonMonoBehaviour <ResourceManager> .Instance.ShipTexture.Load(this.NowShip, this.ShipState);

            if (this.to.object3D.mainTexture == null)
            {
                Debug.Log("Null Texture.");
            }
            this.to.object3D.MakePixelPerfect();
        }
Exemple #20
0
        private bool InitMoveCameraTo2D(object data)
        {
            BattleFieldCamera       cam                  = BattleTaskManager.GetBattleCameras().fieldCameras[0];
            BattleShips             battleShips          = BattleTaskManager.GetBattleShips();
            ProdDetectionStartCutIn pdsc                 = ProdDetectionStartCutIn.Instantiate(((Component)BattleTaskManager.GetPrefabFile().prefabProdDetectionStartCutIn).GetComponent <ProdDetectionStartCutIn>(), BattleTaskManager.GetBattleCameras().cutInCamera.transform);
            ShipModel_Battle        detectionPrimaryShip = ShipUtils.GetDetectionPrimaryShip(_clsSakuteki.planes_f, isFriend: true);
            UIBattleShip            uIBattleShip         = (detectionPrimaryShip == null) ? battleShips.flagShipFriend : battleShips.dicFriendBattleShips[detectionPrimaryShip.Index];
            Vector3 vector           = Mathe.NormalizeDirection(uIBattleShip.pointOfGaze, Vector3.zero) * 30f;
            Vector3 pointOfGaze      = uIBattleShip.pointOfGaze;
            float   x                = pointOfGaze.x;
            Vector3 pointOfGaze2     = uIBattleShip.pointOfGaze;
            float   y                = pointOfGaze2.y;
            Vector3 pointOfGaze3     = uIBattleShip.pointOfGaze;
            Vector3 fixChasingCamera = new Vector3(x, y, pointOfGaze3.z + vector.z);

            cam.pointOfGaze = uIBattleShip.pointOfGaze;
            cam.ReqViewMode(CameraActor.ViewMode.FixChasing);
            cam.SetFixChasingCamera(fixChasingCamera);
            Vector3   pointOfGaze4 = uIBattleShip.pointOfGaze;
            float     x2           = pointOfGaze4.x;
            Vector3   pointOfGaze5 = uIBattleShip.pointOfGaze;
            Vector3   endCamPos    = new Vector3(x2, 50f, pointOfGaze5.z + vector.z * 6f);
            Transform transform    = uIBattleShip.transform;
            Vector3   position     = BattleTaskManager.GetBattleShips().dicFriendBattleShips[0].transform.position;

            _psDetectionRipple = Util.Instantiate(ParticleFile.Load(ParticleFileInfos.BattlePSDetectionRipple)).GetComponent <ParticleSystem>();
            ((Component)_psDetectionRipple).transform.parent   = transform;
            ((Component)_psDetectionRipple).transform.position = new Vector3(position.x, position.y + 0.01f, position.z);
            _psDetectionRipple.Play();
            pdsc.Play().Subscribe(delegate
            {
                cam.transform.LTMove(endCamPos, 1.95f).setEase(LeanTweenType.easeInOutCubic);
                Mem.DelComponentSafe(ref pdsc);
            });
            return(false);
        }
Exemple #21
0
        protected void PlayDefenderEffect(UIBattleShip ship, Vector3 defenderPos, BattleFieldCamera fieldCamera, float delay)
        {
            Observable.Timer(TimeSpan.FromSeconds((double)delay)).Subscribe(delegate(long _)
            {
                switch (this.hitState)
                {
                case HitState.Miss:
                    this.PlayDefenderMiss(ship, defenderPos, fieldCamera);
                    break;

                case HitState.Gard:
                    this.PlayDefenderGard(ship, defenderPos, fieldCamera);
                    break;

                case HitState.NomalDamage:
                    this.PlayDefenderNormal(ship, defenderPos, fieldCamera);
                    break;

                case HitState.CriticalDamage:
                    this.PlayDefenderCritical(ship, defenderPos, fieldCamera);
                    break;
                }
            });
        }
Exemple #22
0
 public BattleShips()
 {
     this._uiOriginalShip = BattleTaskManager.GetPrefabFile().prefabBattleShip.GetComponent <UIBattleShip>();
     this._isInitialize   = false;
     this._isMakeRadar    = false;
 }
Exemple #23
0
        private IEnumerator CreateBattleShips(ShipModel_BattleAll[] ships, BattleFormationKinds1 iKind, GameObject parent, Dictionary <int, UIBattleShip> dic, FleetType iType, int fleetNum, int combineNum)
        {
            BattleFieldCamera cam = BattleTaskManager.GetBattleCameras().fieldCameras[0];

            Vector3[] formationPos = BattleDefines.FORMATION_POSITION[iKind][fleetNum];
            Vector3[] oneRowPos    = BattleDefines.FORMATION_POSITION[BattleFormationKinds1.TanOu][fleetNum];
            int       index        = 0;

            foreach (ShipModel_BattleAll model in ships)
            {
                if (model == null)
                {
                    continue;
                }
                UIBattleShip ship;
                if (_traFriendFleetAnchor.transform.FindChild(string.Format("{1}FleetAnchor/BattleShip{0}", index + 1, iType)) != null)
                {
                    ship = ((Component)_traFriendFleetAnchor.transform.FindChild(string.Format("{1}FleetAnchor/BattleShip{0}", index + 1, iType))).GetComponent <UIBattleShip>();
                }
                else
                {
                    ship      = UIBattleShip.Instantiate(_uiOriginalShip.GetComponent <UIBattleShip>(), parent.transform);
                    ship.name = $"BattleShip{model.Index}";
                    Vector3 pos;
                    Vector3 lPos;
                    Vector3 commandBufferPos;
                    Vector3 advancePos;
                    if (index < formationPos.Length)
                    {
                        pos              = ((iType != 0) ? (-formationPos[index] * 1f) : (formationPos[index] * 1f));
                        lPos             = oneRowPos[index] * 1f;
                        commandBufferPos = ((iType != 0) ? (-formationPos[index] * 4f) : (formationPos[index] * 4f));
                        advancePos       = ((iType != 0) ? (lPos + Vector3.forward * 5f) : (lPos + Vector3.back * 5f));
                    }
                    else
                    {
                        pos              = Vector3.zero;
                        lPos             = Vector3.zero;
                        commandBufferPos = Vector3.zero;
                        advancePos       = Vector3.zero;
                    }
                    ship.transform.localPosition = lPos;
                    ship.dicStandingPos[StandingPositionType.Formation]     = pos;
                    ship.dicStandingPos[StandingPositionType.OneRow]        = lPos;
                    ship.dicStandingPos[StandingPositionType.CommandBuffer] = commandBufferPos;
                    ship.dicStandingPos[StandingPositionType.Advance]       = advancePos;
                    ship.billboard.billboardTarget          = cam.transform;
                    ship.billboard.isBillboard              = true;
                    ship.billboard.isEnableVerticalRotation = false;
                    ship.drawType = ShipDrawType.Normal;
                }
                dic.Add(index, ship);
                dic[index].SetShipInfos(model, isStart: true);
                if (model.IsEscape())
                {
                    dic[index].SetActive(isActive: false);
                }
                index++;
                yield return(null);
            }
            yield return(null);
        }
Exemple #24
0
 public BattleShips()
 {
     _uiOriginalShip = ((Component)BattleTaskManager.GetPrefabFile().prefabBattleShip).GetComponent <UIBattleShip>();
     _isInitialize   = false;
     _isMakeRadar    = false;
 }