public void Initialize() { _errorGO = GameObject.Find("ErrorGO"); _errorText = GameObject.Find("losText").GetComponent <Text>(); _player = GameObject.Find("Player"); _playerTurn = _player.GetComponent <PlayerTurn>(); _apBar = GameObject.Find("APbar"); _apRect = _apBar.GetComponent <RectTransform>(); _apBack = GameObject.Find("APback").GetComponent <RectTransform>(); _hpBar = GameObject.Find("HPbar"); _hpRect = _hpBar.GetComponent <RectTransform>(); _hpBack = GameObject.Find("HPback").GetComponent <RectTransform>(); _apLoss = GameObject.Find("APLoss"); _apLossRect = _apLoss.GetComponent <RectTransform>(); _apImage = _apLoss.GetComponent <Image>(); _moveIndicator = GameObject.Find("Player").GetComponent <MoveIndicator>(); _toolTip = gameObject.GetComponent <Tooltip>(); _moveCost = GameObject.Find("MoveCost").GetComponent <Text>(); _moveButton = GameObject.Find("ToggleMove").GetComponent <Button>(); _toggleAttackButton = GameObject.Find("ToggleAttack").GetComponent <Button>(); _attackAbutton = GameObject.Find("AttackTypeA").GetComponent <Button>(); _attackBbutton = GameObject.Find("AttackTypeB").GetComponent <Button>(); _attackCbutton = GameObject.Find("AttackTypeC").GetComponent <Button>(); _calc = GameObject.Find("_combatMan").GetComponent <CalculateDamage>(); _auxPower = GameObject.Find("_combatMan").GetComponent <AuxilliaryPower>(); _hpap = GameObject.Find("HP/AP"); _hpapText = GameObject.Find("HP/AP Text").GetComponent <Text>(); _hpap.SetActive(false); _pauseMenu = GameObject.Find("PauseMenu"); _errorGO.SetActive(false); _pauseMenu.SetActive(false); DeactivateButtons(false); UpdateHealth(); }
//On scene load find the scripts and UI in the scene void Start() { _aux = gameObject.GetComponent <AuxilliaryPower>(); _tM = gameObject.GetComponent <TurnManager>(); _pT = GameObject.Find("Player").GetComponent <PlayerTurn>(); _combatUI = gameObject.GetComponent <CombatUI>(); }
void Start() { _combatUI = gameObject.GetComponent <CombatUI>(); _aux = gameObject.GetComponent <AuxilliaryPower>(); _pT = GameObject.Find("Player").GetComponent <PlayerTurn>(); _playerMenu = GameObject.Find("PlayerTurn"); _skillsMenu = GameObject.Find("SkillsMenu"); _menuRect = _skillsMenu.GetComponent <RectTransform>(); SpawnMenu(); _skillsMenu.SetActive(false); }
// Use this for initialization void Start() { _auxPower = gameObject.GetComponent <AuxilliaryPower>(); _combatUI = gameObject.GetComponent <CombatUI>(); _pT = GameObject.Find("Player").GetComponent <PlayerTurn>(); _toolTipName = GameObject.Find("TooltipName").GetComponent <Text>(); _toolTipDesc = GameObject.Find("TooltipDesc").GetComponent <Text>(); _toolTipAP = GameObject.Find("TooltipAP").GetComponent <Text>(); _toolTipGO = GameObject.Find("TooltipGO"); _tooltipRect = _toolTipGO.GetComponent <RectTransform>(); _tooltipRect.anchoredPosition = _lowerPos; _toolTipGO.SetActive(false); }
void Awake() { //Find and allocate the referenced objects and scripts in the scene _muzzleFlash = gameObject.GetComponentInChildren <MuzzleFlash>(); _midPoint = GameObject.Find("MidPoint"); _anim = gameObject.GetComponent <Animator>(); _agent = gameObject.GetComponent <NavMeshAgent>(); _obstacle = gameObject.GetComponent <NavMeshObstacle>(); _combatUI = GameObject.Find("_combatMan").GetComponent <CombatUI>(); _calcDam = GameObject.Find("_combatMan").GetComponent <CalculateDamage>(); _targetedEnemy = GameObject.Find("_combatMan").GetComponent <TargetedEnemy>(); _moveIndicator = GameObject.Find("Player").GetComponent <MoveIndicator>(); _playerTurnUI = GameObject.Find("PlayerTurn"); _cam = GameObject.Find("_cameraParent").GetComponent <CameraController>(); _combatOver = GameObject.Find("EndCanvas").GetComponent <CombatOver>(); _aux = GameObject.Find("_combatMan").GetComponent <AuxilliaryPower>(); //Determine player stats based off _ap = _CombatManager._maxAP; _combatUI.Initialize(); //Prepare the elements used for navigation _mask = ~_mask; _path = new NavMeshPath(); _aux.Initialize(); }