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.
100 lines
2.6 KiB
100 lines
2.6 KiB
3 years ago
|
using UnityEngine;
|
||
|
using AX.MessageSystem;
|
||
|
using UnityEngine.UI;
|
||
|
using UnityEngine.SceneManagement;
|
||
|
using System.IO;
|
||
|
using System;
|
||
|
using System.Collections.Generic;
|
||
|
using System.Linq;
|
||
|
using System.Xml;
|
||
|
|
||
|
public class ControlCourse : MonoBehaviour
|
||
|
{
|
||
|
|
||
|
/// <summary>
|
||
|
/// 授课界面按钮控制脚本
|
||
|
/// </summary>
|
||
|
public static ControlCourse instance;
|
||
|
public CoursewareInfo Course;
|
||
|
public GameObject NodeFather;
|
||
|
[HideInInspector]
|
||
|
public GameObject Item;
|
||
|
void Awake()
|
||
|
{
|
||
|
if (instance == null)
|
||
|
{
|
||
|
instance = this;
|
||
|
}
|
||
|
Cursor.visible = true;
|
||
|
|
||
|
CreateXML();
|
||
|
//SmartController.Instance.Init();
|
||
|
}
|
||
|
public void CreateXML()
|
||
|
{
|
||
|
|
||
|
string namexml = Application.dataPath + @"/ExtendFolder/xml/CourseXML.xml";
|
||
|
|
||
|
if (!Directory.Exists(Application.dataPath+ @"/ExtendFolder/xml"))
|
||
|
{
|
||
|
Directory.CreateDirectory(Application.dataPath + @"/ExtendFolder/xml");
|
||
|
}
|
||
|
|
||
|
if (!File.Exists(namexml))
|
||
|
{
|
||
|
XmlDocument doc = new XmlDocument();
|
||
|
XmlDeclaration dec = doc.CreateXmlDeclaration("1.0", "UTF-8", null);
|
||
|
doc.AppendChild(dec);
|
||
|
//根
|
||
|
XmlElement root = doc.CreateElement("CourseNameList");
|
||
|
|
||
|
doc.AppendChild(root);
|
||
|
//创建节点(二级)
|
||
|
XmlElement Name = doc.CreateElement("CourseName");
|
||
|
root.AppendChild(Name);
|
||
|
|
||
|
doc.Save(Application.dataPath + @"/ExtendFolder/xml/CourseXML.xml");
|
||
|
Console.Write(doc.OuterXml);
|
||
|
}
|
||
|
}
|
||
|
|
||
|
public void LookItemBtn()//查看
|
||
|
{
|
||
|
if (!Item)
|
||
|
{//防止item没有被赋值
|
||
|
return;
|
||
|
}
|
||
|
//int Num = Course.SceneType;
|
||
|
int Num = 0;
|
||
|
NodeSet.Cousrsewse = Course;
|
||
|
if (SceneManager.GetActiveScene().name.Equals("PrepareLessons"))
|
||
|
{
|
||
|
ExamInfoHelpClass.loadSceneMode = ExamInfoHelpClass.LoadSceneMode.PrepareModeLook;
|
||
|
|
||
|
}
|
||
|
MySceneManager.MyLoadScene(Num.ToString());
|
||
|
}
|
||
|
|
||
|
public void EditItemBtn()//编辑
|
||
|
{
|
||
|
if (!Item)
|
||
|
{//防止预案不存在时,点击查看报空
|
||
|
return;
|
||
|
}
|
||
|
int Num = Course.SceneType;
|
||
|
NodeSet.Cousrsewse = Course;
|
||
|
if (SceneManager.GetActiveScene().name.Equals("PrepareLessons") ||
|
||
|
SceneManager.GetActiveScene().name.Equals("CourseBase"))
|
||
|
{
|
||
|
ExamInfoHelpClass.loadSceneMode = ExamInfoHelpClass.LoadSceneMode.EditCourceware;
|
||
|
|
||
|
}
|
||
|
MySceneManager.MyLoadScene(Num.ToString());
|
||
|
}
|
||
|
|
||
|
public void BackBtn()//返回按钮
|
||
|
{
|
||
|
|
||
|
}
|
||
|
|
||
|
}
|