public void DestroyGameObject(Object o)
    {
        GameObject go = MonoExtensions.GetGameObject(o);

        if (go != null)
        {
            Destroy(go);
        }
    }
    public void DestroyRootGameObject(Object o)
    {
        GameObject go = MonoExtensions.GetGameObject(o);

        if (go != null)
        {
            Destroy(go.transform.root.gameObject);
        }
    }
Example #3
0
    }                           //include this function so the designers can see the checkbox to disable this component

    public void ApplyForceToObject(Object o)
    {
        if (!enabled || o == null)
        {
            return;
        }

        GameObject go = MonoExtensions.GetGameObject(o);

        if (go != null)
        {
            Collider2D c = go.GetComponent <Collider2D>();
            if (c != null)
            {
                ApplyForceToCollider(c);
            }
            else
            {
                ApplyForceToRigidbody(go.GetComponentInParent <Rigidbody2D>());
            }
        }
    }