Пример #1
0
 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;
    }
Пример #3
0
 // Use this for initialization
 void Start()
 {
     m_playerCtrl = GetComponent <Player_Spire>();
 }
Пример #4
0
 private void Awake()
 {
     m_spire  = GameObject.FindGameObjectWithTag("Spire").GetComponent <SpireGenerator>();
     m_player = GameObject.FindGameObjectWithTag("Player").GetComponent <Player_Spire>();
 }
Пример #5
0
 void Awake()
 {
     m_player = GameObject.FindGameObjectWithTag("Player").GetComponent <Player_Spire>();
 }