Пример #1
0
    IEnumerator ChangeColor(textColor colorType,float start, float end)
    {
        float currTime = 0;

        while (currTime < switchTime)
        {
            currTime += Time.deltaTime;
            AddColor(colorType,  EasingUtil.linear(start, end, currTime / switchTime));
            yield return null;
        }

        
    }
Пример #2
0
 void AddColor(textColor colorType, float add)
 {
     switch (colorType)
     {
         case textColor.red:
             targetText.color = new Color(add, targetText.color.g, targetText.color.b, targetText.color.a);
             break;
         case textColor.green:
             targetText.color = new Color(targetText.color.r, add, targetText.color.b, targetText.color.a);
             break;
         case textColor.blue:
             targetText.color = new Color(targetText.color.r, targetText.color.g, add, targetText.color.a);
             break;
         default:
             break;
     }
 }
Пример #3
0
    public void change_color(Text announce, textColor textcolor)
    {
        switch (textcolor)
        {
        case textColor.red:
            announce.color = new Color(255f / 255f, 0f / 255f, 0f / 255f);
            break;

        case textColor.yellow:
            announce.color = new Color(255f / 255f, 255f / 255f, 0f / 255f);
            break;

        case textColor.green:
            announce.color = new Color(0f / 255f, 255f / 255f, 0f / 255f);
            break;
        }
    }