Esempio n. 1
0
    public void Refresh(GameColor color, bool animate = true)
    {
        Color newCurrentColor = _colorsManager.GetColor(color);
        Color newNextColor    = _colorsManager.GetColor(_colorsManager.GetNextColor(color));

        if (animate)
        {
            iTween.ValueTo(gameObject, iTween.Hash(
                               "from", _currentColorImage.color,
                               "to", newCurrentColor,
                               "onupdate", "SetCurrentColorImageColor",
                               "time", 1.0f,
                               "easetype", iTween.EaseType.easeOutCubic
                               ));
            iTween.ValueTo(gameObject, iTween.Hash(
                               "from", _nextColorImage.color,
                               "to", newNextColor,
                               "onupdate", "SetNextColorImageColor",
                               "time", 1.0f,
                               "easetype", iTween.EaseType.easeOutCubic
                               ));
        }
        else
        {
            _currentColorImage.color = newCurrentColor;
            _nextColorImage.color    = newNextColor;
        }
    }
Esempio n. 2
0
    public bool CycleColor()
    {
        GameColor nextColor = _colorsManager.GetNextColor(_coloredGameObject.Color);

        return(SetColor(nextColor));
    }