public void toggleOwnCone() { GameObject obj = GameObject.FindGameObjectWithTag("owncone"); if (obj != null) { cone c = obj.GetComponent <cone>(); c.SwitchVis(); } }
public void SwitchOffOwnCone() { GameObject obj = GameObject.FindGameObjectWithTag("owncone"); if (obj != null) { cone c = obj.GetComponent <cone>(); if (c.visible) { c.SwitchVis(); } } }