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); }
public static ProdTorpedoProtect Instantiate(ProdTorpedoProtect prefab, Transform parent) { ProdTorpedoProtect prodTorpedoProtect = UnityEngine.Object.Instantiate(prefab); prodTorpedoProtect.transform.parent = parent; prodTorpedoProtect.transform.localPosition = Vector3.zero; prodTorpedoProtect.transform.localScale = Vector3.one; prodTorpedoProtect._init(); return(prodTorpedoProtect); }
public static ProdTorpedoProtect Instantiate(ProdTorpedoProtect prefab, Transform parent) { ProdTorpedoProtect prodTorpedoProtect = Object.Instantiate <ProdTorpedoProtect>(prefab); prodTorpedoProtect.get_transform().set_parent(parent); prodTorpedoProtect.get_transform().set_localPosition(Vector3.get_zero()); prodTorpedoProtect.get_transform().set_localScale(Vector3.get_one()); prodTorpedoProtect._init(); return(prodTorpedoProtect); }
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); }
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); }