首页 > 代码库 > Unity的游戏目录和游戏界面的切换

Unity的游戏目录和游戏界面的切换

using UnityEngine;using System.Collections;public enum GameGrade{    EASE,    NORMAL,    DIFFCULTY}public enum ControlType {     KEYBOARD,    TOUCH,    MOUSE}public class GameSeeting : MonoBehaviour {    public  float volume=1;    public GameGrade grade = GameGrade.NORMAL;    public  ControlType controlType=ControlType.KEYBOARD;    public  bool isFullscreen=false;    public TweenPosition startPanelTween;    public TweenPosition optionPaneTween;    public void OnVolumeGameChanged() {        volume=UIProgressBar.current.value;        }    public void OnGameGradeChanged() {       print("onControlType:"+UIPopupList.current.value);        switch (UIPopupList.current.value.Trim()) {             case "一般":                grade = GameGrade.NORMAL;                break;            case "简单":                grade = GameGrade.EASE;                break;            case "困难":                grade = GameGrade.DIFFCULTY;                break;           }     }    public void OnControlTypeChanged() {      //  print("onControlType"+UIPopupList.current.value);        switch (UIPopupList.current.value.Trim())        {             case "键盘":                controlType = ControlType.KEYBOARD;                break;            case "触摸":                controlType=ControlType.TOUCH;                break;            case "鼠标":                controlType=ControlType.MOUSE;                break;        }       }    public void OnIsFullscreenChanged() {        print("OnIsFullscreen:"+UIToggle.current.value);        isFullscreen = UIToggle.current.value;        }    public void OnOptionClick() {        startPanelTween.PlayForward();        optionPaneTween.PlayForward();        }    public void OnCompleteSettingButtonClick() {        startPanelTween.PlayReverse();        optionPaneTween.PlayReverse();    }    }

 

Unity的游戏目录和游戏界面的切换