Esempio n. 1
0
    // Use this for initialization
    public void Init()
    {
        m_earthPrefab = GameObject.Instantiate(Resources.Load("Map/Earth_16K_linear") as GameObject);
        //m_chinaPrefab = GameObject.Instantiate(Resources.Load("Map/zhongguo") as GameObject);
        m_earthCopy   = GameObject.Instantiate(Resources.Load("Map/EarthControl") as GameObject);
        m_cameraEarth = m_earthCopy.transform.Find("Main_Camera1").gameObject;
        m_earthCopy.SetActive(false);
        m_earthPrefab.gameObject.SetActive(false);
        //m_chinaPrefab.gameObject.SetActive(false);
        m_hitParent = GameObject.Find("HitCubeParent");
        UGUIManager.GetInstance().GetUGUILogic <UI_EarthPanel>().InitPanel();
        m_camera = GameObject.Find("CameraParent/Main Camera").GetComponent <Camera>();
        //m_biaojiAni = m_earthPrefab.GetComponentInChildren<Animator>();
        //m_biaojiAni.SetBool("biaoji", false);
        //EventCenter.Regist(UI_EVENT.SUN_ROTATE.ToString(), RotateSun);
        //m_biaoji.gameObject.SetActive(false);
        m_sunEarth = m_earthPrefab.transform.Find("Sun");

        for (int i = 0; i < 3; i++)
        {
            string    dot = "dot" + i.ToString();
            Transform a   = m_earthPrefab.transform.Find(dot);
            dotList.Add(a);
        }
        m_light          = GameObject.Find("Directional light");
        m_generatePlanes = GameObject.Find("GeneratePlanes").GetComponent <UnityARGeneratePlane>();
        EventCenter.Regist(UI_EVENT.SHOW_EARTHTWO.ToString(), ShowEarthTwo);
        //EventCenter.Regist(UI_EVENT.SHOW_EARTHDISAPPEARFINISH.ToString(), ShowChina);
    }