/** * Self implementation for destroy since using GamObject.Destroy() has a performance hit in android. */ private void destroy() { shape.enabled = false; // makes the shape to be removed from the space GameObjectTools.ChipmunkBodyDestroy(body); #if UNITY_4_AND_LATER gameObject.SetActive(false); #else gameObject.SetActiveRecursively(false); #endif PauseGameManager.Instance.remove(this); }
void OnDestroy() { GameObjectTools.ChipmunkBodyDestroy(body, GetComponent <ChipmunkShape>()); // this is to avoid nullifying or destroying static variables. Intance variables can be destroyed before this check if (duplicated) { duplicated = false; // reset the flag for next time return; } PauseGameManager.Instance.remove(this as IPausable); instance = null; }
void OnDestroy() { PauseGameManager.Instance.remove(this as IPausable); GameObjectTools.ChipmunkBodyDestroy(body, shape); }
void OnDestroy() { GameObjectTools.ChipmunkBodyDestroy(body); }
/** * Self implementation for destroy since using GamObject.Destroy() has a performance hit in android. */ private void destroy() { GameObjectTools.ChipmunkBodyDestroy(body, shape); GameObjectTools.setActive(gameObject, false); }
void OnDestroy() { GameObjectTools.ChipmunkBodyDestroy(body); PauseGameManager.Instance.remove(this); instance = null; }