Ejemplo n.º 1
0
 void KeyboardColorController()
 {
     if (Input.GetKeyDown(KeyCode.X))
     {
         if (color == Atributes.Color.purple)
         {
             renderer.material = materials[1];
             color             = Atributes.Color.yellow;
         }
         else
         {
             renderer.material = materials[0];
             color             = Atributes.Color.purple;
         }
         if (onChangeRenderer != null)
         {
             onChangeRenderer();
         }
     }
 }
Ejemplo n.º 2
0
 void TouchColorController()
 {
     foreach (var touch in Input.touches)
     {
         if (touch.position.x < Screen.width / 2 && touch.phase == TouchPhase.Began)
         {
             if (color == Atributes.Color.purple)
             {
                 renderer.material = materials[1];
                 color             = Atributes.Color.yellow;
             }
             else
             {
                 renderer.material = materials[0];
                 color             = Atributes.Color.purple;
             }
             if (onChangeRenderer != null)
             {
                 onChangeRenderer();
             }
         }
     }
 }