// Use this for initialization void Start() { GameObject gameDialogboxControllerObject = GameObject.FindWithTag("DialogBox"); dialog = gameDialogboxControllerObject.GetComponent <GameDialogBoxController>(); GameObject playerControllerObject = GameObject.FindWithTag("Player"); player = playerControllerObject.GetComponent <PlayerController>(); GameObject equipmentManagerObject = GameObject.FindWithTag("EquipmentManager"); equipment = equipmentManagerObject.GetComponent <EquipmentManager>(); GameObject gameControllerObject = GameObject.FindWithTag("GameController"); gameController = gameControllerObject.GetComponent <TextController>(); GameObject levelManagerObject = GameObject.FindWithTag("LevelManager"); level = levelManagerObject.GetComponent <LevelManager>(); }
void Start() { myState = States.bedroom_0_0; GameObject gameDialogboxControllerObject = GameObject.FindWithTag("DialogBox"); if (gameDialogboxControllerObject != null) { dialog = gameDialogboxControllerObject.GetComponent <GameDialogBoxController>(); } if (gameDialogboxControllerObject == null) { Debug.Log("Cannot find 'GameDialogBoxController' script."); } GameObject equipmentManagerObject = GameObject.FindWithTag("EquipmentManager"); if (equipmentManagerObject != null) { equipment = equipmentManagerObject.GetComponent <EquipmentManager>(); } if (equipmentManagerObject == null) { Debug.Log("Cannot find 'EquipmentManager' script."); } GameObject gametimeControllerObject = GameObject.FindWithTag("GameTime"); if (gametimeControllerObject != null) { gameTime = gametimeControllerObject.GetComponent <GameTimeController>(); } if (gametimeControllerObject == null) { Debug.Log("Cannot find 'GameTimeController' script."); } GameObject enemyControllerObject = GameObject.FindWithTag("Enemy"); if (enemyControllerObject != null) { enemy = enemyControllerObject.GetComponent <EnemyController>(); } if (enemyControllerObject == null) { Debug.Log("Cannot find 'EnemyController' script."); } GameObject playerControllerObject = GameObject.FindWithTag("Player"); if (playerControllerObject != null) { player = playerControllerObject.GetComponent <PlayerController>(); } if (playerControllerObject == null) { Debug.Log("Cannot find 'PlayerController' script."); } GameObject levelManagerObject = GameObject.FindWithTag("LevelManager"); if (levelManagerObject != null) { level = levelManagerObject.GetComponent <LevelManager>(); } if (levelManagerObject == null) { Debug.Log("Cannot find 'LevelManager' script."); } }