void Start() { GetComponent <Button>().onClick.AddListener(() => { var target = transform.parent.gameObject; Robots.Remove(target); RunButton.interactable = Robots.Robots.Count > 0; Destroy(target); }); }
public void RemoveRobot() { if (Robots == null) { return; } Robots.Remove(rootGO); Destroy(rootGO); }