Exemplo n.º 1
0
    /**
     * 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);
    }
Exemplo n.º 2
0
 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;
 }
Exemplo n.º 3
0
 void OnDestroy()
 {
     PauseGameManager.Instance.remove(this as IPausable);
     GameObjectTools.ChipmunkBodyDestroy(body, shape);
 }
Exemplo n.º 4
0
 void OnDestroy()
 {
     GameObjectTools.ChipmunkBodyDestroy(body);
 }
Exemplo n.º 5
0
 /**
  * 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);
 }
Exemplo n.º 6
0
 void OnDestroy()
 {
     GameObjectTools.ChipmunkBodyDestroy(body);
     PauseGameManager.Instance.remove(this);
     instance = null;
 }