void OnEnable() { tutorialMode = true; msgBanner = GameObject.Find("MsgBanner"); msg = msgBanner.transform.Find("Msg").gameObject.GetComponent <Text>(); note = msgBanner.transform.Find("Note").gameObject; panel = msgBanner.transform.Find("Panel").gameObject; GameObject gameManager = GameObject.Find("GameManager"); setGame = gameManager.GetComponent <SetGame>(); scoreKeeper = gameManager.GetComponent <ScoreKeeper>(); GameObject instructions = GameObject.Find("Instructions"); instrucCtrl = instructions.GetComponent <InstructionControl>(); GameObject human = GameObject.FindGameObjectWithTag("Human"); leaderHexCtrl = human.GetComponent <HexToHexControl>(); if (role == "Human") { msg.text = "Welcome to the <b>Leader Tutorial</b>! Complete all steps to get started playing the game!"; } else if (role == "Agent") { msg.text = "Welcome to the <b>Follower Tutorial</b>! Complete all steps to get started playing the game!"; } }
private void GrabMoveScripts() { var hexScripts = FindObjectsOfType <HexToHexControl>(); foreach (var hscript in hexScripts) { if (hscript.gameObject.tag == "Agent") { hexMoveControl = hscript; hexMoveControl.tag = "Agent"; break; } } var queuedControls = FindObjectsOfType <QueuedControl>(); foreach (var qscript in queuedControls) { if (qscript.tag == "Agent") { queuedControl = qscript; queuedControl.tag = "Agent"; break; } } }
// Have external be listening for events- depending on the string attached? void Awake() { mv = GetComponent <MovementType>(); hexQueuedMovement = GetComponent <HexQueuedCntrl>(); discreteMovement = GetComponent <DiscreteMovement>(); hexhexControl = GetComponent <HexToHexControl>(); disQueuedMovement = GetComponent <QueuedControl>(); turnControl = GetComponent <TurnBasedControl>(); simulatedControl = GetComponent <SimulatedControl>(); replayControl = GetComponent <ReplayControl>(); }
void Awake() { discreteQueued = GetComponent<QueuedControl>(); continousControl = GetComponent<ContinuousControl>(); hexesControl = GetComponent<HexToHexControl>(); discreteControl = GetComponent<DiscreteMovement>(); hexQueuedControl = GetComponent<HexQueuedCntrl>(); turnControl = GetComponent<TurnBasedControl>(); simulatedControl = GetComponent<SimulatedControl>(); replayControl = GetComponent<ReplayControl>(); }