Inheritance: MonoBehaviour
Beispiel #1
0
    // Use this for initialization
    private void Awake()
    {
        if (m_Instance == null)
        {
            m_Instance = this;
        }

        if (m_GUICamera == null)
        {
            GameObject guiCameraObj = GameObject.Find("GUICamera");
            if (guiCameraObj != null)
            {
                m_GUICamera = guiCameraObj.GetComponentInChildren <Camera>();
            }
        }
        if (m_MainCamera == null)
        {
            GameObject mainCameraObj = GameObject.Find("MainCamera");
            if (mainCameraObj != null)
            {
                m_MainCamera = mainCameraObj.GetComponentInChildren <Camera>();
            }
        }
    }
    // Use this for initialization
    private void Awake()
    {
        if (m_Instance == null)
        {
            m_Instance = this;
        }

        if (m_GUICamera == null)
        {
            GameObject guiCameraObj = GameObject.Find("GUICamera");
            if (guiCameraObj != null)
            {
                m_GUICamera = guiCameraObj.GetComponentInChildren<Camera>();
            }
        }
        if (m_MainCamera == null)
        {
            GameObject mainCameraObj = GameObject.Find("MainCamera");
            if (mainCameraObj != null)
            {
                m_MainCamera = mainCameraObj.GetComponentInChildren<Camera>();
            }
        }
    }