parent
c340de5e04
commit
d10f8146db
|
@ -2,6 +2,7 @@ using System;
|
||||||
using System.Collections;
|
using System.Collections;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
using System.Runtime.InteropServices;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
using UnityEngine.SceneManagement;
|
using UnityEngine.SceneManagement;
|
||||||
|
|
||||||
|
@ -34,23 +35,33 @@ public class CallForTest : MonoBehaviour
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 启动器传过来的服务器IP
|
/// 启动器传过来的服务器IP
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string ServerIP;
|
public string ServerIP;
|
||||||
|
|
||||||
|
[DllImport("user32.dll", EntryPoint = "FindWindow")]
|
||||||
|
private static extern IntPtr FindWindow(string lpClassName, string lpWindowName);
|
||||||
|
[DllImport("user32.dll")]
|
||||||
|
static extern IntPtr SetWindowPos(IntPtr hWnd, IntPtr hWndInsertAfter, int x, int y, int cx, int cy, uint wFlags);
|
||||||
|
const uint SWP_SHOWWINDOW = 0x0040;
|
||||||
|
const int HWND_TOPMOST = -1;
|
||||||
private void Awake()
|
private void Awake()
|
||||||
{
|
{
|
||||||
instance = this;
|
instance = this;
|
||||||
DontDestroyOnLoad(gameObject);
|
DontDestroyOnLoad(gameObject);
|
||||||
|
|
||||||
//#if UNITY_EDITOR
|
//#if UNITY_EDITOR
|
||||||
// Debug.unityLogger.logEnabled = true;
|
// Debug.unityLogger.logEnabled = true;
|
||||||
//#else
|
//#else
|
||||||
// Debug.unityLogger.logEnabled = false;
|
// Debug.unityLogger.logEnabled = false;
|
||||||
//#endif
|
//#endif
|
||||||
|
Debug.Log(Application.productName);
|
||||||
|
|
||||||
|
IntPtr ptr = FindWindow(null, Application.productName);
|
||||||
|
SetWindowPos(ptr, (IntPtr)HWND_TOPMOST, 0, 0, Screen.width, Screen.height, SWP_SHOWWINDOW);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void OnGUI()
|
private void OnGUI()
|
||||||
{
|
{
|
||||||
GUI.Label(new Rect(20, Screen.height-30, 200, 50), "v"+Application.version);
|
GUI.Label(new Rect(20, Screen.height - 30, 200, 50), "v" + Application.version);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void Start()
|
private void Start()
|
||||||
|
@ -60,35 +71,35 @@ public class CallForTest : MonoBehaviour
|
||||||
string code = infos.Find(a => a.StartsWith("code="));
|
string code = infos.Find(a => a.StartsWith("code="));
|
||||||
string enterprise_code = infos.Find(a => a.StartsWith("enterprise_code="));
|
string enterprise_code = infos.Find(a => a.StartsWith("enterprise_code="));
|
||||||
string config_value = infos.Find(a => a.StartsWith("config_value="));
|
string config_value = infos.Find(a => a.StartsWith("config_value="));
|
||||||
if(!string.IsNullOrEmpty(code))
|
if (!string.IsNullOrEmpty(code))
|
||||||
{
|
{
|
||||||
customCode = code.Replace("code=","");
|
customCode = code.Replace("code=", "");
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!string.IsNullOrEmpty(enterprise_code))
|
if (!string.IsNullOrEmpty(enterprise_code))
|
||||||
{
|
{
|
||||||
MONITOR_ID = enterprise_code.Replace("enterprise_code=","");
|
MONITOR_ID = enterprise_code.Replace("enterprise_code=", "");
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!string.IsNullOrEmpty(config_value))
|
if (!string.IsNullOrEmpty(config_value))
|
||||||
{
|
{
|
||||||
ServerIP=config_value.Replace("config_value=","");
|
ServerIP = config_value.Replace("config_value=", "");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (customCode=="3501")
|
if (customCode == "3501")
|
||||||
{
|
{
|
||||||
customName = CustomName.马尾海关;
|
customName = CustomName.马尾海关;
|
||||||
}
|
}
|
||||||
else if(customCode=="3502" || customCode=="3505")
|
else if (customCode == "3502" || customCode == "3505")
|
||||||
{
|
{
|
||||||
customName = CustomName.榕城海关;
|
customName = CustomName.榕城海关;
|
||||||
}
|
}
|
||||||
else if( customCode=="3503")
|
else if (customCode == "3503")
|
||||||
{
|
{
|
||||||
customName = CustomName.宁德海关;
|
customName = CustomName.宁德海关;
|
||||||
}
|
}
|
||||||
else if(customCode=="3506")
|
else if (customCode == "3506")
|
||||||
{
|
{
|
||||||
customName = CustomName.莆田海关;
|
customName = CustomName.莆田海关;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue