Exemple #1
0
    void interacted()
    {
        mPlayer.SendMessage("PoolInteracted");

        switch (mPlayer.GetComponent <PlayerController>().BrushColor)
        {
        case "Blue":
            myColor = "Blue";
            this.GetComponent <MeshRenderer>().material   = matBlue;
            myArm.GetComponent <MeshRenderer>().material  = matBlue;
            myArm2.GetComponent <MeshRenderer>().material = matBlue;
            break;

        case "Green":
            myColor = "Green";
            this.GetComponent <MeshRenderer>().material   = matGreen;
            myArm.GetComponent <MeshRenderer>().material  = matGreen;
            myArm2.GetComponent <MeshRenderer>().material = matGreen;
            break;

        case "Red":
            myColor = "Red";
            this.GetComponent <MeshRenderer>().material   = matRed;
            myArm.GetComponent <MeshRenderer>().material  = matRed;
            myArm2.GetComponent <MeshRenderer>().material = matRed;
            break;

        default:
            break;
        }
        ResultCube.SendMessage("SetColor");
    }