public void ReStart() { func = new List <Functionclass>(); player = GameObject.Find("Player").GetComponent <Robot_move>(); choosebutton = button.GetComponent <Choosebutton>(); func_count = choosebutton.func_num.Count; for (int i = 0; i < func_count; i++) { func.Add(new Functionclass(choosebutton.func_num[i])); } }