反馈修改;

接入后端;
This commit is contained in:
lurenfei 2024-03-22 12:05:40 +08:00
parent e50d4e2d5c
commit 843f3defed
25 changed files with 4944 additions and 3444 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -858,7 +858,7 @@ Texture2D:
m_MipsStripped: 0
m_TextureFormat: 1
m_MipCount: 1
m_IsReadable: 0
m_IsReadable: 1
m_IsPreProcessed: 0
m_IgnoreMasterTextureLimit: 0
m_StreamingMipmaps: 0

View File

@ -1,7 +1,7 @@
fileFormatVersion: 2
guid: 2349056f9ee01d64eadb66f62c0ce66c
ModelImporter:
serializedVersion: 19300
serializedVersion: 21202
internalIDToNameTable: []
externalObjects: {}
materials:
@ -14,6 +14,7 @@ ModelImporter:
bakeSimulation: 0
resampleCurves: 1
optimizeGameObjects: 0
removeConstantScaleCurves: 0
motionNodeName:
rigImportErrors:
rigImportWarnings:
@ -31,7 +32,7 @@ ModelImporter:
extraExposedTransformPaths: []
extraUserProperties: []
clipAnimations: []
isReadable: 0
isReadable: 1
meshes:
lODScreenPercentages: []
globalScale: 1
@ -43,20 +44,27 @@ ModelImporter:
importBlendShapes: 1
importCameras: 1
importLights: 1
nodeNameCollisionStrategy: 0
fileIdsGeneration: 1
swapUVChannels: 0
generateSecondaryUV: 0
useFileUnits: 1
keepQuads: 0
weldVertices: 1
bakeAxisConversion: 0
preserveHierarchy: 0
skinWeightsMode: 0
maxBonesPerVertex: 4
minBoneWeight: 0.001
optimizeBones: 1
meshOptimizationFlags: -1
indexFormat: 0
secondaryUVAngleDistortion: 8
secondaryUVAreaDistortion: 15.000001
secondaryUVHardAngle: 88
secondaryUVMarginMethod: 1
secondaryUVMinLightmapResolution: 40
secondaryUVMinObjectScale: 1
secondaryUVPackMargin: 4
useFileScale: 1
tangentSpace:
@ -90,6 +98,7 @@ ModelImporter:
animationType: 2
humanoidOversampling: 1
avatarSetup: 0
addHumanoidExtraRootOnlyWhenUsingAvatar: 0
additionalBone: 0
userData:
assetBundleName:

File diff suppressed because it is too large Load Diff

View File

