// Start is called before the first frame update void Start() { shared = this; indicatorRenderer = GetComponent <MeshRenderer>(); audioSource = GetComponent <AudioSource>(); indicatorRenderer.enabled = false; }
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(); }
private Vector3 GetStartPosition(int playerNumber) { var order = playerNumber % 4; bool secondSet = playerNumber >= 4; Vector2 offset = Vector2.up * m_startDistance; offset = MoveIndicator.Rotate(offset, order * 90 + (secondSet ? 45 : 0)); return(new Vector3(offset.x, 0f, offset.y)); }
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(); }