增加时间GM工具
parent
50ed2b6656
commit
e9eb450514
|
|
@ -0,0 +1,57 @@
|
|||
using System;
|
||||
using Newtonsoft.Json;
|
||||
using UnityEngine;
|
||||
using UnityEditor;
|
||||
using System.Collections.Generic;
|
||||
|
||||
|
||||
public class GMPartTimePass : GMPart
|
||||
{
|
||||
CommonResult result;
|
||||
|
||||
string timePass;
|
||||
|
||||
public override string GetName()
|
||||
{
|
||||
return "时间穿越";
|
||||
}
|
||||
|
||||
public override void Init()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public override void OnTabGUI()
|
||||
{
|
||||
timePass = EditorGUILayout.TextField("穿越时间(秒):", timePass);
|
||||
}
|
||||
|
||||
public override void OnOKGUI()
|
||||
{
|
||||
EditorGUILayout.LabelField(result.message);
|
||||
}
|
||||
|
||||
public override string GetURL(string token, string ip, string actor)
|
||||
{
|
||||
return $"http://{ip}/time_pass?gm_token={token}&time={timePass}";
|
||||
}
|
||||
|
||||
public override uint DoJsonDeserialize(string json, out string message)
|
||||
{
|
||||
uint code = 0;
|
||||
try
|
||||
{
|
||||
result = JsonConvert.DeserializeObject<CommonResult>(json);
|
||||
message = result.message;
|
||||
code = result.code;
|
||||
}
|
||||
catch
|
||||
{
|
||||
Debug.LogError("json error, json=" + json);
|
||||
message = "json error, json=" + json;
|
||||
code = 1000;
|
||||
}
|
||||
|
||||
return code;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: ed3b6e9239a5b4ba79d950531217db6c
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
|
@ -18,6 +18,7 @@ public class GMWindow : EditorWindow, Gameplay.Net.IAppConfigHandler
|
|||
CharacterLikely,
|
||||
CharacterSkill,
|
||||
SendMail,
|
||||
TimePass,
|
||||
|
||||
Max,
|
||||
}
|
||||
|
|
@ -66,6 +67,7 @@ public class GMWindow : EditorWindow, Gameplay.Net.IAppConfigHandler
|
|||
parts[(int)TabType.CharacterLikely] = new GMPartCharacterLikely();
|
||||
parts[(int)TabType.CharacterSkill] = new GMPartCharacterSkillLevel();
|
||||
parts[(int)TabType.SendMail] = new GMPartSendMail();
|
||||
parts[(int)TabType.TimePass] = new GMPartTimePass();
|
||||
|
||||
ac = new Gameplay.Net.AppConfig();
|
||||
ac.Init();
|
||||
|
|
|
|||
Loading…
Reference in New Issue