void Start() { GameManager gameManager = FindObjectOfType<GameManager>(); if (gameManager == null) { Debug.LogError("Can't find Game Manager within scene"); } GameObject player = gameManager.players[playerNumber - 1]; m_playerWeaponSystem = player.GetComponent<Countermeasures>(); if (m_playerWeaponSystem == null) { Debug.LogError("Unable to find player Counter Measure Script"); } m_playerStateManager = player.GetComponent<StateManager>(); if (m_playerStateManager == null) { Debug.LogError("Unable to find player StateManager Script"); } }
public void Awake() { m_standardControl = GetComponent<AirshipControlBehaviour>(); m_fireshipControl = GetComponent<AirshipSuicideBehaviour>(); m_rouletteControl = GetComponent<RouletteBehaviour>(); m_rotateCam = GetComponent<RotateCam>(); m_broadSideWeapons = GetComponent<BroadsideWeaponsController>(); m_countermeasures = GetComponent<Countermeasures> (); m_stateManager = GetComponent<StateManager>(); }