641 lines
22 KiB
C#
641 lines
22 KiB
C#
using System;
|
||
using System.Collections;
|
||
using System.Collections.Generic;
|
||
using System.Diagnostics;
|
||
using System.Windows.Forms;
|
||
using TMPro;
|
||
using UnityEditor;
|
||
using UnityEngine;
|
||
using UnityEngine.UI;
|
||
|
||
public class buttonFunctionAdd : MonoBehaviour
|
||
{
|
||
public static buttonFunctionAdd Instance;
|
||
/// <summary>
|
||
/// UI组
|
||
/// </summary>
|
||
public List<GameObject> allButton;
|
||
/// <summary>
|
||
/// 图片未选中
|
||
/// </summary>
|
||
public List<Sprite> UnSelcet;
|
||
/// <summary>
|
||
/// 图片选中
|
||
/// </summary>
|
||
public List<Sprite> Selected;
|
||
/// <summary>
|
||
/// 展示UI
|
||
/// </summary>
|
||
public GameObject 展示;
|
||
/// <summary>
|
||
/// IDE面板
|
||
/// </summary>
|
||
public GameObject IDE面板;
|
||
/// <summary>
|
||
/// IDE未设置面板
|
||
/// </summary>
|
||
public GameObject IDE未设置;
|
||
/// <summary>
|
||
/// 项目目录设置面板
|
||
/// </summary>
|
||
public GameObject 项目目录;
|
||
/// <summary>
|
||
/// 开始按钮的打开exe的脚本
|
||
/// </summary>
|
||
public IDEsettingPanel 开始项目;
|
||
/// <summary>
|
||
/// 现在选择的模式
|
||
/// </summary>
|
||
public clean 目前模式;
|
||
/// <summary>
|
||
/// 原初始菜单的脚本
|
||
/// </summary>
|
||
public MainCanvasManager allFunction;
|
||
/// <summary>
|
||
/// 左侧UI中的开始按钮
|
||
/// </summary>
|
||
public UnityEngine.UI.Button 左侧_startButton;
|
||
/// <summary>
|
||
/// 左侧切换按钮
|
||
/// </summary>
|
||
public UnityEngine.UI.Button Button_切换;
|
||
/// <summary>
|
||
/// 提交实验按钮
|
||
/// </summary>
|
||
public UnityEngine.UI.Button Button_提交实验;
|
||
/// <summary>
|
||
/// 原来功能脚本
|
||
/// </summary>
|
||
public MenuPanel OldFunction;
|
||
/// <summary>
|
||
/// 新脚本功能
|
||
/// </summary>
|
||
public MenuPanel newFunction;
|
||
/// <summary>
|
||
/// 退出按钮
|
||
/// </summary>
|
||
public UnityEngine.UI.Button Button_退出;
|
||
/// <summary>
|
||
/// 退出菜单
|
||
/// </summary>
|
||
public GameObject 退出菜单;
|
||
/// <summary>
|
||
/// 退出菜单
|
||
/// </summary>
|
||
public GameObject 退出场景菜单;
|
||
/// <summary>
|
||
/// 取消按钮
|
||
/// </summary>
|
||
public UnityEngine.UI.Button Button_取消;
|
||
/// <summary>
|
||
/// 确认重置菜单
|
||
/// </summary>
|
||
public GameObject 确认重置菜单;
|
||
/// <summary>
|
||
/// 确认暂存代码到云端菜单
|
||
/// </summary>
|
||
public GameObject 确认暂存代码到云端菜单;
|
||
/// <summary>
|
||
/// 确认读取云端代码菜单
|
||
/// </summary>
|
||
public GameObject 确认读取云端代码菜单;
|
||
/// <summary>
|
||
/// 重置按钮
|
||
/// </summary>
|
||
public UnityEngine.UI.Button Button_重置;
|
||
/// <summary>
|
||
/// 录制UI
|
||
/// </summary>
|
||
public UnityEngine.UI.Button Button_录制结束;
|
||
/// <summary>
|
||
/// 暂存
|
||
/// </summary>
|
||
public UnityEngine.UI.Button Button_暂存;
|
||
/// <summary>
|
||
/// 读取
|
||
/// </summary>
|
||
public UnityEngine.UI.Button Button_读取;
|
||
/// <summary>
|
||
/// 进程变量
|
||
/// </summary>
|
||
public Process pro;
|
||
/// <summary>
|
||
/// 设置路径按钮
|
||
/// </summary>
|
||
public UnityEngine.UI.Button Button_设置路径;
|
||
/// <summary>
|
||
/// 小窗口的切换按钮
|
||
/// </summary>
|
||
public UnityEngine.UI.Button Button_小窗口切换;
|
||
//当前Unity程序进程
|
||
private static IntPtr currentWindow;
|
||
public WindowsTools winTool = new WindowsTools();
|
||
/// <summary>
|
||
/// 退出功能额外添加关闭各种服务
|
||
/// </summary>
|
||
public UnityEngine.UI.Button Button_退出确认;
|
||
/// <summary>
|
||
/// 暂存取消UI显示按钮
|
||
/// </summary>
|
||
public GameObject 暂存取消UI显示按钮;
|
||
/// <summary>
|
||
/// API文档菜单
|
||
/// </summary>
|
||
public GameObject API文档菜单;
|
||
/// <summary>
|
||
/// 任务列表
|
||
/// </summary>
|
||
public GameObject taskDetail;
|
||
/// <summary>
|
||
/// 确认提交按钮
|
||
/// </summary>
|
||
public UnityEngine.UI.Button 确认提交按钮;
|
||
/// <summary>
|
||
/// 确认提交菜单
|
||
/// </summary>
|
||
public GameObject 确认提交菜单;
|
||
/// <summary>
|
||
/// deepseek窗口
|
||
/// </summary>
|
||
public GameObject deepseek窗口;
|
||
// Start is called before the first frame update
|
||
void Start()
|
||
{
|
||
Instance = this;
|
||
//新添加得自由模式任务文档置灰功能
|
||
|
||
if (GameManager.current_main_menu_type == MainMenuType.自由编程)
|
||
{
|
||
allButton[0].GetComponent<UnityEngine.UI.Button>().enabled = false;
|
||
allButton[0].GetComponent<UnityEngine.UI.Image>().color = new Vector4(1f, 1f, 1f, 100f / 255f);
|
||
allButton[6].GetComponent<UnityEngine.UI.Button>().enabled = false;
|
||
allButton[6].GetComponent<UnityEngine.UI.Image>().color = new Vector4(1f, 1f, 1f, 100f / 255f);
|
||
}
|
||
|
||
for (int n = 0; n < allButton.Count; n++)
|
||
{
|
||
//直接用n作为参数会导致添加得方法得n出现问题,不知道为啥,改用switch来代替使用
|
||
//动态添加带参数得方法
|
||
//allButton[n].GetComponent<UnityEngine.UI.Button>().onClick.AddListener(delegate() { this.ChangePicture(n); });
|
||
switch (n)
|
||
{
|
||
case 0:
|
||
allButton[0].GetComponent<UnityEngine.UI.Button>().onClick.AddListener(delegate () { this.ChangePicture(0); });
|
||
allButton[0].GetComponent<UnityEngine.UI.Button>().onClick.AddListener(seset_);
|
||
allButton[0].GetComponent<UnityEngine.UI.Button>().onClick.AddListener(Function_总览);
|
||
break;
|
||
case 1:
|
||
allButton[1].GetComponent<UnityEngine.UI.Button>().onClick.AddListener(delegate () { this.ChangePicture(1); });
|
||
allButton[1].GetComponent<UnityEngine.UI.Button>().onClick.AddListener(seset_);
|
||
allButton[1].GetComponent<UnityEngine.UI.Button>().onClick.AddListener(Function_IDE设置);
|
||
break;
|
||
case 2:
|
||
allButton[2].GetComponent<UnityEngine.UI.Button>().onClick.AddListener(delegate () { this.ChangePicture(2); });
|
||
allButton[2].GetComponent<UnityEngine.UI.Button>().onClick.AddListener(seset_);
|
||
allButton[2].GetComponent<UnityEngine.UI.Button>().onClick.AddListener(Function_打开重置菜单);
|
||
break;
|
||
case 3:
|
||
allButton[3].GetComponent<UnityEngine.UI.Button>().onClick.AddListener(delegate () { this.ChangePicture(3); });
|
||
allButton[3].GetComponent<UnityEngine.UI.Button>().onClick.AddListener(seset_);
|
||
allButton[3].GetComponent<UnityEngine.UI.Button>().onClick.AddListener(Function_开始录屏);
|
||
break;
|
||
case 4:
|
||
allButton[4].GetComponent<UnityEngine.UI.Button>().onClick.AddListener(delegate () { this.ChangePicture(4); });
|
||
allButton[4].GetComponent<UnityEngine.UI.Button>().onClick.AddListener(seset_);
|
||
allButton[4].GetComponent<UnityEngine.UI.Button>().onClick.AddListener(Function_确认暂存代码到云端菜单);
|
||
break;
|
||
case 5:
|
||
allButton[5].GetComponent<UnityEngine.UI.Button>().onClick.AddListener(delegate () { this.ChangePicture(5); });
|
||
allButton[5].GetComponent<UnityEngine.UI.Button>().onClick.AddListener(seset_);
|
||
allButton[5].GetComponent<UnityEngine.UI.Button>().onClick.AddListener(Function_确认读取云端代码菜单);
|
||
break;
|
||
case 6:
|
||
allButton[6].GetComponent<UnityEngine.UI.Button>().onClick.AddListener(delegate () { this.ChangePicture(6); });
|
||
allButton[6].GetComponent<UnityEngine.UI.Button>().onClick.AddListener(seset_);
|
||
allButton[6].GetComponent<UnityEngine.UI.Button>().onClick.AddListener(Function_API文档);
|
||
break;
|
||
case 7:
|
||
allButton[7].GetComponent<UnityEngine.UI.Button>().onClick.AddListener(delegate () { this.ChangePicture(7); });
|
||
allButton[7].GetComponent<UnityEngine.UI.Button>().onClick.AddListener(seset_);
|
||
allButton[7].GetComponent<UnityEngine.UI.Button>().onClick.AddListener(Function_确认提交云端代码菜单);
|
||
break;
|
||
case 8:
|
||
allButton[8].GetComponent<UnityEngine.UI.Button>().onClick.AddListener(delegate () { this.ChangePicture(8); });
|
||
allButton[8].GetComponent<UnityEngine.UI.Button>().onClick.AddListener(seset_);
|
||
allButton[8].GetComponent<UnityEngine.UI.Button>().onClick.AddListener(Function_打开deepseek窗口);
|
||
break;
|
||
}
|
||
}
|
||
|
||
左侧_startButton.onClick.AddListener(Function_开始实验);
|
||
Button_切换.onClick.AddListener(Function_切换);
|
||
确认提交按钮.onClick.AddListener(Function_提交);
|
||
Button_退出.onClick.AddListener(() =>
|
||
{
|
||
退出场景菜单.SetActive(true);
|
||
UnityEngine.Debug.Log(退出场景菜单.transform.GetChild(1).name);
|
||
退出场景菜单.transform.GetChild(1).GetComponent<Text>().text = "是否退出当前场景";
|
||
});
|
||
|
||
Button_取消.onClick.AddListener(() =>
|
||
{
|
||
退出菜单.SetActive(false);
|
||
});
|
||
Button_重置.onClick.AddListener(Function_重置);
|
||
//添加录制结束功能
|
||
Button_录制结束.onClick.AddListener(Function_结束录屏);
|
||
Button_录制结束.transform.GetChild(0).GetComponent<UnityEngine.UI.Button>().onClick.AddListener(Function_结束录屏);
|
||
Button_读取.onClick.AddListener(Function_读取);
|
||
Button_暂存.onClick.AddListener(Function_暂存);
|
||
Button_小窗口切换.onClick.AddListener(Function_切换max);
|
||
Button_退出确认.onClick.AddListener(开始项目.kill);
|
||
暂存取消UI显示按钮.GetComponent<UnityEngine.UI.Button>().onClick.AddListener(disappear);
|
||
Invoke("delayOpen", 0.1f);
|
||
delayOpen();
|
||
}
|
||
|
||
public void disappear()
|
||
{
|
||
暂存取消UI显示按钮.transform.parent.gameObject.SetActive(false);
|
||
}
|
||
|
||
void delayOpen()
|
||
{
|
||
if (GameManager.current_main_menu_type == MainMenuType.课程任务)
|
||
{
|
||
Button_退出.gameObject.SetActive(false);
|
||
}
|
||
}
|
||
|
||
// Update is called once per frame
|
||
void Update()
|
||
{
|
||
if (GameManager.current_main_menu_type == MainMenuType.课程任务)
|
||
{
|
||
button_open();
|
||
}
|
||
}
|
||
|
||
|
||
private void button_open()
|
||
{
|
||
if (WebSocketServerManager.Instance.number != 0)
|
||
{
|
||
UnityEngine.Debug.Log(WebSocketServerManager.Instance.number + "1234");
|
||
allButton[4].GetComponent<UnityEngine.UI.Button>().enabled = false;
|
||
allButton[4].GetComponent<UnityEngine.UI.Image>().color = new Color(1f, 1f, 1f, 100f / 255f);
|
||
allButton[5].GetComponent<UnityEngine.UI.Button>().enabled = false;
|
||
allButton[5].GetComponent<UnityEngine.UI.Image>().color = new Color(1f, 1f, 1f, 100f / 255f);
|
||
allButton[7].GetComponent<UnityEngine.UI.Button>().enabled = false;
|
||
allButton[7].GetComponent<UnityEngine.UI.Image>().color = new Color(1f, 1f, 1f, 100f / 255f);
|
||
}
|
||
else
|
||
{
|
||
allButton[4].GetComponent<UnityEngine.UI.Button>().enabled = true;
|
||
allButton[4].GetComponent<UnityEngine.UI.Image>().color = new Color(1f, 1f, 1f, 1f);
|
||
allButton[5].GetComponent<UnityEngine.UI.Button>().enabled = true;
|
||
allButton[5].GetComponent<UnityEngine.UI.Image>().color = new Color(1f, 1f, 1f, 1f);
|
||
allButton[7].GetComponent<UnityEngine.UI.Button>().enabled = true;
|
||
allButton[7].GetComponent<UnityEngine.UI.Image>().color = new Color(1f, 1f, 1f, 1f);
|
||
}
|
||
}
|
||
|
||
public void Function_API文档()
|
||
{
|
||
if (allButton[6].GetComponent<Image>().sprite != UnSelcet[6])
|
||
{
|
||
API文档菜单.SetActive(true);
|
||
}
|
||
else
|
||
{
|
||
API文档菜单.SetActive(false);
|
||
}
|
||
}
|
||
|
||
public void IDE中开始按钮Function()
|
||
{
|
||
ChangePicture(1);
|
||
seset_();
|
||
Function_IDE设置();
|
||
currentWindow = WindowsTools.GetForegroundWindow();
|
||
if (GameManager.current_main_menu_type == MainMenuType.课程任务)
|
||
{
|
||
Button_提交实验.gameObject.SetActive(true);
|
||
allButton[4].GetComponent<UnityEngine.UI.Button>().enabled = true;
|
||
allButton[4].GetComponent<UnityEngine.UI.Image>().color = new Color(1f, 1f, 1f, 1f);
|
||
allButton[5].GetComponent<UnityEngine.UI.Button>().enabled = true;
|
||
allButton[5].GetComponent<UnityEngine.UI.Image>().color = new Color(1f, 1f, 1f, 1f);
|
||
}
|
||
//启用按钮
|
||
allButton[2].GetComponent<UnityEngine.UI.Button>().enabled = true;
|
||
allButton[2].GetComponent<UnityEngine.UI.Image>().color = new Color(1f, 1f, 1f, 1f);
|
||
allButton[3].GetComponent<UnityEngine.UI.Button>().enabled = true;
|
||
allButton[3].GetComponent<UnityEngine.UI.Image>().color = new Color(1f, 1f, 1f, 1f);
|
||
// 缩小视角
|
||
allFunction.OnMiniMode();
|
||
winTool.right(currentWindow);
|
||
//
|
||
start_roll();
|
||
//切换UI
|
||
左侧_startButton.gameObject.SetActive(false);
|
||
Button_切换.gameObject.SetActive(true);
|
||
}
|
||
|
||
public void ChangePicture(int M)
|
||
{
|
||
if (!allButton[M].GetComponent<SelectIn>().selected)
|
||
{
|
||
for (int n = 0; n < UnSelcet.Count; n++)
|
||
{
|
||
allButton[n].GetComponent<Image>().sprite = UnSelcet[n];
|
||
allButton[n].GetComponent<SelectIn>().selected = false;
|
||
}
|
||
allButton[M].GetComponent<Image>().sprite = Selected[M];
|
||
allButton[M].GetComponent<SelectIn>().selected = true;
|
||
}
|
||
else
|
||
{
|
||
for (int n = 0; n < UnSelcet.Count; n++)
|
||
{
|
||
allButton[n].GetComponent<Image>().sprite = UnSelcet[n];
|
||
allButton[n].GetComponent<SelectIn>().selected = false;
|
||
}
|
||
}
|
||
}
|
||
|
||
|
||
void ChangePicture_(int M)
|
||
{
|
||
UnityEngine.Debug.Log("你好");
|
||
for (int n = 0; n < UnSelcet.Count; n++)
|
||
{
|
||
allButton[n].GetComponent<Image>().sprite = UnSelcet[n];
|
||
if (n != 6 && n != 7)
|
||
{
|
||
allButton[n].GetComponent<SelectIn>().selected = false;
|
||
}
|
||
}
|
||
allButton[M].GetComponent<Image>().sprite = Selected[M];
|
||
allButton[M].GetComponent<SelectIn>().selected = true;
|
||
}
|
||
|
||
void Function_总览()
|
||
{
|
||
if (allButton[0].GetComponent<Image>().sprite != UnSelcet[0])
|
||
{
|
||
展示.SetActive(true);
|
||
}
|
||
else
|
||
{
|
||
展示.SetActive(false);
|
||
}
|
||
}
|
||
|
||
|
||
|
||
public void seset_()
|
||
{
|
||
展示.SetActive(false);
|
||
IDE面板.SetActive(false);
|
||
IDE未设置.SetActive(false);
|
||
确认重置菜单.SetActive(false);
|
||
确认暂存代码到云端菜单.SetActive(false);
|
||
确认读取云端代码菜单.SetActive(false);
|
||
项目目录.SetActive(false);
|
||
API文档菜单.SetActive(false);
|
||
确认提交菜单.SetActive(false);
|
||
deepseek窗口.SetActive(false);
|
||
}
|
||
|
||
void Function_IDE设置()
|
||
{
|
||
UnityEngine.Debug.Log("点击了IDE设置");
|
||
if (allButton[1].GetComponent<Image>().sprite != UnSelcet[1])
|
||
{
|
||
IDE面板.SetActive(true);
|
||
UnityEngine.Debug.Log("打开IDE面板");
|
||
}
|
||
else
|
||
{
|
||
IDE面板.SetActive(false);
|
||
IDE未设置.SetActive(false);
|
||
项目目录.SetActive(false);
|
||
UnityEngine.Debug.Log("关闭IDE面板");
|
||
}
|
||
}
|
||
|
||
void Function_开始实验()
|
||
{
|
||
currentWindow = WindowsTools.GetForegroundWindow();
|
||
//暂时禁用掉
|
||
if (GameManager.current_main_menu_type == MainMenuType.课程任务)
|
||
{
|
||
Button_提交实验.gameObject.SetActive(true);
|
||
allButton[4].GetComponent<UnityEngine.UI.Button>().enabled = true;
|
||
allButton[4].GetComponent<UnityEngine.UI.Image>().color = new Color(1f, 1f, 1f, 1f);
|
||
allButton[5].GetComponent<UnityEngine.UI.Button>().enabled = true;
|
||
allButton[5].GetComponent<UnityEngine.UI.Image>().color = new Color(1f, 1f, 1f, 1f);
|
||
}
|
||
//启用按钮
|
||
allButton[2].GetComponent<UnityEngine.UI.Button>().enabled = true;
|
||
allButton[2].GetComponent<UnityEngine.UI.Image>().color = new Color(1f, 1f, 1f, 1f);
|
||
allButton[3].GetComponent<UnityEngine.UI.Button>().enabled = true;
|
||
allButton[3].GetComponent<UnityEngine.UI.Image>().color = new Color(1f, 1f, 1f, 1f);
|
||
//缩小主视角
|
||
allFunction.OnMiniMode();
|
||
winTool.right(currentWindow);
|
||
//这里用来启用外部.exe
|
||
start_roll();
|
||
//切换UI
|
||
左侧_startButton.gameObject.SetActive(false);
|
||
Button_切换.gameObject.SetActive(true);
|
||
if (目前模式.nowChoose == "Python")
|
||
开始项目.RunPython();
|
||
if (目前模式.nowChoose == "Java")
|
||
开始项目.RunJava();
|
||
if (目前模式.nowChoose == "C")
|
||
开始项目.RunC();
|
||
}
|
||
|
||
public void Function_打开重置菜单()
|
||
{
|
||
if (allButton[2].GetComponent<Image>().sprite != UnSelcet[2])
|
||
{
|
||
确认重置菜单.SetActive(true);
|
||
}
|
||
else
|
||
{
|
||
确认重置菜单.SetActive(false);
|
||
}
|
||
}
|
||
|
||
public void Function_确认暂存代码到云端菜单()
|
||
{
|
||
if (allButton[4].GetComponent<Image>().sprite != UnSelcet[4])
|
||
{
|
||
确认暂存代码到云端菜单.SetActive(true);
|
||
}
|
||
else
|
||
{
|
||
确认暂存代码到云端菜单.SetActive(false);
|
||
}
|
||
}
|
||
|
||
public void Function_确认读取云端代码菜单()
|
||
{
|
||
if (allButton[5].GetComponent<Image>().sprite != UnSelcet[5])
|
||
{
|
||
确认读取云端代码菜单.SetActive(true);
|
||
}
|
||
else
|
||
{
|
||
确认读取云端代码菜单.SetActive(false);
|
||
}
|
||
}
|
||
|
||
public void Function_确认提交云端代码菜单()
|
||
{
|
||
if (allButton[7].GetComponent<Image>().sprite != UnSelcet[7])
|
||
{
|
||
确认提交菜单.SetActive(true);
|
||
}
|
||
else
|
||
{
|
||
确认提交菜单.SetActive(false);
|
||
}
|
||
}
|
||
|
||
public void Function_打开deepseek窗口()
|
||
{
|
||
if (allButton[8].GetComponent<Image>().sprite != UnSelcet[8])
|
||
{
|
||
deepseek窗口.SetActive(true);
|
||
}
|
||
else
|
||
{
|
||
deepseek窗口.SetActive(false);
|
||
}
|
||
}
|
||
|
||
void Function_开始录屏()
|
||
{
|
||
this.gameObject.SetActive(false);
|
||
Button_录制结束.gameObject.SetActive(true);
|
||
newFunction.StartVideoRecord();
|
||
}
|
||
|
||
void Function_结束录屏()
|
||
{
|
||
//UnityEngine.Debug.Log("whatfuck");
|
||
this.gameObject.SetActive(true);
|
||
Button_录制结束.gameObject.SetActive(false);
|
||
newFunction.StopVideoRecord();
|
||
}
|
||
|
||
//切换最小窗口
|
||
public void Function_切换()
|
||
{
|
||
start_roll();
|
||
//缩小主视角
|
||
allFunction.OnMiniMode();
|
||
winTool.right(currentWindow);
|
||
}
|
||
|
||
//切换最大窗口
|
||
public void Function_切换max()
|
||
{
|
||
//currentWindow = WindowsTools.GetForegroundWindow();
|
||
end_roll();
|
||
allFunction.OnMax();
|
||
winTool.old(currentWindow);
|
||
}
|
||
|
||
void Function_暂存()
|
||
{
|
||
buttonFunctionAdd.Instance.开始项目.kill();
|
||
确认暂存代码到云端菜单.SetActive(false);
|
||
OldFunction.OnStaging("暂存");
|
||
for (int n = 0; n < UnSelcet.Count; n++)
|
||
{
|
||
allButton[n].GetComponent<Image>().sprite = UnSelcet[n];
|
||
}
|
||
allButton[4].GetComponent<SelectIn>().selected = false;
|
||
}
|
||
|
||
void Function_读取()
|
||
{
|
||
确认读取云端代码菜单.SetActive(false);
|
||
OldFunction.OnDownload();
|
||
for (int n = 0; n < UnSelcet.Count; n++)
|
||
{
|
||
allButton[n].GetComponent<Image>().sprite = UnSelcet[n];
|
||
}
|
||
allButton[5].GetComponent<SelectIn>().selected = false;
|
||
}
|
||
|
||
void Function_提交()
|
||
{
|
||
确认提交菜单.SetActive(false);
|
||
OldFunction.OnSubmit();
|
||
for (int n = 0; n < UnSelcet.Count; n++)
|
||
{
|
||
allButton[n].GetComponent<Image>().sprite = UnSelcet[n];
|
||
}
|
||
allButton[7].GetComponent<SelectIn>().selected = false;
|
||
}
|
||
|
||
public void Function_重置()
|
||
{
|
||
确认重置菜单.SetActive(false);
|
||
OldFunction.OnResetScene();
|
||
for (int n = 0; n < UnSelcet.Count; n++)
|
||
{
|
||
allButton[n].GetComponent<Image>().sprite = UnSelcet[n];
|
||
}
|
||
allButton[2].GetComponent<SelectIn>().selected = false;
|
||
}
|
||
|
||
void start_roll()
|
||
{
|
||
if (GameManager.current_main_menu_type == MainMenuType.课程任务)
|
||
{
|
||
|
||
string _taskDetail="";
|
||
if (taskDetail.transform.childCount > 0)
|
||
for (int n = 0; n < taskDetail.transform.childCount; n++)
|
||
{
|
||
_taskDetail +="&&"+taskDetail.transform.GetChild(n).GetChild(0).GetChild(0).GetComponent<TextMeshProUGUI>().text;
|
||
//UnityEngine.Debug.Log(taskDetail.transform.GetChild(n).GetChild(0).GetChild(0).GetComponent<TextMeshPro>().text);
|
||
//UnityEngine.Debug.Log(taskDetail.transform.GetChild(n).GetChild(0).GetChild(0).GetComponent<TextMeshProUGUI>().text);
|
||
}
|
||
|
||
GameObject.Find("SceneManager").GetComponent<ProcessControl>().StartProcess("WithSubmitButton"+","+"taskdetail:"+ _taskDetail);
|
||
|
||
/* UnityEngine.Debug.Log("WithSubmitButton" + "," + "taskdetail:" + _taskDetail);*/
|
||
// ConsolePanel.ConsoleOutput("WithSubmitButton" + "," + "taskdetail:" + _taskDetail);
|
||
// ConsolePanel.ConsoleOutput("任务模式启动");
|
||
}
|
||
else
|
||
{
|
||
GameObject.Find("SceneManager").GetComponent<ProcessControl>().StartProcess("WithOutSubmitButton");
|
||
//ConsolePanel.ConsoleOutput("非任务模式启动");
|
||
}
|
||
}
|
||
|
||
void end_roll()
|
||
{
|
||
GameObject.Find("SceneManager").GetComponent<ProcessControl>().KillProcess();
|
||
}
|
||
|
||
private void OnApplicationQuit()
|
||
{
|
||
开始项目.kill();
|
||
}
|
||
|
||
private void OnDisable()
|
||
{
|
||
seset_();
|
||
}
|
||
}
|
||
|