void OnSceneLoaded(Scene _current, LoadSceneMode _mode) { if (_current.name == "SpireUp") { m_playerCtrl = GameObject.FindGameObjectWithTag("Player").GetComponent <Player_Spire>(); } }
// Use this for initialization void Start() { GameObject player = GameObject.FindGameObjectWithTag("Player"); m_playerTransform = player.transform; m_playerCtrl = player.GetComponent <Player_Spire>(); m_spire = GameObject.FindGameObjectWithTag("Spire").GetComponent <SpireGenerator>(); Camera camera = GetComponent <Camera>(); float frustumHeightAtUnit = 2.0f * Mathf.Tan(camera.fieldOfView * 0.5f * Mathf.Deg2Rad); float idealFrustumWidthAtUnit = frustumHeightAtUnit * 9.0f / 16.0f; float idealFrustumHeightAtUnit = idealFrustumWidthAtUnit / camera.aspect; camera.fieldOfView = 2.0f * Mathf.Atan(idealFrustumHeightAtUnit * 0.5f) * Mathf.Rad2Deg; }
// Use this for initialization void Start() { m_playerCtrl = GetComponent <Player_Spire>(); }
private void Awake() { m_spire = GameObject.FindGameObjectWithTag("Spire").GetComponent <SpireGenerator>(); m_player = GameObject.FindGameObjectWithTag("Player").GetComponent <Player_Spire>(); }
void Awake() { m_player = GameObject.FindGameObjectWithTag("Player").GetComponent <Player_Spire>(); }