示例#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);
    }