예제 #1
0
    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);
    }
예제 #2
0
    public void PlayMovingAnim(Ball.Type _type)
    {
        string animKey = "move_" + _type.ToString().ToLower();

        animator.Play(animKey);
    }
예제 #3
0
    // ========================================================== PUBLIC FUNC ==========================================================
    public void PlayHighlightAnim(Ball.Type _type)
    {
        string animKey = "hl_" + _type.ToString().ToLower();

        animator.Play(animKey);
    }