@ -40,20 +40,20 @@ public class CameraTween : MonoBehaviour
ResetCmaera(32);
MoveCameraByMouse.instance.target = GameObject.Find("设备点位").transform.Find("回转窑空压机房/fangzi");
}
if (name.Equals("1号生产线"))
if (name.Equals("号生产线"))
{
ResetCmaera(1);
MoveCameraByMouse.instance.target = GameObject.Find("设备点位").transform.Find("1号生产线/1号线回转窑");
MoveCameraByMouse.instance.target = GameObject.Find("设备点位").transform.Find("一号生产线/一号线回转窑");
}
if (name.Equals("2号生产线"))
if (name.Equals("号生产线"))
{
ResetCmaera(2);
MoveCameraByMouse.instance.target = GameObject.Find("设备点位").transform.Find("2号生产线/2号线回转窑");
MoveCameraByMouse.instance.target = GameObject.Find("设备点位").transform.Find("二号生产线/二号线回转窑");
}
if (name.Equals("3号生产线"))
if (name.Equals("号生产线"))
{
ResetCmaera(3);
MoveCameraByMouse.instance.target = GameObject.Find("设备点位").transform.Find("3号生产线/3号线回转窑");
MoveCameraByMouse.instance.target = GameObject.Find("设备点位").transform.Find("三号生产线/三号线回转窑");
}
if (name.Equals("破碎系统"))
{
@ -63,7 +63,7 @@ public class CameraTween : MonoBehaviour
if (name.Equals("生料系统"))
{
ResetCmaera(5);
MoveCameraByMouse.instance.target = GameObject.Find("设备点位").transform.Find("2号生产线/2号线生料磨");
MoveCameraByMouse.instance.target = GameObject.Find("设备点位").transform.Find("二号生产线/二号线生料磨");
}
if (name.Equals("水泥磨系统"))
{
@ -73,12 +73,12 @@ public class CameraTween : MonoBehaviour
if (name.Equals("回转窑系统"))
{
ResetCmaera(7);
MoveCameraByMouse.instance.target = GameObject.Find("设备点位").transform.Find("2号生产线/2号线回转窑");
MoveCameraByMouse.instance.target = GameObject.Find("设备点位").transform.Find("二号生产线/二号线回转窑");
}
if (name.Equals("煤磨系统"))
{
ResetCmaera(8);
MoveCameraByMouse.instance.target = GameObject.Find("设备点位").transform.Find("2号生产线/2号线煤磨");
MoveCameraByMouse.instance.target = GameObject.Find("设备点位").transform.Find("二号生产线/二号线煤磨");
}
if (name.Equals("总降电力室"))
{

View File

@ -0,0 +1,129 @@
using System;
using System.Collections;
using System.Collections.Generic;
using System.Text.RegularExpressions;
using System.Text;
using Unity.VisualScripting.Antlr3.Runtime;
using UnityEngine;
using UnityEngine.Networking;
using Newtonsoft.Json.Linq;
using Newtonsoft.Json.Serialization;
using Newtonsoft.Json;
public class ElectricityData
{
public int code { get; set; }
public string msg { get; set; }
public List<ElData> data { get; set; }
}
public class ElData
{
public float EH { get; set; }
public string State { get; set; }
public float P { get; set; }
}
public class CoalData
{
public int code { get; set; }
public string msg { get; set; }
public List<CoData> data { get; set; }
}
public class CoData
{
public float Coal { get; set; }
public string State { get; set; }
public float Carbon { get; set; }
}
public class WaterData
{
public int code { get; set; }
public string msg { get; set; }
public List<WaData> data { get; set; }
}
public class WaData
{
public float Water { get; set; }
public float OutletPressure { get; set; }
public float Speed { get; set; }
public float State { get; set; }
}
public enum GetType
{
Electricity,
Coal,
Water
}
public class ServerPort : MonoBehaviour
{
public static ServerPort Instance;
private const string UrlPath = "http://111.229.30.246:32761/api/";
private const string electricity = "GetFacilityInformation?name=";
private const string coal = "GetCoalEquipment?name=";
private const string water = "GetWaterEquipment?name=";
private void Awake()
{
Instance = this;
}
public void GetElectricity(string EquipmentName, Action<ElectricityData> actionResult)
{
ElectricityData temp = new ElectricityData();
StartCoroutine(Get(UrlPath + electricity + EquipmentName, g =>
{
temp = JsonConvert.DeserializeObject<ElectricityData>(g);
actionResult?.Invoke(temp);
}));
}
public void GetCoal(string EquipmentName, Action<CoalData> actionResult)
{
CoalData temp = new CoalData();
StartCoroutine(Get(UrlPath + coal + EquipmentName, g =>
{
temp = JsonConvert.DeserializeObject<CoalData>(g);
actionResult?.Invoke(temp);
}));
}
public void GetWater(string EquipmentName, Action<WaterData> actionResult)
{
WaterData temp = new WaterData();
StartCoroutine(Get(UrlPath + water + EquipmentName, g =>
{
temp = JsonConvert.DeserializeObject<WaterData>(g);
actionResult?.Invoke(temp);
}));
}
public IEnumerator Get(string path, Action<string> actionResult)
{
Debug.Log(string.Format("<b><color=#EDFF0B>[HttpGet]{0}</color></b>", "GetPath:" + path));
using (UnityWebRequest _request = new UnityWebRequest(path, UnityWebRequest.kHttpVerbGET))
{
_request.downloadHandler = new DownloadHandlerBuffer();
_request.SetRequestHeader("Content-Type", "application/json;charset=utf-8");
_request.timeout = 60;
UnityWebRequestAsyncOperation op = _request.SendWebRequest();
yield return op;
while (!op.isDone)
{
yield return null;
}
string result = "";
if (op.webRequest.isHttpError || op.webRequest.isNetworkError)
{
Debug.Log("Get web resource failed: " + path);
Debug.Log("ErrorCode: " + op.webRequest.responseCode);
Debug.Log("Path:" + path + op.webRequest.error);
}
else
{
result = op.webRequest.downloadHandler.text;
}
result = Regex.Unescape(result);
actionResult?.Invoke(result);
Debug.Log(string.Format("<b><color=#EDFF0B>[HttpGet]{0}</color></b>", result));
}
}
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 21d712c63fdfdd84a88ddfeb1fdc8377
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -48,7 +48,7 @@ public class ShowGroup : MonoBehaviour
public void Show(string name)
{
if (name.Contains("1号生产线"))
if (name.Contains("号生产线"))
{
Hide();
for (int i = 0; i < 线.Count; i++)
@ -62,9 +62,9 @@ public class ShowGroup : MonoBehaviour
m.Message = 线[i].name;
}
}
CameraTween.instance.MoveCameraToPos("1号生产线");
CameraTween.instance.MoveCameraToPos("号生产线");
}
else if (name.Contains("2号生产线"))
else if (name.Contains("号生产线"))
{
Hide();
for (int i = 0; i < 线.Count; i++)
@ -75,9 +75,9 @@ public class ShowGroup : MonoBehaviour
m.type = TipType.;
m.Message = 线[i].name;
}
CameraTween.instance.MoveCameraToPos("2号生产线");
CameraTween.instance.MoveCameraToPos("号生产线");
}
else if (name.Contains("3号生产线"))
else if (name.Contains("号生产线"))
{
Hide();
for (int i = 0; i < 线.Count; i++)
@ -88,7 +88,7 @@ public class ShowGroup : MonoBehaviour
m.type = TipType.;
m.Message = 线[i].name;
}
CameraTween.instance.MoveCameraToPos("3号生产线");
CameraTween.instance.MoveCameraToPos("号生产线");
}
else if (name.Contains("破碎系统"))

View File

@ -29,12 +29,31 @@ public class UITIP : MonoBehaviour
case TipType.:
go.transform.Find("水").gameObject.SetActive(true);
go.transform.Find("水/Name").GetComponent<TextMeshProUGUI>().text = Message;
go.transform.Find("水").GetComponent<UITIPData>().DatShow();
WaterData wd = new WaterData();
ServerPort.Instance.GetWater(Message, g =>
{
go.transform.Find("水").GetComponent<UITIPData>().Datas.Clear();
go.transform.Find("水").GetComponent<UITIPData>().Datas.Add(g.data[0].Water.ToString());
go.transform.Find("水").GetComponent<UITIPData>().Datas.Add(g.data[0].OutletPressure.ToString());
go.transform.Find("水").GetComponent<UITIPData>().Datas.Add(g.data[0].Speed.ToString());
go.transform.Find("水").GetComponent<UITIPData>().Datas.Add(g.data[0].State.ToString());
go.transform.Find("水").GetComponent<UITIPData>().DatShow();
});
break;
case TipType.:
go.transform.Find("电").gameObject.SetActive(true);
go.transform.Find("电/Name").GetComponent<TextMeshProUGUI>().text = Message;
go.transform.Find("电").GetComponent<UITIPData>().DatShow();
ElectricityData ed = new ElectricityData();
ServerPort.Instance.GetElectricity(Message, g =>
{
go.transform.Find("电").GetComponent<UITIPData>().Datas.Clear();
go.transform.Find("电").GetComponent<UITIPData>().Datas.Add(g.data[0].EH.ToString());
go.transform.Find("电").GetComponent<UITIPData>().Datas.Add(g.data[0].State.ToString());
go.transform.Find("电").GetComponent<UITIPData>().Datas.Add(g.data[0].P.ToString());
go.transform.Find("电").GetComponent<UITIPData>().DatShow();
});
break;
case TipType.:
go.transform.Find("煤").gameObject.SetActive(true);
@ -43,7 +62,15 @@ public class UITIP : MonoBehaviour
//{
// go.transform.Find("煤/videoBtn").gameObject.SetActive(true);
//}
go.transform.Find("煤").GetComponent<UITIPData>().DatShow();
CoalData cd = new CoalData();
ServerPort.Instance.GetCoal(Message, g =>
{
go.transform.Find("煤").GetComponent<UITIPData>().Datas.Clear();
go.transform.Find("煤").GetComponent<UITIPData>().Datas.Add(g.data[0].Coal.ToString());
go.transform.Find("煤").GetComponent<UITIPData>().Datas.Add(g.data[0].State.ToString());
go.transform.Find("煤").GetComponent<UITIPData>().Datas.Add(g.data[0].Carbon.ToString());
go.transform.Find("煤").GetComponent<UITIPData>().DatShow();
});
break;
default:
break;

View File

@ -7,7 +7,7 @@ using UnityEngine.UI;
public class UITIPData : MonoBehaviour
{
public TextMeshProUGUI[] textMeshProUGUIs;
public List<string> Datas;
public List<string> Datas = new List<string>();
void Start()
{

View File

@ -40,6 +40,8 @@ public class VideoCtl : MonoBehaviour
{
WebPoint.instance.enabled = true;
CameraState.enabled = true;
BrideWebView.Instance.webViewPrefab.WebView.PostMessage(gameObject.name);
Debug.Log("(C#Log)JSON Post:" + gameObject.name);
}
// Start is called before the first frame update
void Start()

View File

@ -13,35 +13,35 @@ public class VideoManager : MonoBehaviour
}
public void PostMessageToWeb()
{
if (isPostWeb)
{
BrideWebView.Instance.webViewPrefab.WebView.PostMessage("生产工艺");
Debug.Log("(C#Log)JSON Post:" + "生产工艺");
}
//if (isPostWeb)
//{
// BrideWebView.Instance.webViewPrefab.WebView.PostMessage("生产工艺");
// Debug.Log("(C#Log)JSON Post:" + "生产工艺");
//}
}
public void ShowVideo(string name)
{
if (name.Contains("生产工艺动画"))
if (name.Contains("生产工艺"))
{
Videos[0].SetActive(true);
isPostWeb = true;
}
else if (name.Contains("煤磨动画"))
else if (name.Contains("煤磨"))
{
Videos[1].SetActive(true);
isPostWeb = false;
}
else if (name.Contains("空压机动画"))
else if (name.Contains("空压机"))
{
Videos[2].SetActive(true);
isPostWeb = false;
}
else if (name.Contains("余热发电动画"))
else if (name.Contains("余热发电"))
{
Videos[3].SetActive(true);
isPostWeb = false;
}
else if (name.Contains("垃圾发电动画"))
else if (name.Contains("垃圾发电"))
{
Videos[4].SetActive(true);
isPostWeb = false;

View File

@ -1 +1 @@
http://localhost:8088/
http://localhost:8099/

Binary file not shown.

View File

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 5091148003c8e2f4690b2edc7fb5f0c0
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

Binary file not shown.

View File

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 1298e54dd6513774f82e1070519e4336
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

Binary file not shown.

View File

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: f3ce8b03adad05440931b8fc3279fd11
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

Binary file not shown.

View File

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: b428d447a62b093469e3f007dffd6966
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

Binary file not shown.

View File

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 76fb53b92d08ec947a7faaf4bf9b41bf
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.7 KiB

After

Width:  |  Height:  |  Size: 17 KiB