/// <summary> /// Releases the game object back to the pool (if allocated) or simply destroys if it not. /// </summary> public override void Release() { base.Release(); OnSelectedEvent = null; mOwner = null; mInputSource = null; mHitInfo = RaycastExt.EmptyHitInfo; mSelectedPosition = Vector3.zero; mSelectedForward = Vector3.zero; }
/// <summary> /// Releases the game object back to the pool (if allocated) or simply destroys if it not. /// </summary> public override void Release() { base.Release(); if (mSelectedTarget != null) { RemoveMaterial(mSelectedTarget.gameObject, mMaterialInstance); } OnSelectedEvent = null; mOwner = null; mInputSource = null; mSelectedTarget = null; }
/// <summary> /// Releases the GameObject the core is tied to. We'll either send it back /// to the pool or destroy it. /// </summary> public virtual void Release() { if (OnReleasedEvent != null) { OnReleasedEvent(this, null); } if (mLifeInstance != null) { GameObject.Destroy(mLifeInstance); } GameObject.Destroy(gameObject); mAge = 0f; mIsShuttingDown = false; OnReleasedEvent = null; }
/// <summary> /// Releases the game object back to the pool (if allocated) or simply destroys if it not. /// </summary> public override void Release() { // Ensure we exit any remaining intruders for (int i = 0; i < mIntruders.Count; i++) { //Utilities.Debug.Log.FileWrite("TriggerAreaCore.Release collider:" + mIntruders[i].name); if (OnTriggerExitEvent != null) { OnTriggerExitEvent(this, mIntruders[i]); } } // Clean up mIntruders.Clear(); mIntruderColliders.Clear(); OnTriggerEnterEvent = null; OnTriggerStayEvent = null; OnTriggerExitEvent = null; base.Release(); }
/// <summary> /// Releases the game object back to the pool (if allocated) or simply destroys if it not. /// </summary> public virtual void Release() { if (OnReleasedEvent != null) { OnReleasedEvent(this, null); } if (mLaunchInstance != null) { GameObject.Destroy(mLaunchInstance); } if (mFlyInstance != null) { GameObject.Destroy(mFlyInstance); } if (mImpactInstance != null) { GameObject.Destroy(mImpactInstance); } Transform lParent = gameObject.transform.parent; if (lParent != null && lParent.name.Contains(" connector", StringComparison.OrdinalIgnoreCase)) { GameObject.Destroy(lParent.gameObject); } else { GameObject.Destroy(gameObject); } mAge = 0f; mIsActive = false; mHasExpired = false; mIsShuttingDown = false; OnReleasedEvent = null; mTarget = null; }