public override void DestroyBehaviour() { m_bNetAnswer = false; m_PathPos.Release(); m_GotoBtn.onClick.RemoveAllListeners(); if (m_AssetRes != null) { m_AssetRes.destroy(); m_AssetRes = null; } DestroyPathPoint(); DestroyPoint(); MonsterTipsTrigger.onPointerDown -= LostMonsterTips; Game.GetInstance().SubscribeNetNotify(NetMsg.MSG_TEAM_MEMBER_POS, UpdateTeam); ClientEventMgr.Instance.UnsubscribeClientEvent((int)ClientEvent.TASK_CHANGED, UpdateNpcState); ClientEventMgr.Instance.UnsubscribeClientEvent((int)ClientEvent.CE_TEAM_INFO_CHANGED, UpdateRequsetTeam); ClientEventMgr.Instance.UnsubscribeClientEvent((int)ClientEvent.NEW_MINIMAP_SELECT_MONSTER_MINIMAPINFO, MonsterSelectChange); ClientEventMgr.Instance.UnsubscribeClientEvent((int)ClientEvent.CE_MINI_MAP_COM_POS, ClickMiniMapPos); ClientEventMgr.Instance.UnsubscribeClientEvent((int)ClientEvent.CE_ACTOR_PATH_POINTS_CHANGED, OnWalkPathChange); ClientEventMgr.Instance.UnsubscribeClientEvent((int)xc.ClientEvent.CE_WORLD_BOSS_UPDATE_BOSS_INFO_ALL, UpdateWorldBossState); m_PathPoints.Clear(); base.DestroyBehaviour(); }
public float colliderSize; // Rail collider area (xyz) // Initialize the size of the rail by iterating through the waypoints void Start() { this.gameObject.tag = "Rail"; // Makes this object a Rail (for the lazy) int i; for (i = 0; i < this.transform.childCount; i++) { arrayRWP.Add(this.transform.GetChild(i).position); // Add child to the list iteratively //this.transform.GetChild(i).gameObject.AddComponent() if (i < this.transform.childCount - 1) { rldists.Add(Vector3.Distance(this.transform.GetChild(i).position, this.transform.GetChild(i + 1).position)); arrayRvec.Add(this.transform.GetChild(i + 1).position - this.transform.GetChild(i).position); } } railpos = arrayRWP.ToArray(); // Convert the list into a vector array arrayRWP.Release(); rdists = rldists.ToArray(); rldists.Release(); railvecs = arrayRvec.ToArray(); arrayRvec.Release(); for (i = 0; i < this.transform.childCount - 1; i++) { makeColliders(i); } }
public void Destroy() { // Go through both lists and destroy everything for (int i = 0; i < despawned.size; ++i) { if (despawned[i] != null) { GameObject.Destroy(despawned[i]); despawned[i] = null; } } for (int i = 0; i < spawned.size; ++i) { if (spawned[i] != null) { GameObject.Destroy(spawned[i]); spawned[i] = null; } } spawned.Release(); despawned.Release(); this.prefab = null; this.spawnPool = null; BundleLoaderManager.Instance.UnloadAssetBundle(nBundleId, false); }
void Awake() { delBtn = transform.Find("DelButton").gameObject; mailScrollView = transform.Find("Outline/mailScrollView").gameObject; markedBtn = transform.Find("MarkedButton").gameObject; progressBar = transform.Find("Outline/ProgressBar").gameObject; UIEventListener.Get(delBtn).onClick = OnDelCliked; markedList.Release(); updateMailTime = 10; EventDelegate.Add(progressBar.GetComponent <UIProgressBar> ().onChange, OnProgressChanged); InitMailBoxList(); }
public void ClearStocks() { int i = 0; for (int size = stocks.size; i < size; i++) { if (stocks[i].instantiatedObject != null) { Object.DestroyImmediate(stocks[i].instantiatedObject); } } stocks.Release(); }
private void UnloadAsync() { if (mLoadingReqs != null) { mLoadingReqs.Release(); mLoadingReqs = null; } if (mDependItemPool != null) { mDependItemPool.UnLoadAll(); mDependItemPool = null; } }
public void Destroy() { RecycleState(); if (mMachine != null) { mMachine.Destroy(); ObjCachePoolMgr.Instance.RecycleCSharpObject(mMachine, ObjCachePoolType.MACHINE, mMachinePoolKey); mMachine = null; } mDestList.Release(); }
/// <summary> /// Destroy all draw calls we've created when this script gets disabled. /// </summary> void OnDisable() { for (int i = mDrawCalls.size; i > 0;) { UIDrawCall dc = mDrawCalls.buffer[--i]; if (dc != null) { NGUITools.DestroyImmediate(dc.gameObject); } } mDrawCalls.Release(); mChanged.Release(); #if OLD_UNITY mChildren.Clear(); #endif }
void OnDestroy() { if (m_MeshRenderers != null) { for (var i = m_MeshRenderers.size - 1; i >= 0; i--) { Destroy(m_MeshRenderers[i].material); } } m_MeshRenderers.Release(); m_MeshRenderers = null; if (m_SpriteManager != null) { m_SpriteManager.Release(); } }
private void OnDestroy() { //Debug.Log("<color=yellow> SpawnPool.OnDestroy: " + loadType + "</color>"); if (prefabPools != null) { prefabPools.Release(); prefabPools = null; } if (m_DelayDespawnCache != null) { m_DelayDespawnCache.Release(); m_DelayDespawnCache = null; } if (m_Removes != null) { m_Removes.Release(); m_Removes = null; } }
private int railc; // current collided rail collider void Awake() { int i, j; allRails = GameObject.FindGameObjectsWithTag("Rail"); for (i = 0; i < allRails.Length; i++) { for (j = 0; j < allRails[i].transform.childCount - 1; j++) { vecLRails.Add(allRails[i].transform.GetChild(j + 1).position - allRails[i].transform.GetChild(j).position); posLRails.Add(allRails[i].transform.GetChild(j)); //Debug.Log("railVecs: "+(Vector3)(allRails[i].transform.GetChild(j+1).position - allRails[i].transform.GetChild(j).position)); } } vecRails = vecLRails.ToArray(); vecLRails.Release(); posRails = posLRails.ToArray(); posLRails.Release(); }
public virtual void UnLoadAll() { if (m_Cache != null) { foreach (KeyValuePair <int, LoadedAssetBundle> kvp in m_Cache) { LoadedAssetBundle sab = kvp.Value; if (sab != null) { sab.UnLoadAll(); } } m_Cache.Clear(); m_Cache = null; } if (m_Removes != null) { m_Removes.Release(); m_Removes = null; } }
public void Release() { m_DynamicSpriteDatas.Release(); }