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

        Robots.Remove(rootGO);
        Destroy(rootGO);
    }