Commit 4a32dfde authored by 潘梓豪's avatar 潘梓豪

更新

parent 411ee888
......@@ -84,4 +84,8 @@ MonoBehaviour:
- {fileID: 2800000, guid: 56f9aaa5749783944afbd2b05e09eba1, type: 3}
- {fileID: 21300000, guid: 56f9aaa5749783944afbd2b05e09eba1, type: 3}
- {fileID: 11500000, guid: 6aa1e65b952662c4db1073d32fa1a0aa, type: 3}
_Values: 7b3984e6e3131c3a2e49df665222b669a5d1ff93488b6f208275de66676a6f2a3297fea26c99d37b5f6558d8b0bed82cbea35bd209153c3462a700097cdd197717c4ca9ade77460a16cfbdab362de15b9c3ef3f1bdb1da47792e1234cebd647e7d3db6ff7c40f74678a45b442ff4ca65eb8322b064113c576b3f2ef877e2de5ab8536b930c5f1019eb9a31e79dfa066baa29636123cc2714ae529505ab0dfa0643c4ef012d48034b12eab983bfa43907ec4025594774ad61149bf2acc84f4e40346ea6edacc2804cfea435af0078bf35fa0e8f4f3993417e4c7148f47eab4d03266ad1444771bd4ea8d6dd783747cc2627daa9b6ade36f4f7f786684684780134b95c902679676474753a4b216befe5f67c078c096edfc792264fa94d7c1447c0adfd78de286e13c395a77638d4b653311e995ccf73e542e05846f04dc1d3e02bf1667b8b6fc5f024563f6801123770fa8dac044943be61ca2cb062f657a432f2f121c9bd402292548d4d8d02970b20142702d94d01cb8495bf320942acd6860d1be231066f800596387dacb10ef072aac12101209321b0406dd61c476c787227bd7713e70b4c34c8b8c271065e5520c6c5acee908699d2919d03a1c8a169751bf75b2d1b5b1532c5a0606e98b452518caf9be0ff564075cc01184cfb739c457407e1284cd53700b5bf3fcb3febebc381356cd32406a5103cd7613ef32c03255609aeef6eed6a0299dd9309c93a1014f0dc4616c6361f3161f0a47dad3390f1e2022e8a381b8cd10d3234a62e864ee35
- {fileID: 11500000, guid: 35bf0bd4ded61a34f9be34f6738e4010, type: 3}
- {fileID: 11500000, guid: 9f0449828438f1c4eb0712205cc11bb7, type: 3}
- {fileID: 11500000, guid: 3d4e6e40e0b637342b2b24b78259c2f5, type: 3}
- {fileID: 11500000, guid: 28957de3f3a43ab4c9295e3507bb4e9b, type: 3}
_Values: 7b3984e6e3131c3a2e49df665222b669a5d1ff93488b6f208275de66676a6f2a3297fea26c99d37b5f6558d8b0bed82cbea35bd209153c3462a700097cdd197717c4ca9ade77460a16cfbdab362de15b9c3ef3f1bdb1da47792e1234cebd647e7d3db6ff7c40f74678a45b442ff4ca65eb8322b064113c576b3f2ef877e2de5ab8536b930c5f1019eb9a31e79dfa066baa29636123cc2714ae529505ab0dfa0643c4ef012d48034b12eab983bfa43907ec4025594774ad61149bf2acc84f4e40346ea6edacc2804cfea435af0078bf35fa0e8f4f3993417e4c7148f47eab4d03266ad1444771bd4ea8d6dd783747cc2627daa9b6ade36f4f7f786684684780134b95c902679676474753a4b216befe5f67c078c096edfc792264fa94d7c1447c0adfd78de286e13c395a77638d4b653311e995ccf73e542e05846f04dc1d3e02bf1667b8b6fc5f024563f6801123770fa8dac044943be61ca2cb062f657a432f2f121c9bd402292548d4d8d02970b20142702d94d01cb8495bf320942acd6860d1be231066f800596387dacb10ef072aac12101209321b0406dd61c476c787227bd7713e70b4c34c8b8c271065e5520c6c5acee908699d2919d03a1c8a169751bf75b2d1b5b1532c5a0606e98b452518caf9be0ff564075cc01184cfb739c457407e1284cd53700b5bf3fcb3febebc381356cd32406a5103cd7613ef32c03255609aeef6eed6a0299dd9309c93a1014f0dc4616c6361f3161f0a47dad3390f1e2022e8a381b8cd10d3234a62e864ee35ac19063d3871085f41403aa66eeabf2727debe92be3aaa4da082f321cfa23834
......@@ -20,6 +20,8 @@ public class ButtonComponents : MonoBehaviour
public GameObject[] btn_compent;
public Button sms_btn;
RequestMethod requestMethod;
ZeusHub_Manager manager;
......
......@@ -9,7 +9,9 @@ public class PlceholdCompoents : MonoBehaviour, IPointerClickHandler, IPointerUp
public TMP_Text placeholder;
private string str = "";
public string str ;
// Start is called before the first frame update
IEnumerator Start()
......@@ -24,10 +26,15 @@ public class PlceholdCompoents : MonoBehaviour, IPointerClickHandler, IPointerUp
}
void Awake()
{
Debug.Log("唤醒");
}
public void OnPointerClick(PointerEventData eventData)
{
str = placeholder.text;
placeholder.text = "";
//placeholder.text = "";
}
public void OnPointerUp(PointerEventData eventData)
......@@ -37,10 +44,10 @@ public class PlceholdCompoents : MonoBehaviour, IPointerClickHandler, IPointerUp
void End(string val)
{
if (this.GetComponent<TMP_InputField>().text=="")
/* if (this.GetComponent<TMP_InputField>().text=="")
{
placeholder.text = str;
}
}*/
}
}
......@@ -24,18 +24,22 @@ public class RegisterButton : MonoBehaviour
ZeusHub_Manager manager;
public WelBorews welBorews;
public static RegisterButton registerButton;
IEnumerator Start()
{
yield return null;
registerButton = this;
requestMethod = RequestMethod.requestMethod;
if (!manager)
{
manager = ZeusHub_Manager.manager;
manager.OnReceiveMsg.AddListener(_onReceiveMsg);
manager.OnReceiveError.AddListener(_onReceiveErrorMsg);
}
{
manager = ZeusHub_Manager.manager;
//manager.OnReceiveMsg.AddListener(_onReceiveMsg);
//manager.OnReceiveError.AddListener(_onReceiveErrorMsg);
}
}
// Update is called once per frame
......@@ -44,110 +48,17 @@ public class RegisterButton : MonoBehaviour
}
protected void _onReceiveMsg(object data, string parameter)
{
load.SetActive(false);
RequestManager requestManager =(RequestManager)data;
if (requestManager.type.Equals("ValiDate"))
{
if (requestManager.result.Equals("true"))
{
var inputfiled = password.GetComponentInParent<TMP_InputField>();
string json = "{\"status\":\"\",\"roles\":\"\",\"access\":\"\",\"field_phone\":[{\"value\":\"" + TextTool.relacestr(username.text) + "\"}],\"code\":[{\"value\":\"" + TextTool.relacestr(smscode.text) + "\"}],\"name\":[{\"value\":\"" + TextTool.relacestr(username.text) + "\"}],\"pass\":[{\"value\":\"" + TextTool.relacestr(inputfiled.text) + "\"}]}";
StartCoroutine(requestMethod.PostDataJson(Setting.IP + "/zeus/sms/register?_format=json", json, 2, "RegisterData"));
}
else
{
msg.text = "该手机号已经注册";
}
}
if (requestManager.type.Equals("gettoken"))
{
Dictionary<string,object> token= JsonUntily.JsonToDictionary(requestManager.result);
manager.token = (string)token.Where(S => S.Key == "token_type").Select(S => S.Value).First()+" "
+ (string)token.Where(S => S.Key == "access_token").Select(S => S.Value).First();
//判断是否记住
if (remember_me.isOn)
{
PlayerPrefs.SetString("name", username.text);
PlayerPrefs.SetString("password", password.GetComponentInParent<TMP_InputField>().text);
PlayerPrefs.SetInt("ison", remember_me.isOn == true ? 1 : 2);
}
else
{
PlayerPrefs.DeleteKey("name");
PlayerPrefs.DeleteKey("password");
PlayerPrefs.DeleteKey("ison");
}
/* manager.token =(string)token.Where(S => S.Key == "access_token").Select(S => S.Value).First();*/
//跳转页面
startProcess();
}
if (requestManager.type.Equals("ProductionList"))
{
ProductionList productionList = JsonMapper.ToObject<ProductionList>( requestManager.result);
if (productionList.result.Length > 0)
{
foreach(Result item in productionList.result)
{
}
}
/* Dictionary<string,object[]> array = JsonUntily.JsonToDictionaryByArray(requestManager.result);
object[] list = array.Where(S => S.Key.Contains("result")).Select(S => S.Value).First();
if(list!=null && list.Length > 0)
{
for (int i = 0; i <list.Length; i++){
//JsonData jd= JsonMapper.ToObject((string)list[i]);
Dictionary<string,string> obj= JsonUntily.ObjectToMap(list[i]);
Debug.Log(obj.Where(S=>S.Key== "robot_code").Select(S=>S.Value).First());
}
}*/
}
if (requestManager.type.Equals("RegisterData"))
{
if (requestManager.result.Equals("\"Code expire\""))
{
msg.text = "验证码已过期";
}else if (requestManager.result.Equals("\"Code wrong\""))
{
msg.text = "验证码错误";
}
else
{
Dictionary<string, object[]> jsonData = JsonUntily.JsonToDictionaryByArray(requestManager.result);
if(jsonData!=null)
{
if(jsonData.Where(S => S.Key == "uid").Select(S => S.Value).First()!=null)
{
gettoken();
}
}
}
}
}
protected void _onReceiveErrorMsg(string error_str)
{
load.SetActive(false);
msg.text = "错误";
if (!error_str.Equals(""))
{
msg.text = "错误";
}
Debug.Log(error_str);
}
public void registrer()
......@@ -183,10 +94,15 @@ public class RegisterButton : MonoBehaviour
public void startProcess()
{
Dictionary<string, object> param = new Dictionary<string, object>();
param.Add("token", manager.token);
param.Add("robotcode", RobotCode.getMNum());
SceneMgr.ins.ToNewScene("MenuScene", param);
/* Dictionary<string, object> param = new Dictionary<string, object>();
param.Add("token", manager.token);
param.Add("robotcode", RobotCode.getMNum());
SceneMgr.ins.ToNewScene("MenuScene", param);*/
manager.SceneceAddress[1].SetActive(true);
welBorews.flush();
manager.SceneceAddress[0].SetActive(false);
}
public void gettoken() {
......
......@@ -20,7 +20,6 @@ public class RequestMethod:MonoBehaviour
public IEnumerator PostDataObject(string api,string content,int type)
{
Debug.Log("请求接口" + api);
while (!manager)
{
manager = ZeusHub_Manager.manager;
......@@ -43,6 +42,7 @@ public class RequestMethod:MonoBehaviour
byte[] bodyRaw = Encoding.UTF8.GetBytes(content);
rq.uploadHandler = new UploadHandlerRaw(bodyRaw);
yield return rq.SendWebRequest();
if (string.IsNullOrEmpty(rq.error))
{
RequestManager data = JsonMapper.ToObject<RequestManager>(rq.downloadHandler.text);
......@@ -51,6 +51,7 @@ public class RequestMethod:MonoBehaviour
}
else
{
Debug.Log($"错误{api}" + rq.error);
SimpleLoger.Log($"api:{api} {rq.error}");
manager.OnReceiveError.Invoke($"api:{api} {rq.error}");
//OnReceiveMsg.Invoke(new PlanData() { code = 0, result = new PlanData.Result() { planIncompleteCount = 10,planTotalCount=12 } }, $"{type},{time}");
......@@ -87,6 +88,8 @@ public class RequestMethod:MonoBehaviour
rq.uploadHandler = new UploadHandlerRaw(bodyRaw);
}
yield return rq.SendWebRequest();
if (string.IsNullOrEmpty(rq.error))
{
RequestManager data = new RequestManager();
......@@ -97,8 +100,8 @@ public class RequestMethod:MonoBehaviour
}
else
{
SimpleLoger.Log($"api:{api} {rq.error}");
manager.OnReceiveError.Invoke($"api:{api} {rq.error}");
SimpleLoger.Log($"api:{api} {rq.error}");
manager.OnReceiveError.Invoke($"api:{api} {rq.error}");
//OnReceiveMsg.Invoke(new PlanData() { code = 0, result = new PlanData.Result() { planIncompleteCount = 10,planTotalCount=12 } }, $"{type},{time}");
}
}
......@@ -107,7 +110,6 @@ public class RequestMethod:MonoBehaviour
public IEnumerator PostDataFormData(string api, WWWForm formData, string DataType)
{
Debug.Log("请求接口" + api);
while (!manager)
{
manager = ZeusHub_Manager.manager;
......@@ -120,6 +122,8 @@ public class RequestMethod:MonoBehaviour
rq.SetRequestHeader("Authorization", manager.token);
}
yield return rq.SendWebRequest();
if (string.IsNullOrEmpty(rq.error))
{
RequestManager data = new RequestManager();
......@@ -130,6 +134,8 @@ public class RequestMethod:MonoBehaviour
}
else
{
Debug.Log($"错误{api}" + rq.error);
SimpleLoger.Log($"api:{api} {rq.error}");
manager.OnReceiveError.Invoke($"api:{api} {rq.error}");
//OnReceiveMsg.Invoke(new PlanData() { code = 0, result = new PlanData.Result() { planIncompleteCount = 10,planTotalCount=12 } }, $"{type},{time}");
......@@ -154,6 +160,9 @@ public class RequestMethod:MonoBehaviour
rq.SetRequestHeader("Authorization", manager.token);
}
yield return rq.SendWebRequest();
if (string.IsNullOrEmpty(rq.error))
{
RequestManager data = new RequestManager();
......@@ -164,6 +173,8 @@ public class RequestMethod:MonoBehaviour
}
else
{
Debug.Log($"错误{api}" + rq.error);
SimpleLoger.Log($"api:{api} {rq.error}");
manager.OnReceiveError.Invoke($"api:{api} {rq.error}");
//OnReceiveMsg.Invoke(new PlanData() { code = 0, result = new PlanData.Result() { planIncompleteCount = 10,planTotalCount=12 } }, $"{type},{time}");
......
......@@ -36,36 +36,42 @@ public class SmsButton : MonoBehaviour
public void Send(TMP_Text phone)
{
if (TextTool.relacestr(phone.text) != "")
if (btn.GetComponentInChildren<TMP_Text>().text == "获取验证码")
{
StartCoroutine(requestMethod.GetDataJson(Setting.IP + "/zeus/sms/getsmscode/" + TextTool.relacestr(phone.text), "SmsCode"));
timer = 60;
}
else
{
while (!manager)
if (TextTool.relacestr(phone.text) != "")
{
manager = ZeusHub_Manager.manager;
StartCoroutine(requestMethod.GetDataJson(Setting.IP + "/zeus/sms/getsmscode/" + TextTool.relacestr(phone.text), "SmsCode"));
timer = 60;
}
else
{
while (!manager)
{
manager = ZeusHub_Manager.manager;
}
manager.msg.text = "请输入手机号码";
}
manager.msg.text= "请输入手机号码";
}
}
public void ResetSend(TMP_Text phone)
{
if (TextTool.relacestr(phone.text) != "")
if (btn.GetComponentInChildren<TMP_Text>().text == "获取验证码")
{
StartCoroutine(requestMethod.GetDataJson(Setting.IP + "/zeus/sms/getresetsmscode/" + TextTool.relacestr(phone.text), "SmsCode"));
timer = 60;
}
else
{
while (!manager)
if (TextTool.relacestr(phone.text) != "")
{
StartCoroutine(requestMethod.GetDataJson(Setting.IP + "/zeus/sms/getresetsmscode/" + TextTool.relacestr(phone.text), "SmsCode"));
timer = 60;
}
else
{
manager = ZeusHub_Manager.manager;
while (!manager)
{
manager = ZeusHub_Manager.manager;
}
manager.msg.text = "请输入手机号码";
}
manager.msg.text = "请输入手机号码";
}
}
}
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using TMPro;
using UnityEngine;
using UnityEngine.UI;
......@@ -19,17 +21,23 @@ public class ZeusHub_Manager : MonoBehaviour
public TMP_Text msg;
//
public string token = "";
public string token = "";
public TMP_Text username;
public TMP_Text username;
public TMP_Text password;
public TMP_Text password;
public Toggle remember_me;
public TMP_Text smscode;
public TMP_Text[] p;
public Toggle remember_me;
public GameObject load;
public GameObject load;
public GameObject[] SceneceAddress;
RegisterButton registerButton;
public Button sms_btn;
IEnumerator Start()
{
......@@ -37,20 +45,11 @@ public class ZeusHub_Manager : MonoBehaviour
{
//有的话,获取name的值
username.GetComponentInParent<TMP_InputField>().text = PlayerPrefs.GetString("name");
if (p.Length>0)
{
p[0].text = "";
}
}
if (PlayerPrefs.HasKey("password"))
{
password.GetComponentInParent<TMP_InputField>().text = PlayerPrefs.GetString("password");
if (p.Length > 0)
{
p[1].text = "";
}
}
if (PlayerPrefs.HasKey("ison"))
......@@ -60,7 +59,9 @@ public class ZeusHub_Manager : MonoBehaviour
manager = this;
manager.OnReceiveMsg.AddListener(_onReceiveMsg);
manager.OnReceiveError.AddListener(_onReceiveErrorMsg);
requestMethod = RequestMethod.requestMethod;
registerButton = RegisterButton.registerButton;
yield return null;
}
......@@ -71,14 +72,133 @@ public class ZeusHub_Manager : MonoBehaviour
}
private void Awake()
{
}
protected void _onReceiveMsg(object data, string parameter)
{
load.SetActive(false);
if (load != null)
{
load.SetActive(false);
}
RequestManager requestManager = (RequestManager)data;
if (data.GetType().Equals(typeof(RequestManager)))
{
manager.getMsg(data as RequestManager);
}
if (requestManager.type.Equals("ValiDate"))
{
if (requestManager.result.Equals("true"))
{
var inputfiled = password.GetComponentInParent<TMP_InputField>();
while (!requestMethod)
{
requestMethod = RequestMethod.requestMethod;
}
string json = "{\"status\":\"\",\"roles\":\"\",\"access\":\"\",\"field_phone\":[{\"value\":\"" + TextTool.relacestr(username.text) + "\"}],\"code\":[{\"value\":\"" + TextTool.relacestr(smscode.text) + "\"}],\"name\":[{\"value\":\"" + TextTool.relacestr(username.text) + "\"}],\"pass\":[{\"value\":\"" + TextTool.relacestr(inputfiled.text) + "\"}]}";
StartCoroutine(requestMethod.PostDataJson(Setting.IP + "/zeus/sms/register?_format=json", json, 2, "RegisterData"));
}
else
{
msg.text = "该手机号已经注册";
}
}
if (requestManager.type.Equals("gettoken"))
{
Dictionary<string, object> token = JsonUntily.JsonToDictionary(requestManager.result);
manager.token = (string)token.Where(S => S.Key == "token_type").Select(S => S.Value).First() + " "
+ (string)token.Where(S => S.Key == "access_token").Select(S => S.Value).First();
//判断是否记住
if (remember_me.isOn)
{
PlayerPrefs.SetString("name", username.text);
PlayerPrefs.SetString("password", password.GetComponentInParent<TMP_InputField>().text);
PlayerPrefs.SetInt("ison", remember_me.isOn == true ? 1 : 2);
}
else
{
PlayerPrefs.DeleteKey("name");
PlayerPrefs.DeleteKey("password");
PlayerPrefs.DeleteKey("ison");
}
/* manager.token =(string)token.Where(S => S.Key == "access_token").Select(S => S.Value).First();*/
while (!registerButton)
{
registerButton= RegisterButton.registerButton;
}
if (!remember_me.isOn)
{
password.GetComponentInParent<TMP_InputField>().text = "";
username.GetComponentInParent<TMP_InputField>().text = "";
}
Debug.Log("token"+manager.token);
msg.text = "";
smscode.GetComponentInParent<TMP_InputField>().text= "";
sms_btn.GetComponentInChildren<TMP_Text>().text = "获取验证码";
//跳转页面
registerButton.startProcess();
}
if (requestManager.type.Equals("RegisterData"))
{
if (requestManager.result.Equals("\"Code expire\""))
{
msg.text = "验证码已过期";
}
else if (requestManager.result.Equals("\"Code wrong\""))
{
msg.text = "验证码错误";
}
else
{
Dictionary<string, object[]> jsonData = JsonUntily.JsonToDictionaryByArray(requestManager.result);
if (jsonData != null)
{
if (jsonData.Where(S => S.Key == "uid").Select(S => S.Value).First() != null)
{
while (!registerButton)
{
registerButton = RegisterButton.registerButton;
}
registerButton.gettoken();
}
}
}
}
}
protected void _onReceiveErrorMsg(string error_str)
{
load.SetActive(false);
if (!error_str.Equals(""))
{
msg.text = "错误";
}
Debug.Log(error_str);
}
public void getMsg(RequestManager requestManager)
......
......@@ -4,8 +4,6 @@ using System.Collections;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using UnityEngine;
using UnityEngine.Networking;
using UnityEngine.SceneManagement;
......@@ -54,6 +52,10 @@ public class ValManager : MonoBehaviour
//通过机器码code、产品id判读是否已校验
using (var rq = UnityWebRequest.Get(IP + "/zeus/es3cloud/getRobotCode?productionid=" + productionid + "&code=" + code))
{
Debug.Log(productionid);
Debug.Log(code);
rq.SetRequestHeader("Authorization", (string)param.Where(S => S.Key == "token").Select(S => S.Value).First());
yield return rq.SendWebRequest();
if (string.IsNullOrEmpty(rq.error))
......
using System.Collections;
using TMPro;
using UnityEngine;
public delegate void NewTimerCallBack(params object[] l_objs);
public class MsgEvent : MonoBehaviour
{
// Start is called before the first frame update
public TMP_Text mP_Text;
private float timers;
public float wait_time;
private float b = 255;
Timer timer;
void Start()
{
/*timer = Timer.CreateTimer("TimerCtrl1");
timer.StartTimer(10, () =>
{
Debug.LogError("TimerCtrl1完成");
}, (time) => {
ClearMsg();
timer.ReStartTimer();
// Debug.LogError("TimerCtrl1:" + time);
});*/
StartCoroutine(MsgLift());
}
private void OnDestroy()
{
}
public void ClearMsg()
{
if (mP_Text.text != "")
{
if (timers >= wait_time)
{
mP_Text.text = "";
b = 255;
Color color = mP_Text.color;
color.a= Mathf.Lerp(1, 0, b);
mP_Text.color = color;
timers = 0;
}
else
{
b = b -50;
Color color = mP_Text.color;
color.a = Mathf.Lerp(1, 0, timers/wait_time);
mP_Text.color = color;
}
timers++;
}
}
IEnumerator MsgLift()
{
while (true)
{
if (mP_Text.text != "")
{
if (timers >= wait_time)
{
mP_Text.text = "";
b = 255;
Color color = mP_Text.color;
color.a = Mathf.Lerp(1, 0, b);
mP_Text.color = color;
timers = 0;
}
else
{
b = b - 50;
Color color = mP_Text.color;
color.a = Mathf.Lerp(1, 0, timers / wait_time);
mP_Text.color = color;
}
timers++;
}
yield return new WaitForSeconds(1);
}
}
}
fileFormatVersion: 2
guid: 28957de3f3a43ab4c9295e3507bb4e9b
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public delegate void TimerCompleteEvent();
public delegate void UpdateEvent(int t);
public class Timer : MonoBehaviour
{
/// <summary>
/// 完成委托
/// </summary>
TimerCompleteEvent del;
/// <summary>
/// 实时委托
/// </summary>
UpdateEvent updatedel;
/// <summary>
/// 总秒数
/// </summary>
private int second = 10;
/// <summary>
/// 上前的时间
/// </summary>
private int previous = 10;
/// <summary>
/// 开关
/// </summary>
public bool isopen = false;
/// <summary>
/// 计时使用
/// </summary>
private float totalTime = 0;
/// <summary>
/// 计时器
/// </summary>
private void Timers()
{
//累加每帧消耗时间
totalTime += Time.deltaTime;
if (second == 0)
{
if (del != null)
{
del();
}
StopTimer();
}
if (totalTime >= 1)//每过1秒执行一次
{
second--;
totalTime = 0;
if (updatedel != null) updatedel(second);
}
}
/// <summary>
/// 开启计时器
/// </summary>
public void StartTimer(int total, TimerCompleteEvent timedel, UpdateEvent update)
{
totalTime = 0;
second = total;
previous = total;
isopen = true;
del = timedel;
updatedel = update;
}
/// <summary>
/// 创建计时器
/// </summary>
/// <param name="name"></param>
/// <returns></returns>
public static Timer CreateTimer(string name)
{
GameObject m_currTimer = new GameObject(name);
Timer time = m_currTimer.AddComponent<Timer>();
return time;
}
/// <summary>
/// 暂停计时器
/// </summary>
public void PauseTimer()
{
isopen = false;
}
/// <summary>
/// 继续计时器
/// </summary>
public void Continue()
{
isopen = true;
}
/// <summary>
/// 重新计时
/// </summary>
public void ReStartTimer()
{
second = previous;
totalTime = 0;
}
/// <summary>
/// 停止计时
/// </summary>
public void StopTimer()
{
if (this == null) return;
isopen = false;
totalTime = 0;
del = null;
updatedel = null;
Destroy(gameObject);
}
private void Update()
{
if (isopen)
{
Timers();
}
}
}
fileFormatVersion: 2
guid: 5b5993edf41ac284c95dc24b5c081210
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
......@@ -32,19 +32,16 @@ public class WelBorews : MonoBehaviour
private void Start()
{
if (!manager)
{
manager = ZeusHub_Manager.manager;
}
downloadUntily = new DownloadUntily();
Dictionary<string, object> param = SceneMgr.ins.ReadSceneData();
token = (string)param.Where(S => S.Key == "token").Select(S => S.Value).First();
string robotcode= (string)param.Where(S => S.Key == "robotcode").Select(S => S.Value).First();
browser = GetComponent<Browser>();
/* Dictionary<string, object> param = SceneMgr.ins.ReadSceneData();
token = (string)param.Where(S => S.Key == "token").Select(S => S.Value).First();
string robotcode= (string)param.Where(S => S.Key == "robotcode").Select(S => S.Value).First();*/
//browser.Url = (new System.Uri(Path.Combine(Application.streamingAssetsPath, localAdress))).ToString();
browser.Url = localAddress+ "?token="+ token+ "&robotcode=" + robotcode;
browser.enabled = true;
/* browser = GetComponent<Browser>();
browser.Url = localAddress+ "?token="+ manager.token+ "&robotcode="+RobotCode.getMNum();
browser.enabled = true;*/
loadUserImage();
//StartCoroutine(_getProcessStart());
//this.InitData();
......@@ -68,6 +65,18 @@ public class WelBorews : MonoBehaviour
}
public void flush()
{
if (!manager)
{
manager = ZeusHub_Manager.manager;
}
browser = GetComponent<Browser>();
browser.Url = localAddress + "?token=" + manager.token + "&robotcode=" + RobotCode.getMNum();
browser.enabled = true;
}
private IEnumerator _getProcessStart()
{
string api = Setting.IP + "/zeus/es3cloud/getAutoSend";
......@@ -78,7 +87,7 @@ public class WelBorews : MonoBehaviour
{
if (token != null)
{
rq.SetRequestHeader("Authorization", token);
rq.SetRequestHeader("Authorization", manager.token);
}
yield return rq.SendWebRequest();
if (string.IsNullOrEmpty(rq.error))
......@@ -157,7 +166,7 @@ public class WelBorews : MonoBehaviour
//获取目录
//string jsonpath= System.IO.Path.GetDirectoryName(path)+ "\\ReqData.json";
//传入参数token和产品id
string json = "{\"token\":\"" + token + "\",\"productionid\":\"" + id + "\",\"filepath\":\"" + path.Substring(0, path.LastIndexOf("/")) + "\"}";
string json = "{\"token\":\"" + manager.token + "\",\"productionid\":\"" + id + "\",\"filepath\":\"" + path.Substring(0, path.LastIndexOf("/")) + "\"}";
//File.WriteAllText(jsonpath, json);
//项目路径再生成一个数据配置文件
......@@ -236,7 +245,13 @@ public class WelBorews : MonoBehaviour
public void loginout()
{
manager.token = null;
SceneManager.LoadScene("MyScene");
//SceneManager.LoadScene("MyScene");
manager.SceneceAddress[0].SetActive(true);
manager.password.text = "";
manager.username.text = "";
manager.msg.text = "";
manager.smscode.text = "";
manager.SceneceAddress[1].SetActive(false);
}
}
This diff is collapsed.
......@@ -282,7 +282,7 @@ MonoBehaviour:
m_Name:
m_EditorClassIdentifier:
IP:
text: {fileID: 0}
text: {fileID: 1316406082}
Setting:
App:
Title:
......
......@@ -762,11 +762,6 @@
<div class="col-sm-6">
<script>document.write(new Date().getFullYear())</script> © ZeusHub.
</div>
<div class="col-sm-6">
<div class="text-sm-end d-none d-sm-block">
Crafted with <i class="mdi mdi-heart text-danger"></i> By <a href="http://www.bootstrapmb.com/">bootstrapmb</a>
</div>
</div>
</div>
</div>
</footer>
......@@ -1053,6 +1048,7 @@
}
$(document).on("click",".loginout",function(){
document.cookie="";
loginout();
});
......@@ -1064,7 +1060,7 @@
}
}
</script>
</body>
......
......@@ -763,11 +763,6 @@
<div class="col-sm-6">
<script>document.write(new Date().getFullYear())</script> © ZeusHub.
</div>
<div class="col-sm-6">
<div class="text-sm-end d-none d-sm-block">
Crafted with <i class="mdi mdi-heart text-danger"></i> By <a href="http://www.bootstrapmb.com/">bootstrapmb</a>
</div>
</div>
</div>
</div>
</footer>
......@@ -1186,6 +1181,7 @@
}
$(document).on("click",".loginout",function(){
document.cookie="";
loginout();
});
......@@ -1197,6 +1193,7 @@
}
}
</script>
</body>
......
......@@ -7106,3 +7106,15 @@
2022/8/19 11:47:45 api:http://192.168.199.127:11011/oauth/token HTTP/1.1 401 Unauthorized
2022/8/19 15:28:56 api:http://192.168.199.127:11011/zeus/sms/register?_format=json HTTP/1.1 500 Internal Server Error
2022/8/19 15:29:38 api:http://192.168.199.127:11011/oauth/token HTTP/1.1 401 Unauthorized
2022/8/22 15:30:13 api:http://192.168.199.127:11011/zeus/sms/register?_format=json HTTP/1.1 500 Internal Server Error
2022/8/22 15:58:02 api:http://192.168.199.127:11011/zeus/sms/register?_format=json HTTP/1.1 500 Internal Server Error
2022/8/22 16:26:23 api:http://192.168.199.127:11011/zeus/sms/register?_format=json HTTP/1.1 500 Internal Server Error
2022/8/22 16:30:29 api:http://192.168.199.127:11011/zeus/sms/register?_format=json HTTP/1.1 500 Internal Server Error
2022/8/22 16:51:06 api:http://192.168.199.127:11011/zeus/sms/register?_format=json HTTP/1.1 500 Internal Server Error
2022/8/22 17:03:07 api:http://192.168.199.127:11011/zeus/sms/register?_format=json HTTP/1.1 500 Internal Server Error
2022/8/22 17:05:44 api:http://192.168.199.127:11011/zeus/sms/register?_format=json HTTP/1.1 500 Internal Server Error
2022/8/23 10:03:33 api:http://192.168.199.127:11011/oauth/token HTTP/1.1 401 Unauthorized
2022/8/23 14:54:11 api:http://192.168.199.127:11011/oauth/token HTTP/1.1 401 Unauthorized
2022/8/23 15:27:50 api:http://192.168.199.127:11011/oauth/token HTTP/1.1 401 Unauthorized
2022/8/23 15:37:46 api:http://192.168.199.127:11011/oauth/token HTTP/1.1 401 Unauthorized
2022/8/25 9:02:13 api:http://192.168.199.127:11011/oauth/token HTTP/1.1 401 Unauthorized
......@@ -23,7 +23,7 @@ EditorBuildSettings:
- enabled: 1
path: Assets/_Scenes/MyScene.unity
guid: ad00beddaf0f53d478ea0337c185c965
- enabled: 1
- enabled: 0
path: Assets/_Scenes/MenuScene.unity
guid: b87e722b4ee5bd74a8a99ffd6fa52fd1
m_configObjects: {}
......@@ -48,8 +48,8 @@ PlayerSettings:
m_SloganImage: {fileID: 0}
m_SloganHeight: 150
m_HolographicTrackingLossScreen: {fileID: 0}
defaultScreenWidth: 1024
defaultScreenHeight: 768
defaultScreenWidth: 1920
defaultScreenHeight: 1080
defaultScreenWidthWeb: 960
defaultScreenHeightWeb: 600
m_StereoRenderingPath: 0
......
{"token":"Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImp0aSI6ImU2OTlmYWQ3ZTJlNWU2ODI4YzMwMmMzNWRkN2Y3NWQ1MTFmOGZjYWZkNTI0MTZlY2U2M2VlODVhYjY5NTM3NjZiM2NlMjBhZmQ4NGEzMGU5In0.eyJhdWQiOiIyYmM1ZjE1Zi0wNzE3LTQ4ZjktYTc4Mi03NzQ5M2FjNDUwODQiLCJqdGkiOiJlNjk5ZmFkN2UyZTVlNjgyOGMzMDJjMzVkZDdmNzVkNTExZjhmY2FmZDUyNDE2ZWNlNjNlZTg1YWI2OTUzNzY2YjNjZTIwYWZkODRhMzBlOSIsImlhdCI6MTY2MDk2NTA1NSwibmJmIjoxNjYwOTY1MDU1LCJleHAiOjE2NjEyNjUwNTUsInN1YiI6IjgwMCIsInNjb3BlcyI6WyJhdXRoZW50aWNhdGVkIl19.GgXaOs3Pcy4am-4dhchC7Xz5RVreZ3-mOH6UwAs4SVN3OYpSHVWSAkyUxy-hQ05-6kpgmiXym9ecAhHgOuPJs0IaNTBKbLJCGGPzzNG0cC3L2nzYYcik0vHDwmf0IOEKH6VfghYqFUATSwZPz2yyWDMhccGaNPpMXOgIufz-F6BDAX9pJlyvBtmUjk3IkPZkaanror46ZzqNeZWzXI1xcV-PAArc4z7ZdTYK-ZP46LRdOsMRsJJwVEB93QESF_5NfkY_40Emqx-EvIu0FxTgHwbAXAGOEdCy-fHFV0SvGww58LDK65nDzjHMzaIDx1DPfDb7lCKPr2rqGq2oemR6VmXq2bS_w30F_UAOHH406iyYRW7uenbPv8OiNiwUQLEP1uF-NuYtpkNo6PYxfpUUXhtGcrsmTckTWurkZTHprZF1yxys1IESnasBpdK3cynBbUxW0t_HfvLQMQupWnmyerqj2fKarA7aRhnyRxf4Kj_xrS9TM6ywPiEsLHLxEkpmNIL1G9jnuxOGuXwuiekH96mru-m2VrFENEvggNL88g6iH0K85jFWO7DqkkX07I9s-HLIPqJRUcYUlCajt9ykd_mk5pZtHk2QYjLULO8iiXdLuXBJqSmbvfEXuPo03iIBylXQc3oKU8m_mhAp-BsU8fzYPA7RaYah-LmoUdX_iOw","productionid":"12698","filepath":"D://DownloadDemo/TIYANGUAN"}
\ No newline at end of file
{"token":"Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImp0aSI6IjQxZWQ1NTZlZjM2NzE4ZWQ2MjZkYjI1N2YzODJjNzVhNGQxZWZmYzk5ZmIxNmZlOWI1YzM3NGE1Y2Q2YzFhN2IxNDE1OTJmMWY2OWUxNDVhIn0.eyJhdWQiOiIyYmM1ZjE1Zi0wNzE3LTQ4ZjktYTc4Mi03NzQ5M2FjNDUwODQiLCJqdGkiOiI0MWVkNTU2ZWYzNjcxOGVkNjI2ZGIyNTdmMzgyYzc1YTRkMWVmZmM5OWZiMTZmZTliNWMzNzRhNWNkNmMxYTdiMTQxNTkyZjFmNjllMTQ1YSIsImlhdCI6MTY2MTI0MTMxMiwibmJmIjoxNjYxMjQxMzEyLCJleHAiOjE2NjE1NDEzMTIsInN1YiI6IjgzNiIsInNjb3BlcyI6WyJhdXRoZW50aWNhdGVkIl19.HEG49ki4AiO8NOlX2jTzPtjMFh6JoXskFPgSWxwkM5y0XocvEoQ0Vx9P7octNEDQEdQ3CTDvwDFt5Lw-C5IFeVgOe5_nDnaZpznNY9mSS9F1WfCmUFovp1N1gHbyDWcipUrTzllyd3-VPemI9cJv3om_4VbUVKWrCy14pmPwGQGYgY5ZlNHj7VYS24NO9E6IoEZZm9neqzNHRl0BoDSY7EYnC48jUyUtw5pHPfHBmMs_Mqbcl96ra8_MYA0EG2tXuEXc7O7BEFCIx7pf4RjGVceGgj2SloBhdlKlzpOgDQ9mKMBG7d0JjcPXXPUeYSiD9ayZDosHmrXTYAdecnaJ3wDwKclC7dYaymnPftRjAa2tg9uo-uUih40OXzw_UFvbsIq90r8QY_4opDuHNOEMPz2b6kP6rzubts2hNzMpF_0aTwqquoYK8xlm115-umtd_TwC85J2OCNhXVwRLmXKJxJFEyG39c7_77l6rUNhOK4ObH9u1HE3qAf-GPoxxzggrlKPqc51ksUyHWzAtJbJ3Splqe9qvHJsPizNN2r4Wz2QnTzpcY5qa4maDIzuCrp4mRTiL4EKVptTy-TdcRCg6_-kC0xgY1T6i6ypAlK2vSUqLaOvsPy3YHRZhqSod4iwt6fGw8zAMyXMohG59bidmDilAKeqSfrG-a3JcCLPv7w","productionid":"12698","filepath":"D://DownloadDemo/TIYANGUAN"}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment