码迷,mamicode.com
首页 > 编程语言 > 详细

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

时间:2014-11-28 16:14:46      阅读:274      评论:0      收藏:0      [点我收藏+]

标签:style   blog   io   ar   color   os   sp   for   on   

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的游戏目录和游戏界面的切换

标签:style   blog   io   ar   color   os   sp   for   on   

原文地址:http://www.cnblogs.com/heisaijuzhen/p/4128545.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!