private void _createAircraft(Dictionary <int, UIBattleShip> ships, FleetType type, GameObject[] objects) { int num = (type != 0) ? 1 : 0; int num2 = (type == FleetType.Friend) ? 1 : 0; for (int i = 0; i < ships.Count; i++) { if (!(ships[i] != null) || ships[i].shipModel == null) { continue; } PlaneModelBase[] plane = _clsKoukuu.GetPlane(ships[i].shipModel.TmpId); if (plane == null) { continue; } for (int j = 0; j < plane.Length; j++) { if (plane[j] != null) { _listAircraft.Add(_instantiateAircraft(objects[num].transform, i, plane[j], type)); if (_iType == CutInType.Both) { _listAircraft.Add(_instantiateAircraft(objects[num2].transform, i, plane[j], type)); } break; } } } }
private void _setAircraftTexture(bool isFriend) { if (_koukuuModel.GetCaptainShip(isFriend) == null) { return; } PlaneModelBase[] plane = _koukuuModel.GetPlane(_koukuuModel.GetCaptainShip(isFriend).TmpId); if (plane == null) { return; } for (int i = 0; i < plane.Length && i < 3; i++) { if (plane[i] != null) { if (!isFriend && BattleTaskManager.GetBattleManager() is PracticeBattleManager) { _uiAirObj[i].transform.localPosition = new Vector3(267f, 176f, 0f); _uiAirObj[i].transform.localScale = Vector3.one; _uiAircraft[i].mainTexture = SingletonMonoBehaviour <ResourceManager> .Instance.SlotItemTexture.Load(plane[i].MstId, 6); _uiAirObj[i].transform.localEulerAngles = new Vector3(0f, 0f, -25.5f); _uiAircraft[i].flip = UIBasicSprite.Flip.Nothing; continue; } _uiAirObj[i].transform.localPosition = new Vector3(267f, 176f, 0f); _uiAircraft[i].mainTexture = ((!isFriend) ? KCV.Battle.Utils.SlotItemUtils.LoadTexture(plane[i]) : SingletonMonoBehaviour <ResourceManager> .Instance.SlotItemTexture.Load(plane[i].MstId, 6)); _uiAirObj[i].transform.localEulerAngles = ((!isFriend) ? Vector3.zero : new Vector3(0f, 0f, -25.5f)); if (!isFriend) { _uiAircraft[i].MakePixelPerfect(); _uiAirObj[i].transform.localScale = ((plane[i].MstId < 500) ? Vector3.one : new Vector3(0.8f, 0.8f, 0.8f)); AircraftOffsetInfo aircraftOffsetInfo = KCV.Battle.Utils.SlotItemUtils.GetAircraftOffsetInfo(plane[i].MstId); _uiAircraft[i].flip = ((!aircraftOffsetInfo.isFlipHorizontal) ? UIBasicSprite.Flip.Horizontally : UIBasicSprite.Flip.Nothing); } } else { _uiAircraft[i].mainTexture = null; } } }
private void _setAircraftTexture(FleetType type) { switch (type) { case FleetType.Friend: { if (_koukuuModel.GetCaptainShip(is_friend: true) == null) { break; } PlaneModelBase[] plane = _koukuuModel.GetPlane(_koukuuModel.GetCaptainShip(is_friend: true).TmpId); if (plane == null) { break; } for (int j = 0; j < plane.Length && j < 3; j++) { if (plane[j] != null) { _uiAirObj[j].transform.localPosition = new Vector3(267f, 176f, 0f); _uiAircraft[j].mainTexture = SingletonMonoBehaviour <ResourceManager> .Instance.SlotItemTexture.Load(plane[j].MstId, 6); _uiAirObj[j].transform.localEulerAngles = new Vector3(0f, 0f, -25.5f); KCV.Battle.Utils.SlotItemUtils.GetAircraftOffsetInfo(plane[j].MstId); } else { _uiAircraft[j].mainTexture = null; } } break; } case FleetType.Enemy: { if (_koukuuModel.GetCaptainShip(is_friend: false) == null) { break; } PlaneModelBase[] plane = _koukuuModel.GetPlane(_koukuuModel.GetCaptainShip(is_friend: false).TmpId); if (plane == null) { break; } for (int i = 0; i < plane.Length && i < 3; i++) { if (plane[i] != null) { if (BattleTaskManager.GetBattleManager() is PracticeBattleManager) { _uiAircraft[i].mainTexture = SingletonMonoBehaviour <ResourceManager> .Instance.SlotItemTexture.Load(plane[i].MstId, 6); continue; } _uiAirObj[i].transform.localPosition = new Vector3(267f, 176f, 0f); _uiAircraft[i].mainTexture = KCV.Battle.Utils.SlotItemUtils.LoadTexture(plane[i]); _uiAircraft[i].MakePixelPerfect(); _uiAirObj[i].transform.localEulerAngles = Vector3.zero; if (KCV.Battle.Utils.SlotItemUtils.GetAircraftOffsetInfo(plane[i].MstId).isFlipHorizontal) { _uiAircraft[i].flip = UIBasicSprite.Flip.Nothing; } else { _uiAircraft[i].flip = UIBasicSprite.Flip.Horizontally; } } else { _uiAircraft[i].mainTexture = null; } } break; } } }