40 lines
945 B
C#
40 lines
945 B
C#
using UnityEngine;
|
|
using UnityEngine.UI;
|
|
using System.Runtime.InteropServices;
|
|
using YHElectric;
|
|
using System.Collections;
|
|
|
|
public class WebCommunication : MonoBehaviour
|
|
{
|
|
//[DllImport("__Internal")]
|
|
//private static extern void Hello();
|
|
void Start()
|
|
{
|
|
//Hello();
|
|
}
|
|
public void TestMethod(string text)
|
|
{
|
|
Debug.Log(text);
|
|
}
|
|
public static void CallWGL(string str)
|
|
{
|
|
|
|
Application.ExternalCall("CallWGLFunc", str);
|
|
|
|
//if(str== "function_zn")
|
|
//{
|
|
// GameManager.instance.OpenUAV();
|
|
//}
|
|
if (str == "function_zn")
|
|
{
|
|
GameManager.instance.modelLocation.TryGetValue("TopView", out Transform trans);
|
|
Camera.main.transform.position = trans.position;
|
|
Camera.main.transform.localEulerAngles = trans.localEulerAngles;
|
|
GameManager.instance.ShowAlarmEffect();
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|