Пример #1
0
 private static CutInType _chkCutInType(KoukuuModel model)
 {
     if (model.GetCaptainShip(is_friend: true) != null && model.GetCaptainShip(is_friend: false) != null)
     {
         return(CutInType.Both);
     }
     if (model.GetCaptainShip(is_friend: true) != null)
     {
         return(CutInType.FriendOnly);
     }
     return(CutInType.EnemyOnly);
 }
        private bool _initAerialSecondCutIn(object data)
        {
            BattleCameras     battleCameras = BattleTaskManager.GetBattleCameras();
            BattleCutInCamera cutInCamera   = battleCameras.cutInCamera;

            cutInCamera.isCulling = true;
            _prodAerialSecondP1   = ProdAerialCombatP1.Instantiate(iType: (_clsKoukuu2.GetCaptainShip(is_friend: true) != null && _clsKoukuu2.GetCaptainShip(is_friend: false) != null) ? CutInType.Both : ((_clsKoukuu2.GetCaptainShip(is_friend: true) == null) ? CutInType.EnemyOnly : CutInType.FriendOnly), prefab: PrefabFile.Load <ProdAerialCombatP1>(PrefabFileInfos.BattleProdAerialCombatP1), model: _clsKoukuu2, parent: cutInCamera.transform.parent);
            _prodAerialSecondP1.gameObject.SetActive(false);
            _prodAerialSecondP2 = ProdAerialCombatP2.Instantiate(PrefabFile.Load <ProdAerialCombatP2>(PrefabFileInfos.BattleProdAerialCombatP2), _clsKoukuu2, cutInCamera.transform);
            _prodAerialSecondP2.CreateHpGauge(FleetType.Friend);
            _prodAerialSecondP2.gameObject.SetActive(false);
            _onAerialSecondCutInFinished();
            return(false);
        }
Пример #3
0
        private void _setShipTexture(bool isFriend)
        {
            ShipModel_Attacker shipModel_Attacker = (_koukuuModel.GetCaptainShip(isFriend) == null) ? null : _koukuuModel.GetCaptainShip(isFriend);

            if (shipModel_Attacker != null)
            {
                _uiShip.mainTexture = KCV.Battle.Utils.ShipUtils.LoadTexture(shipModel_Attacker);
                _uiShip.MakePixelPerfect();
                _uiShip.flip = ((!isFriend) ? UIBasicSprite.Flip.Horizontally : UIBasicSprite.Flip.Nothing);
                Vector3 shipOffsPos = KCV.Battle.Utils.ShipUtils.GetShipOffsPos(shipModel_Attacker, shipModel_Attacker.DamagedFlg, MstShipGraphColumn.CutInSp1);
                _uiShip.transform.localPosition = ((!isFriend) ? new Vector3(shipOffsPos.x * -1f, shipOffsPos.y, shipOffsPos.z) : shipOffsPos);
            }
            else
            {
                _uiShip.mainTexture = null;
            }
        }
Пример #4
0
        private void _setShipTexture(FleetType type)
        {
            switch (type)
            {
            case FleetType.Friend:
            {
                List <ShipModel_Attacker> list2 = (_koukuuModel.GetCaptainShip(is_friend: true) == null) ? null : _koukuuModel.GetAttackers(is_friend: true);
                if (list2 != null)
                {
                    _uiShip[0].mainTexture = KCV.Battle.Utils.ShipUtils.LoadTexture(list2[0]);
                    _uiShip[0].MakePixelPerfect();
                    _uiShip[0].transform.localPosition = KCV.Battle.Utils.ShipUtils.GetShipOffsPos(list2[0], MstShipGraphColumn.CutInSp1);
                    if (list2.Count >= 2)
                    {
                        _uiShip[1].mainTexture = KCV.Battle.Utils.ShipUtils.LoadTexture(list2[1]);
                        _uiShip[1].MakePixelPerfect();
                        _uiShip[1].transform.localPosition = KCV.Battle.Utils.ShipUtils.GetShipOffsPos(list2[1], MstShipGraphColumn.CutInSp1);
                    }
                    else
                    {
                        _uiShip[1].mainTexture = null;
                    }
                }
                else
                {
                    _uiShip[0].mainTexture = null;
                    _uiShip[1].mainTexture = null;
                }
                break;
            }

            case FleetType.Enemy:
            {
                List <ShipModel_Attacker> list = (_koukuuModel.GetCaptainShip(is_friend: false) == null) ? null : _koukuuModel.GetAttackers(is_friend: false);
                if (list != null)
                {
                    _uiShip[0].mainTexture = KCV.Battle.Utils.ShipUtils.LoadTexture(list[0]);
                    _uiShip[0].MakePixelPerfect();
                    _uiShip[0].flip = UIBasicSprite.Flip.Horizontally;
                    Vector3 shipOffsPos = KCV.Battle.Utils.ShipUtils.GetShipOffsPos(list[0], MstShipGraphColumn.CutInSp1);
                    _uiShip[0].transform.localPosition = new Vector3(shipOffsPos.x * -1f, shipOffsPos.y, shipOffsPos.z);
                    if (list.Count >= 2)
                    {
                        _uiShip[1].mainTexture = KCV.Battle.Utils.ShipUtils.LoadTexture(list[1]);
                        _uiShip[1].MakePixelPerfect();
                        _uiShip[1].flip = UIBasicSprite.Flip.Horizontally;
                        Vector3 shipOffsPos2 = KCV.Battle.Utils.ShipUtils.GetShipOffsPos(list[1], MstShipGraphColumn.CutInSp1);
                        _uiShip[1].transform.localPosition = new Vector3(shipOffsPos2.x * -1f, shipOffsPos2.y, shipOffsPos2.z);
                    }
                    else
                    {
                        _uiShip[1].mainTexture = null;
                    }
                }
                else
                {
                    _uiShip[0].mainTexture = null;
                    _uiShip[1].mainTexture = null;
                }
                break;
            }
            }
        }