// Start is called before the first frame update public void tatakau() { GameObject gameObject = GameObject.Find("戦闘処理"); getStatus = gameObject.GetComponent <GetStatus>(); Debug.Log(getStatus.Getpact1()); Instantiate(lis); num = 1; GameObject c = GameObject.Find("コメントパネル/Text"); coment = c.GetComponent <Text>(); for (int act = getStatus.Getpact1() + 1; act < 8; act++) { GameObject find = GameObject.Find("Button" + act); Debug.Log(act); find.SetActive(false); } for (int act = 1; act <= getStatus.Getpact1(); act++) { GameObject find = GameObject.Find("Textb" + act); Debug.Log(find); Text text = find.GetComponent <Text>(); Debug.Log(text.text); if (num == 1) { skill = getStatus.Getpskill11(); Debug.Log(skill); } else if (num == 2) { skill = getStatus.Getpskill12(); Debug.Log(skill); } else if (num == 3) { skill = getStatus.Getpskill13(); Debug.Log(skill); } else if (num == 4) { skill = getStatus.Getpskill14(); Debug.Log(skill); } else if (num == 5) { skill = getStatus.Getpskill15(); Debug.Log(skill); } else if (num == 6) { skill = getStatus.Getpskill16(); Debug.Log(skill); } else if (num == 7) { skill = getStatus.Getpskill17(); Debug.Log(skill); } Skill.KindOfSkill KOS = skill.GetKindOfSkill(); string strVal = Enum.GetName(typeof(KindOfSkill), KOS); if (strVal == "アクション") { text.text = skill.GetsName(); } else { act--; } num++; } GameObject ppanel = GameObject.Find("Button1"); Debug.Log(ppanel); button = ppanel.GetComponent <Button>(); Debug.Log(button); button.Select(); }