예제 #1
0
    public void CreateApple(Apple.STYLE style, ApplePivot pivot)
    {
        GameObject apple = AppleWithStyle(style);

        Instantiate(apple);
        apple.transform.position = applePivots[(int)pivot].transform.position;
    }
예제 #2
0
    public GameObject AppleWithStyle(Apple.STYLE style)
    {
        GameObject apple = null;

        switch (style)
        {
        case Apple.STYLE.RED:
            apple = redApple;
            break;

        case Apple.STYLE.BLUE:
            apple = blueApple;
            break;

        case Apple.STYLE.GOLDEN:
            apple = goldApple;
            break;
        }

        return(apple);
    }