You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
170 lines
5.7 KiB
170 lines
5.7 KiB
using AX.MessageSystem; |
|
using UnityEngine; |
|
using System.Collections; |
|
using UnityEngine.UI; |
|
using AX.TrackRecord; |
|
public class TeachModeSet : MonoBehaviour |
|
{ |
|
/// <summary> |
|
/// 授课学习 |
|
/// </summary> |
|
|
|
private bool Flag = true; |
|
private Animator Ani; |
|
private Button MyButton; |
|
private Toggle TheDraw;// 保存课件 |
|
private Toggle TheClear;// 一键清空 |
|
private Toggle TheHideName;// 隐藏名称 |
|
private Toggle TheTool;// 辅助工具 |
|
private Toggle TheExit;// 退出 |
|
public static TeachModeSet instance; |
|
private Text TheShowText; |
|
private GameObject Template;//辅助工具的父物体 |
|
private CeJuScript CeJu; |
|
private GameObject TimeZhou;//时间轴 |
|
private GameObject KeJianGame; |
|
void Awake() |
|
{ |
|
if (instance == null) |
|
{ |
|
instance = this; |
|
} |
|
//PrepareMode=7,//备课,自动开始轨迹记录 |
|
//TeachMode = 8,//授课模式 |
|
//ExamineMode=9,//考核模式 |
|
//SelfStudyMode=10,//自学模式 |
|
//PapeSetMode=11,//考卷设置模式 |
|
//CoursewareMode = 12//自学课件模式 |
|
} |
|
void Start () |
|
{ |
|
Ani = this.gameObject.GetComponent<Animator>(); |
|
MyButton = this.gameObject.transform.Find("模式").GetComponent<Button>(); |
|
MyButton.onClick.AddListener(PressBtn); |
|
TheDraw = this.gameObject.transform.Find("Grid").Find("画板").GetComponent<Toggle>(); |
|
TheClear = this.gameObject.transform.Find("Grid").Find("一键清空").GetComponent<Toggle>(); |
|
TheHideName = this.gameObject.transform.Find("Grid").Find("隐藏名称").GetComponent<Toggle>(); |
|
TheTool = this.gameObject.transform.Find("Grid").Find("辅助工具").GetComponent<Toggle>(); |
|
CeJu = TheTool.GetComponent<CeJuScript>(); |
|
TheExit = this.gameObject.transform.Find("Grid").Find("退出登录").GetComponent<Toggle>(); |
|
TheShowText = TheHideName.transform.Find("Background").Find("Text").GetComponent<Text>(); |
|
Template = TheTool.transform.Find("Template").gameObject; |
|
TimeZhou = GameObject.Find("Canvas").transform.Find("时间轴").gameObject; |
|
KeJianGame = GameObject.Find("Canvas").transform.Find("ToolbarObject").Find("NodeSelectWin").gameObject; |
|
TheDraw.onValueChanged.AddListener(TheDrawWay); |
|
TheClear.onValueChanged.AddListener(TheClearWay); |
|
TheHideName.onValueChanged.AddListener(TheHideNameWay); |
|
TheTool.onValueChanged.AddListener(TheToolWay); |
|
TheExit.onValueChanged.AddListener(TheExitWay); |
|
} |
|
|
|
public void PressBtn() |
|
{ |
|
if (Flag) |
|
{ |
|
Ani.CrossFade("TeachHide", 0); |
|
Flag = false; |
|
} |
|
else |
|
{ |
|
Ani.CrossFade("TeachShow", 0); |
|
Flag = true; |
|
} |
|
} |
|
public void TheDrawWay(bool check)// 画板 |
|
{ |
|
if (check) |
|
{ |
|
|
|
if (LoadManager.Instance.IsPlayBacking) |
|
{ |
|
TheBackView.instance.ZanTing(); |
|
TimeZhou.SetActive(false); |
|
} |
|
else |
|
{ |
|
KeJianGame.SetActive(false); |
|
} |
|
ShowDraw.instance.TheShowPlane(); |
|
DrawLinePlate.instance.CanDrawing = true; |
|
} |
|
else |
|
{ |
|
DrawLinePlate.instance.CanDrawing = false; |
|
if (LoadManager.Instance.IsPlayBacking) |
|
{ |
|
TimeZhou.SetActive(true); |
|
TheBackView.instance.BoFang(); |
|
} |
|
else |
|
{ |
|
KeJianGame.SetActive(true); |
|
} |
|
ShowDraw.instance.ClosePlane(); |
|
} |
|
} |
|
public void TheClearWay(bool check)// 一键清空 |
|
{ |
|
if (LoadManager.Instance.IsPlayBacking) |
|
{ |
|
MessageDispatcher.SendMessage("Operatinghints", (object)"回放无法清空"); |
|
return; |
|
} |
|
MessageDispatcher.SendMessage("DestroyObj", (object)"All"); |
|
MessageDispatcher.SendMessage("clearTrigger", (object)""); |
|
MessageDispatcher.SendMessage("ResetTheScene"); |
|
//InstantiationTool.Instance.RSDToggle.isOn = false; |
|
MessageDispatcher.SendMessage("ResettingButton"); |
|
MessageDispatcher.SendMessage("ShuiPaoMessage"); |
|
MessageDispatcher.SendMessage("Operatinghints", (object)"场景重置成功"); |
|
MessageDispatcher.SendMessage("RESET_OILTANKDISASTER_ATRRI", (object)"All");//重置所有罐体 |
|
} |
|
public void TheHideNameWay(bool check)// 隐藏名称 |
|
{ |
|
if (TheShowText.text == "隐藏名称") |
|
{ |
|
TheShowText.text = "显示名称"; |
|
UIController.instance.NameControl = false; |
|
MessageDispatcher.SendMessage("NameControl", (object)false); |
|
} |
|
else |
|
{ |
|
TheShowText.text = "隐藏名称"; |
|
UIController.instance.NameControl = true; |
|
MessageDispatcher.SendMessage("NameControl", (object)true); |
|
} |
|
} |
|
public void TheToolWay(bool check)// 辅助工具 |
|
{ |
|
if (check) |
|
{ |
|
Template.SetActive(true); |
|
} |
|
else |
|
{ |
|
Template.SetActive(false); |
|
CeJu.Set(); |
|
} |
|
} |
|
public void TheExitWay(bool check)// 退出 |
|
{ |
|
GameObject TipWindow = Instantiate(Resources.Load<GameObject>("UIPrefab/TipWindow")); |
|
TipWindow.GetComponent<TipWindowManager>().SetWindow( |
|
"是否退出场景?", new UnityEngine.Events.UnityAction(OKSubmit), new UnityEngine.Events.UnityAction(NOSubmit)); |
|
} |
|
private void OKSubmit() |
|
{ |
|
Back(); |
|
} |
|
private void NOSubmit() |
|
{ |
|
|
|
} |
|
public void Back() |
|
{ |
|
Cursor.visible = true; |
|
DrawLinePlate.instance.CanDrawing = false; |
|
MySceneManager.BackToLastScene(); |
|
} |
|
|
|
} |