public void ChangeBranchLength(PlatformHeight height) { switch (height) { case PlatformHeight.Short: SpriteRenderer.sprite = shortSprite; break; case PlatformHeight.Medium: SpriteRenderer.sprite = mediumSprite; break; case PlatformHeight.Long: SpriteRenderer.sprite = longSprite; break; } }
public override void OnInspectorGUI() { state = (PlatformHeight)EditorGUILayout.EnumPopup("Platform height", state); bush.ChangeBranchLength(state); }