public void CreateApple(Apple.STYLE style, ApplePivot pivot) { GameObject apple = AppleWithStyle(style); Instantiate(apple); apple.transform.position = applePivots[(int)pivot].transform.position; }
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); }