void Awake() { uiCloneObjects = Instantiate(uiCloneObjectsPrefab); GameObject nodeSelectionObject = Instantiate(nodeSelectionPrefab); nodeSelection = new GridSelection(nodeSelectionObject, uiCloneObjects, new Vector2Int(0, 0)); pathPoints = new PathPointCollection(); for (int i = 0; i < MAX_PATH_LENGTH; i++) { GameObject pathPoint = Instantiate(pathPointPrefab); pathPoints.Add(pathPoint, uiCloneObjects); } }
public ExplorationUI(Party party, IUnitObject partyLeader, SmoothCamera smoothCamera, GridSelection nodeSelection, PathPointCollection pathPoints) { this.party = party; this.partyLeader = partyLeader; this.smoothCamera = smoothCamera; movementNodes = null; retraceNode = null; this.nodeSelection = nodeSelection; this.pathPoints = pathPoints; Dictionary <ExplorationUIStates, IState <ExplorationUI> > states = new Dictionary <ExplorationUIStates, IState <ExplorationUI> >(); states.Add(ExplorationUIStates.HALT, new ExplorationUIHaltState()); states.Add(ExplorationUIStates.WAIT_FOR_INPUT, new ExplorationUIWaitForInputState()); states.Add(ExplorationUIStates.TRACE_PATH, new ExplorationUITracePathState()); states.Add(ExplorationUIStates.WAIT_FOR_CONFIRM, new ExplorationUIWaitForConfirmState()); states.Add(ExplorationUIStates.FIRE_MOVE_ACTION, new ExplorationUIFireMoveActionState()); StateMachine = new StateMachine <ExplorationUI, ExplorationUIStates>(this, states); StateMachine.Initialize(ExplorationUIStates.HALT); }