public static Sprite GetSprite(Ball.Type _type) { // default color for special type if (_type == Type.COLORFULL) { _type = Type.BLUE; } string spriteKey = GameConfig.ballImgPath.Replace("{0}", _type.ToString().ToLower()); Sprite sprite = Resources.Load <Sprite>(spriteKey); if (sprite) { return(sprite); } else { Debug.LogError("Missing sprite of " + _type.ToString() + " ball"); } return(null); }
public void PlayMovingAnim(Ball.Type _type) { string animKey = "move_" + _type.ToString().ToLower(); animator.Play(animKey); }
// ========================================================== PUBLIC FUNC ========================================================== public void PlayHighlightAnim(Ball.Type _type) { string animKey = "hl_" + _type.ToString().ToLower(); animator.Play(animKey); }