using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.UI; public class snailRiderItem : MonoBehaviour { public enum Mode { accelerate,//¼ÓËÙ slowDown, //¼õËÙ } public Mode mode = Mode.accelerate; public Sprite accelerate; public Sprite slowDown; private void Update() { if (mode == Mode.accelerate) { GetComponent().sprite = accelerate; } else { GetComponent().sprite = slowDown; } } }