Exemplo n.º 1
0
    // Start is called before the first frame update
    void Start()
    {
        rb     = GetComponent <Rigidbody>();
        blocks = new List <Block>();
        int startingColor = Random.Range(0, 3);

        GetComponent <MeshRenderer>().material = materials[startingColor];
        if (startingColor == 0)
        {
            color = GlobalVars.Color.red;
        }
        else if (startingColor == 1)
        {
            color = GlobalVars.Color.green;
        }
        else
        {
            color = GlobalVars.Color.blue;
        }
    }
Exemplo n.º 2
0
 public void SetColor(GlobalVars.Color color, GameObject gameObjectGate)
 {
     this.color = color;
     gameObject.GetComponent <MeshRenderer>().sharedMaterial = gameObjectGate.GetComponent <MeshRenderer>().sharedMaterial;
 }