コード例 #1
0
 /// <summary>
 /// Change the color of this game object
 /// </summary>
 public bool SetColor(GameColor newColor, bool animation = true)
 {
     if (!CanChangeColor(newColor))
     {
         return(false);
     }
     _previousColor   = _color;
     _color           = newColor;
     gameObject.layer = _colorsManager.GetLayer(this._color);
     if (animation)
     {
         colorAnimationManager.StartAnimation();
     }
     else
     {
         DoUpdateColor(_colorsManager.GetColor(Color));
     }
     return(true);
 }