コード例 #1
0
 // Use this for initialization
 void Start()
 {
     characterController = transform.GetComponent <CharacterController>();
     //set the player a random colour
     transform.GetComponent <Renderer>().material.color = new Color(Random.Range(0.5f, 1f), Random.Range(0.5f, 1f), Random.Range(0.5f, 1f), 1f);
     playerSlotDisplay.text = "Input:\n" + playerSlot.ToString();
 }
コード例 #2
0
        // Use this for initialization
        void Start()
        {
            characterController = transform.GetComponent <CharacterController>();
            //set the player a random colour
            Color playerColor = new Color(Random.Range(0.5f, 1f), Random.Range(0.5f, 1f), Random.Range(0.5f, 1f), 1f);

            for (int i = 0; i < playerRenderers.Length; i++)
            {
                playerRenderers[i].material.color = playerColor;
            }
            playerSlotDisplay.text = "Input:\n" + playerSlot.ToString();
        }