首页 > 代码库 > 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的游戏目录和游戏界面的切换
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。