Ejemplo n.º 1
0
 void RotateColors()
 {
     foreach (var trap in Traps)
     {
         trap.SetColor(PlayerColorMethods.NextColor(trap.Color, NumPlayers));
     }
 }
Ejemplo n.º 2
0
    /**
     * hide trap with the alpha value of its color and slowly return to normal
     */
    IEnumerator HideAndShowAgain()
    {
        var hiddenColor = PlayerColorMethods.ToRGB(color);

        hiddenColor.a = 0;
        hidden        = true;
        SetMaterialColor(hiddenColor);
        yield return(new WaitForSeconds(2));

        while (hiddenColor.a < 1)
        {
            hiddenColor.a += _tintSpeed * Time.fixedDeltaTime;
            SetMaterialColor(hiddenColor);
            yield return(new WaitForFixedUpdate());
        }
        hidden = false;
    }