To manage a game's state-driven behavior with Unity Scriptable Objects, perform the following steps:
- Create a UI Button in the middle of the screen. Name it Button-collect-star and edit its text to read Collect a star.
- Create a UI Text object at the top-right of the screen. Name this Text-current-state.
- Create a UI Text object at the top-left of the screen. Name this Text-stars-collected.
- Create a second UI Text object at the top-left of the screen, positioned below Text-stars-collected. Name this Text-seconds-left.
- Create a new C# script class called Decision:
using UnityEngine; public abstract class Decision : ScriptableObject { public abstract bool Decide(StateController controller); }
- Create a new C# script class ...