Ejemplo n.º 1
0
    void Awake()
    {
        NGUILink link = this.gameObject.GetComponent(typeof(NGUILink)) as NGUILink;

        Camera = CLauncherUI.Get(link, "Camera");
        Camera.SetActive(false);
    }
Ejemplo n.º 2
0
    void Start()
    {
        Screen.sleepTimeout = SleepTimeout.NeverSleep;
        //设置屏幕自动旋转, 并置支持的方向
        Screen.orientation = ScreenOrientation.AutoRotation;
        Screen.autorotateToLandscapeLeft      = true;
        Screen.autorotateToLandscapeRight     = true;
        Screen.autorotateToPortrait           = false;
        Screen.autorotateToPortraitUpsideDown = false;

        //加载UI
        GameObject launcherui = UnityEngine.Object.Instantiate(Resources.Load("UI/Login/UIPrefab/Launcher")) as GameObject;

        this.cLauncherUI = launcherui.AddComponent <CLauncherUI>();

        if (Application.isMobilePlatform)
        {
            GameObject exitui = UnityEngine.Object.Instantiate(Resources.Load("UI/Login/UIPrefab/ExitGame")) as GameObject;
            exitui.AddComponent <CExitGameUI>();
            Object.DontDestroyOnLoad(exitui);
        }

        StartLaunche();
    }