| | | 1 | | /* |
| | | 2 | | * |
| | | 3 | | * Code by: |
| | | 4 | | * Dimitrios Vlachos |
| | | 5 | | * djv1@student.london.ac.uk |
| | | 6 | | * dimitri.j.vlachos@gmail.com |
| | | 7 | | * |
| | | 8 | | * Adapted from our Games Dev FSM lecture |
| | | 9 | | * |
| | | 10 | | */ |
| | | 11 | | |
| | | 12 | | using System.Collections; |
| | | 13 | | using System.Collections.Generic; |
| | | 14 | | using TMPro; |
| | | 15 | | using UnityEngine; |
| | | 16 | | |
| | | 17 | | public abstract class RecipeBaseState |
| | | 18 | | { |
| | | 19 | | #region Variables |
| | | 20 | | protected TextMeshProUGUI objective; |
| | | 21 | | protected TextMeshProUGUI status; |
| | | 22 | | protected GameObject pot; |
| | | 23 | | protected PotBehaviour potBehaviour; |
| | | 24 | | |
| | | 25 | | // Objective information |
| | | 26 | | protected int numberOfPotatos; |
| | | 27 | | protected int numberOfCarrots; |
| | | 28 | | protected int water; |
| | | 29 | | |
| | | 30 | | protected RecipeManager recipeManager; |
| | | 31 | | #endregion |
| | | 32 | | public virtual void EnterState(RecipeManager rm) |
| | 1 | 33 | | { |
| | | 34 | | // Set variables |
| | 1 | 35 | | objective = rm.objective; |
| | 1 | 36 | | status = rm.status; |
| | 1 | 37 | | pot = rm.pot; |
| | 1 | 38 | | potBehaviour = rm.potBehaviour; |
| | | 39 | | |
| | 1 | 40 | | numberOfPotatos = rm.numberOfPotatos; |
| | 1 | 41 | | numberOfCarrots = rm.numberOfCarrots; |
| | 1 | 42 | | water = rm.water; |
| | | 43 | | |
| | 1 | 44 | | recipeManager = rm; |
| | 1 | 45 | | } |
| | | 46 | | |
| | | 47 | | public abstract void Update(); |
| | | 48 | | |
| | | 49 | | public abstract void FixedUpdate(); |
| | | 50 | | |
| | | 51 | | |
| | | 52 | | } |