Beispiel #1
0
    // Use this for initialization
    void Start()
    {
        radius = transform.FindChild("Gear Mesh").renderer.bounds.size.x;

        if (gameObject.activeSelf)
        {
            GearManager.Instance().AddGear(this);
        }
    }
Beispiel #2
0
    void OnTriggerExit(Collider collider)
    {
        // print("Exit trigger with " + collider.transform.name);

        Gear otherGear = collider.GetComponentInParent <Gear> ();

        if (!otherGear)
        {
            return;
        }

        GearManager.Instance().DisconnectGears(this, otherGear);
    }
Beispiel #3
0
 public void RemoveFromScene()
 {
     gameObject.SetActive(false);
     GearManager.Instance().RemoveGear(this);
 }