Exemple #1
0
    public void ShowCondition()
    {
        for (int i = 0; i < 3; i++)
        {
            conditionObj[0].transform.GetChild(i).gameObject.SetActive(false);
            conditionObj[1].transform.GetChild(i).gameObject.SetActive(false);
        }

        for (int i = 0; i < 2; i++)
        {
            bool health = true;

            if (player[i].poisonCount > 0)
            {
                //poisonText[i].text = "毒" + player[i].poisonCount;

                for (int j = 0; j < 3; j++)
                {
                    if (!conditionObj[i].transform.GetChild(j).gameObject.activeSelf)
                    {
                        health = false;
                        conditionObj[i].transform.GetChild(j).gameObject.SetActive(true);
                        conditionObj[i].transform.GetChild(j).GetComponent <ConditionView>().ChangeConditionView(0, player[i].poisonCount);
                        characterController.ChangeCharacterColor(player[i].playerIndex, 0);
                        break;
                    }
                }
            }

            if (player[i].darkCount > 0)
            {
                //darkText[i].text = "闇" + player[i].darkCount;

                for (int j = 0; j < 3; j++)
                {
                    if (!conditionObj[i].transform.GetChild(j).gameObject.activeSelf)
                    {
                        health = false;
                        conditionObj[i].transform.GetChild(j).gameObject.SetActive(true);
                        conditionObj[i].transform.GetChild(j).GetComponent <ConditionView>().ChangeConditionView(1, player[i].darkCount);
                        characterController.ChangeCharacterColor(player[i].playerIndex, 1);
                        break;
                    }
                }
            }

            if (player[i].clumsyCount > 0)
            {
                //paralysisText[i].text = "器" + player[i].clumsyCount;

                for (int j = 0; j < 3; j++)
                {
                    if (!conditionObj[i].transform.GetChild(j).gameObject.activeSelf)
                    {
                        health = false;
                        conditionObj[i].transform.GetChild(j).gameObject.SetActive(true);
                        conditionObj[i].transform.GetChild(j).GetComponent <ConditionView>().ChangeConditionView(2, player[i].clumsyCount);
                        characterController.ChangeCharacterColor(player[i].playerIndex, 2);
                        break;
                    }
                }
            }

            if (health)
            {
                characterController.ChangeCharacterColor(player[i].playerIndex, 3);
            }
        }
    }