Exemplo n.º 1
0
            private void SetSize()
            {
                MainMenuCamera camera = UnityEngine.Object.FindObjectOfType <MainMenuCamera>();

                if (camera != null)
                {
                    camera.ReferencedBufferHeight = this._sizeList[this._ix];
                }
            }
Exemplo n.º 2
0
 // Use this for initialization
 void Start()
 {
     mmc = Camera.main.GetComponent <MainMenuCamera> ();
     play.onClick.AddListener(OnPlay);
     howTo.onClick.AddListener(OnHowTo);
     back.onClick.AddListener(OnBack);
     back.gameObject.SetActive(false);
     info.gameObject.SetActive(false);
 }
Exemplo n.º 3
0
    private void OnGUI()
    {
        MainMenuSkin.button.fontSize   = Screen.width / 40;
        MainMenuSkin.textArea.fontSize = Screen.width / 40;
        GUI.skin = MainMenuSkin;
        GUI.DrawTexture(new Rect(0, 0, Screen.width, Screen.height), bg, ScaleMode.StretchToFill, true, 0);
        GUILayout.BeginVertical();

        GUILayout.Space(upOffset);

        GUILayout.BeginHorizontal();
        GUILayout.Space(menuLeftOffset);
        start = GUILayout.Button("开始游戏", GUILayout.Width(menuWidth), GUILayout.Height(menuHeight));
        GUILayout.EndHorizontal();
        GUILayout.Space(menuUpOffset);

        GUILayout.BeginHorizontal();
        GUILayout.Space(menuLeftOffset);
        introduction = GUILayout.Button("游戏说明", GUILayout.Width(menuWidth), GUILayout.Height(menuHeight));
        GUILayout.EndHorizontal();
        GUILayout.Space(menuUpOffset);

        GUILayout.BeginHorizontal();
        GUILayout.Space(menuLeftOffset);
        exit = GUILayout.Button("退出游戏", GUILayout.Width(menuWidth), GUILayout.Height(menuHeight));
        GUILayout.EndHorizontal();

        GUILayout.EndVertical();

        for (int i = 0; i < windows.Count; ++i)
        {
            windows[i] = GUILayout.Window(i, (Rect)windows[i], showIntroduction, "游戏说明");
        }


        if (start)
        {
            MainMenuCamera.SetActive(false);
            MainCamera.SetActive(true);
            MainCamera.AddComponent <CreatePlayer>();
            MainCamera.AddComponent <MainControl>();
            musicControl.PlayMusic(1);
        }
        if (introduction)
        {
            windows.Add(new Rect(showLeftOffset, showUpOffset, showWidth, showHeight));
        }
        if (exit)
        {
            Application.Quit();
        }
    }
Exemplo n.º 4
0
    // Use this for initialization
    void Start()
    {
        menuCamera = Camera.main.GetComponent <MainMenuCamera>();
        centerScreenCameraPoint = centerScreenCameraTransform.position;
        focusCameraPoint        = Level.player.transform.position + Vector3.up;

        rotatePoint = focusCameraPoint;

        if (focusCamera)
        {
            menuCamera.transform.LookAt(focusCameraPoint);
        }

        else
        {
            menuCamera.transform.LookAt(centerScreenCameraPoint);
        }
    }
Exemplo n.º 5
0
 // Start is called before the first frame update
 void Awake()
 {
     mainMenuCamera = Camera.main.GetComponent <MainMenuCamera>();
 }