Exemple #1
0
    // Update is called once per frame
    void Update()
    {
        //動かす側のマテリアルを赤く
        //動かさない側のマテリアルを青く

        //現在の回すのが外側
        if (modeManager.GetFalseInTrueOut())
        {
            foreach (Transform child in outParent)
            {
                if (child.gameObject.tag == "Block")
                {
                    child.gameObject.GetComponent <Renderer>().material = operateMat;
                }
            }

            foreach (Transform child in inParent)
            {
                child.gameObject.GetComponent <Renderer>().material = notOperateMat;
            }
        }//現在の回すのが内側
        else if (!modeManager.GetFalseInTrueOut())
        {
            foreach (Transform child in inParent)
            {
                child.gameObject.GetComponent <Renderer>().material = operateMat;
            }

            foreach (Transform child in outParent)
            {
                if (child.gameObject.tag == "Block")
                {
                    child.gameObject.GetComponent <Renderer>().material = notOperateMat;
                }
            }
        }
    }