예제 #1
0
    void Start()
    {
        buttons = new ButtonRobot[transform.childCount];

        int index = 0;

        foreach (Transform child in transform)
        {
            buttons[index]        = new ButtonRobot();
            buttons[index].button = child;
            buttons[index].rend   = child.GetComponent <Renderer>();
            buttons[index].anim   = child.GetComponent <Animator>();
            index++;
        }
    }
예제 #2
0
 void Start()
 {
     zombie1 = gameObject.GetComponent <ButtonRobot>();
 }