最新制作提交

This commit is contained in:
高铎 2025-09-22 17:33:05 +08:00
parent cc3cdcc528
commit 6621b7c370
102 changed files with 14130 additions and 157 deletions

View File

@ -1,22 +0,0 @@
fileFormatVersion: 2
guid: 8c63d6118d83139469d7636db0eeaade
AudioImporter:
externalObjects: {}
serializedVersion: 6
defaultSettings:
loadType: 0
sampleRateSetting: 0
sampleRateOverride: 44100
compressionFormat: 1
quality: 1
conversionMode: 0
platformSettingOverrides: {}
forceToMono: 0
normalize: 1
preloadAudioData: 1
loadInBackground: 0
ambisonic: 0
3D: 1
userData:
assetBundleName:
assetBundleVariant:

View File

@ -1,22 +0,0 @@
fileFormatVersion: 2
guid: 47213da1f0d8d1b40a3930077a532c58
AudioImporter:
externalObjects: {}
serializedVersion: 6
defaultSettings:
loadType: 0
sampleRateSetting: 0
sampleRateOverride: 44100
compressionFormat: 1
quality: 1
conversionMode: 0
platformSettingOverrides: {}
forceToMono: 0
normalize: 1
preloadAudioData: 1
loadInBackground: 0
ambisonic: 0
3D: 1
userData:
assetBundleName:
assetBundleVariant:

Binary file not shown.

View File

@ -1,5 +1,22 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &-7747268588549636156
MonoBehaviour:
m_ObjectHideFlags: 1
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 4f10dd60657c6004587f237a7e90f8e4, type: 3}
m_Name: AudioPlayableAsset
m_EditorClassIdentifier:
m_Clip: {fileID: 8300000, guid: 6382f4fa4f2969844b200a26e20bd590, type: 3}
m_Loop: 0
m_bufferingTime: 0.1
m_ClipProperties:
volume: 1
--- !u!114 &-1858918028784899891
MonoBehaviour:
m_ObjectHideFlags: 1
@ -27,6 +44,7 @@ MonoBehaviour:
m_Version: 0
m_Tracks:
- {fileID: 1446110630248116281}
- {fileID: 5949171612449831720}
m_FixedDuration: 0
m_EditorSettings:
m_Framerate: 60
@ -58,7 +76,7 @@ MonoBehaviour:
m_Start: 0
m_ClipIn: 0
m_Asset: {fileID: -1858918028784899891}
m_Duration: 5
m_Duration: 26.136
m_TimeScale: 1
m_ParentTrack: {fileID: 1446110630248116281}
m_EaseInDuration: 0
@ -126,3 +144,99 @@ MonoBehaviour:
m_Markers:
m_Objects: []
m_PostPlaybackState: 3
--- !u!114 &5949171612449831720
MonoBehaviour:
m_ObjectHideFlags: 1
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 8b22792c3b570444eb18cb78c2af3a74, type: 3}
m_Name: Audio Track
m_EditorClassIdentifier:
m_Version: 3
m_AnimClip: {fileID: 0}
m_Locked: 0
m_Muted: 0
m_CustomPlayableFullTypename:
m_Curves: {fileID: 0}
m_Parent: {fileID: 11400000}
m_Children: []
m_Clips:
- m_Version: 1
m_Start: 0
m_ClipIn: 0
m_Asset: {fileID: -7747268588549636156}
m_Duration: 26.136
m_TimeScale: 1
m_ParentTrack: {fileID: 5949171612449831720}
m_EaseInDuration: 0
m_EaseOutDuration: 0
m_BlendInDuration: -1
m_BlendOutDuration: -1
m_MixInCurve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0
value: 0
inSlope: 0
outSlope: 0
tangentMode: 0
weightedMode: 0
inWeight: 0
outWeight: 0
- serializedVersion: 3
time: 1
value: 1
inSlope: 0
outSlope: 0
tangentMode: 0
weightedMode: 0
inWeight: 0
outWeight: 0
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
m_MixOutCurve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0
value: 1
inSlope: 0
outSlope: 0
tangentMode: 0
weightedMode: 0
inWeight: 0
outWeight: 0
- serializedVersion: 3
time: 1
value: 0
inSlope: 0
outSlope: 0
tangentMode: 0
weightedMode: 0
inWeight: 0
outWeight: 0
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
m_BlendInCurveMode: 0
m_BlendOutCurveMode: 0
m_ExposedParameterNames: []
m_AnimationCurves: {fileID: 0}
m_Recordable: 0
m_PostExtrapolationMode: 0
m_PreExtrapolationMode: 0
m_PostExtrapolationTime: 0
m_PreExtrapolationTime: 0
m_DisplayName: "\u914D\u97F31"
m_Markers:
m_Objects: []
m_TrackProperties:
volume: 1
stereoPan: 0
spatialBlend: 0

File diff suppressed because one or more lines are too long

View File

@ -1,5 +1,6 @@
fileFormatVersion: 2
guid: a3eed1b8bee1e2b4c99591384506adb4
guid: d73925a685211154cb8ea39d176f0718
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:

View File

@ -0,0 +1,63 @@
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
/// <summary>
/// 穿刺针对接硬件脚本
/// </summary>
public class ChuanCiZhen_SenSor : Sensor
{
/// <summary>
/// 进度值
/// </summary>
[HideInInspector]
public float progressValue;
/// <summary>
/// 旋转X
/// </summary>
[HideInInspector]
public float X;
/// <summary>
/// 旋转Y
/// </summary>
[HideInInspector]
public float Y;
/// <summary>
/// 旋转Z
/// </summary>
[HideInInspector]
public float Z;
[SerializeField]
Text txt;
private void Start()
{
transform.parent.GetComponent<SensorManager>().SendFunction("+++");
}
public override void ReceiveData(string datas)
{
base.ReceiveData(datas);
if (!datas.Split("OK")[0].Split("ID:")[1].Split(',')[0].Equals("CCZ")) return;
//this.Error(datas);
progressValue = (Convert.ToInt32(datas.Split("OK")[0].Split("LEVEL:")[1])) / 10.0f;
//this.Error($"当前穿刺针的拔出进度为:{progressValue}");
X = float.Parse(datas.Split("OK")[0].Split("PIT:")[1].Split(',')[0]);
Y = float.Parse(datas.Split("OK")[0].Split("YAW:")[1].Split(',')[0]);
Z = float.Parse(datas.Split("OK")[0].Split("ROL:")[1].Split(',')[0]);
this.Error($"当前旋转角度为:{X},{Y},{Z}");
}
public override void Display(string datas)
{
base.Display(datas);
txt.text = $"穿刺针进度:{progressValue},X:{X},Y:{Y},Z:{Z}";
}
}

View File

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

View File

@ -0,0 +1,53 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
/// <summary>
/// 棉签对接硬件脚本
/// </summary>
public class MianQian_SenSor : Sensor
{
/// <summary>
/// 旋转X
/// </summary>
[HideInInspector]
public float X;
/// <summary>
/// 旋转Y
/// </summary>
[HideInInspector]
public float Y;
/// <summary>
/// 旋转Z
/// </summary>
[HideInInspector]
public float Z;
[SerializeField]
Text txt;
private void Start()
{
transform.parent.GetComponent<SensorManager>().SendFunction("+++");
}
public override void ReceiveData(string datas)
{
base.ReceiveData(datas);
if (!datas.Split("OK")[0].Split("ID:")[1].Split(',')[0].Equals("MQ")) return;
//this.Error(datas);
X = float.Parse(datas.Split("OK")[0].Split("PIT:")[1].Split(',')[0]);
Y = float.Parse(datas.Split("OK")[0].Split("YAW:")[1].Split(',')[0]);
Z = float.Parse(datas.Split("OK")[0].Split("ROL:")[1].Split(',')[0]);
this.Error($"当前旋转角度为:{X},{Y},{Z}");
}
public override void Display(string datas)
{
base.Display(datas);
txt.text = $"棉签:X:{X},Y:{Y},Z:{Z}";
}
}

View File

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

View File

@ -0,0 +1,41 @@
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
/// <summary>
/// 10ml注射器对接硬件脚本
/// </summary>
public class ZhuSheQi_10SenSor : Sensor
{
/// <summary>
/// 进度值
/// </summary>
[HideInInspector]
public float progressValue;
[SerializeField]
Text txt;
private void Start()
{
transform.parent.GetComponent<SensorManager>().SendFunction("+++");
}
public override void ReceiveData(string datas)
{
base.ReceiveData(datas);
if (!datas.Split('%')[0].Split("ID:")[1].Split(',')[0].Equals("ZSQ10")) return;
//this.Error(datas);
progressValue = (Convert.ToInt32(datas.Split("%")[0].Split("LEVEL:")[1])) / 10.0f;
//this.Error($"当前10ml注射器的进度为{progressValue}");
}
public override void Display(string datas)
{
base.Display(datas);
txt.text = $"10ml注射器拉取进度:{progressValue}";
}
}

View File

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

View File

@ -0,0 +1,61 @@
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
/// <summary>
/// 20ml注射器对接硬件脚本
/// </summary>
public class ZhuSheQi_20SenSor : Sensor
{
/// <summary>
/// 进度值
/// </summary>
[HideInInspector]
public float progressValue;
[SerializeField]
Text txt;
[HideInInspector]
public bool isOpen;
private void Start()
{
transform.parent.GetComponent<SensorManager>().SendFunction("+++");
}
public override void ReceiveData(string datas)
{
base.ReceiveData(datas);
if (!datas.Split('%')[0].Split("ID:")[1].Split(',')[0].Equals("ZSQ20")) return;
lastTime = time;
//this.Error(datas);
progressValue = (Convert.ToInt32(datas.Split("%")[0].Split("LEVEL:")[1])) / 10.0f;
//this.Error($"当前20ml注射器的进度为{progressValue}");
}
float time;
float lastTime;
private void Update()
{
time += Time.deltaTime;
if (time - lastTime < 1.0f)
{
isOpen = true;
}
else
{
isOpen = false;
//progressValue = 0;
}
txt.text = $"20ml注射器开启:{isOpen}拉取进度:{progressValue}";
}
public override void Display(string datas)
{
base.Display(datas);
}
}

View File

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

View File

@ -0,0 +1,60 @@
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
/// <summary>
/// 50ml注射器对接硬件脚本
/// </summary>
public class ZhuSheQi_50SenSor : Sensor
{
/// <summary>
/// 进度值
/// </summary>
[HideInInspector]
public float progressValue;
[SerializeField]
Text txt;
public bool isOpen;
private void Start()
{
transform.parent.GetComponent<SensorManager>().SendFunction("+++");
}
public override void ReceiveData(string datas)
{
base.ReceiveData(datas);
if (!datas.Split('%')[0].Split("ID:")[1].Split(',')[0].Equals("ZSQ50")) return;
lastTime = time;
progressValue = (Convert.ToInt32(datas.Split("%")[0].Split("LEVEL:")[1])) / 10.0f;
//this.Error($"当前50ml注射器的进度为{progressValue}");
}
float time;
float lastTime;
private void Update()
{
time += Time.deltaTime;
if (time - lastTime < 1.0f)
{
isOpen = true;
}
else
{
isOpen = false;
//progressValue = 0;
}
txt.text = $"50ml注射器开启:{isOpen}拉取进度:{progressValue}";
}
public override void Display(string datas)
{
base.Display(datas);
}
}

View File

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

View File

@ -0,0 +1,42 @@
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
using ZXKFramework;
/// <summary>
/// 5ml注射器对接硬件脚本
/// </summary>
public class ZhuSheQi_5SenSor : Sensor
{
/// <summary>
/// 进度值
/// </summary>
[HideInInspector]
public float progressValue;
[SerializeField]
Text txt;
private void Start()
{
transform.parent.GetComponent<SensorManager>().SendFunction("+++");
}
public override void ReceiveData(string datas)
{
base.ReceiveData(datas);
if (!datas.Split('%')[0].Split("ID:")[1].Split(',')[0].Equals("ZSQ5")) return;
//this.Error(datas);
progressValue = ((Convert.ToInt32(datas.Split("%")[0].Split("LEVEL:")[1]))-3) / 7.0f;
//this.Error($"当前5ml注射器的进度为{progressValue}");
}
public override void Display(string datas)
{
base.Display(datas);
txt.text = $"5ml注射器拉取进度:{progressValue}";
}
}

View File

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

View File

@ -1,5 +1,6 @@
fileFormatVersion: 2
guid: 2922b72e9167ac04f9863f21afd18728
guid: 477adfb4edcb2de43b8e701c1a1f22d8
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:

View File

@ -0,0 +1,67 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class WeiGuanJianCe_SenSor : Sensor
{
public bool isBiQiang = false;
/// <summary>
/// 是否进入口咽部
/// </summary>
public bool isYanHou = false;
/// <summary>
/// 是否进入气管
/// </summary>
public bool isQiGuan = false;
int BiQiangNum = 0;
int YanHouNum = 0;
int QiGuanNum = 0;
public Text txt;
public override void ReceiveData(string datas)
{
base.ReceiveData(datas);
if (!datas.Split('%')[0].Split("ID:")[1].Split(',')[0].Equals("XTJC")) return;
if (datas.Contains("Channl:"))
{
string str = datas.Split("Channl:")[1].Split(',')[0];
this.Log($"检测的数据为:{datas.Split("Channl:")[1].Split(',')[0]}");
switch (str)
{
case "1":
BiQiangNum++;
break;
case "2":
YanHouNum++;
break;
case "3":
QiGuanNum++;
break;
default:
break;
}
isBiQiang = BiQiangNum % 2 != 0;
isYanHou = YanHouNum % 2 != 0;
isQiGuan = QiGuanNum % 2 != 0;
}
}
public void SetZero_WeiGuan()
{
BiQiangNum = 0;
YanHouNum = 0;
QiGuanNum = 0;
isBiQiang = false;
isYanHou = false;
isQiGuan = false;
txt.text = $"胃管:{isBiQiang}+{BiQiangNum},咽喉:{isYanHou}+{YanHouNum},气管:{isQiGuan}+{QiGuanNum}";
}
public override void Display(string datas)
{
base.Display(datas);
txt.text = $"胃管:{isBiQiang}+{BiQiangNum},咽喉:{isYanHou}+{YanHouNum},气管:{isQiGuan}+{QiGuanNum}";
}
}

View File

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

View File

@ -0,0 +1,25 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class WeiGuanZhiRu_SenSor : Sensor
{
[HideInInspector]
public int deep_Num;
public Text txt;
public override void ReceiveData(string datas)
{
base.ReceiveData(datas);
if (!datas.Contains("WBJC")) return;
deep_Num = int.Parse(datas.Split('%')[0].Split("Deep:")[1].Split("mm")[0]);
}
public override void Display(string datas)
{
base.Display(datas);
txt.text = $"θ¹ÜµÄ²åÈëÉî¶ÈΪ£º{deep_Num}";
}
}

View File

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

View File

@ -0,0 +1,68 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class WeiGuan_Sensor : Sensor
{
public Text txt;
/// <summary>
/// 是否插到了鼻孔
/// </summary>
[HideInInspector]
public bool isBiKong;
/// <summary>
/// 是否插到了喉咙
/// </summary>
[HideInInspector]
public bool isHouLong;
/// <summary>
/// 是否插到了胃部
/// </summary>
[HideInInspector]
public bool isWeiBu;
bool isChannl1;
bool isChannl2;
bool isChannl4;
public override void ReceiveData(string datas)
{
base.ReceiveData(datas);
if (!datas.Contains("WB")) return;
//this.Error($"胃管插入:{datas}");
string[] arrDatas = datas.Split('%')[0].Split(',');
for (int i = 0; i < arrDatas.Length; i++)
{
if (arrDatas[i].Contains("Channl:"))
{
if (arrDatas[i].Split("Channl:")[1].Equals("1"))
{
isChannl1 = !isChannl1;
}
if (arrDatas[i].Split("Channl:")[1].Equals("2"))
{
isChannl2 = !isChannl2;
}
if (arrDatas[i].Split("Channl:")[1].Equals("4"))
{
isChannl4 = !isChannl4;
}
}
}
isBiKong = isChannl1;
isHouLong = (isChannl1 && isChannl2);
isWeiBu = (isChannl1 && isChannl2 && isChannl4);
txt.text = $"胃管插到:鼻腔:{isBiKong},喉咙:{isHouLong},胃部:{isWeiBu}";
}
public override void Display(string datas)
{
base.Display(datas);
}
}

View File

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

2559
Assets/SensorConsole.prefab Normal file

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 5be1c66f31ec1984b82b396a7d7002dd
PrefabImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 2d803391b8505a24a97122dedaca3e46
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: eeb02cf842adb2640967e1fedd67f10a
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,646 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!29 &1
OcclusionCullingSettings:
m_ObjectHideFlags: 0
serializedVersion: 2
m_OcclusionBakeSettings:
smallestOccluder: 5
smallestHole: 0.25
backfaceThreshold: 100
m_SceneGUID: 00000000000000000000000000000000
m_OcclusionCullingData: {fileID: 0}
--- !u!104 &2
RenderSettings:
m_ObjectHideFlags: 0
serializedVersion: 9
m_Fog: 0
m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1}
m_FogMode: 3
m_FogDensity: 0.01
m_LinearFogStart: 0
m_LinearFogEnd: 300
m_AmbientSkyColor: {r: 0.212, g: 0.227, b: 0.259, a: 1}
m_AmbientEquatorColor: {r: 0.114, g: 0.125, b: 0.133, a: 1}
m_AmbientGroundColor: {r: 0.047, g: 0.043, b: 0.035, a: 1}
m_AmbientIntensity: 1
m_AmbientMode: 0
m_SubtractiveShadowColor: {r: 0.42, g: 0.478, b: 0.627, a: 1}
m_SkyboxMaterial: {fileID: 10304, guid: 0000000000000000f000000000000000, type: 0}
m_HaloStrength: 0.5
m_FlareStrength: 1
m_FlareFadeSpeed: 3
m_HaloTexture: {fileID: 0}
m_SpotCookie: {fileID: 10001, guid: 0000000000000000e000000000000000, type: 0}
m_DefaultReflectionMode: 0
m_DefaultReflectionResolution: 128
m_ReflectionBounces: 1
m_ReflectionIntensity: 1
m_CustomReflection: {fileID: 0}
m_Sun: {fileID: 0}
m_IndirectSpecularColor: {r: 0.12731749, g: 0.13414757, b: 0.1210787, a: 1}
m_UseRadianceAmbientProbe: 0
--- !u!157 &3
LightmapSettings:
m_ObjectHideFlags: 0
serializedVersion: 12
m_GIWorkflowMode: 1
m_GISettings:
serializedVersion: 2
m_BounceScale: 1
m_IndirectOutputScale: 1
m_AlbedoBoost: 1
m_EnvironmentLightingMode: 0
m_EnableBakedLightmaps: 1
m_EnableRealtimeLightmaps: 0
m_LightmapEditorSettings:
serializedVersion: 12
m_Resolution: 2
m_BakeResolution: 40
m_AtlasSize: 1024
m_AO: 0
m_AOMaxDistance: 1
m_CompAOExponent: 1
m_CompAOExponentDirect: 0
m_ExtractAmbientOcclusion: 0
m_Padding: 2
m_LightmapParameters: {fileID: 0}
m_LightmapsBakeMode: 1
m_TextureCompression: 1
m_FinalGather: 0
m_FinalGatherFiltering: 1
m_FinalGatherRayCount: 256
m_ReflectionCompression: 2
m_MixedBakeMode: 2
m_BakeBackend: 1
m_PVRSampling: 1
m_PVRDirectSampleCount: 32
m_PVRSampleCount: 512
m_PVRBounces: 2
m_PVREnvironmentSampleCount: 256
m_PVREnvironmentReferencePointCount: 2048
m_PVRFilteringMode: 1
m_PVRDenoiserTypeDirect: 1
m_PVRDenoiserTypeIndirect: 1
m_PVRDenoiserTypeAO: 1
m_PVRFilterTypeDirect: 0
m_PVRFilterTypeIndirect: 0
m_PVRFilterTypeAO: 0
m_PVREnvironmentMIS: 1
m_PVRCulling: 1
m_PVRFilteringGaussRadiusDirect: 1
m_PVRFilteringGaussRadiusIndirect: 5
m_PVRFilteringGaussRadiusAO: 2
m_PVRFilteringAtrousPositionSigmaDirect: 0.5
m_PVRFilteringAtrousPositionSigmaIndirect: 2
m_PVRFilteringAtrousPositionSigmaAO: 1
m_ExportTrainingData: 0
m_TrainingDataDestination: TrainingData
m_LightProbeSampleCountMultiplier: 4
m_LightingDataAsset: {fileID: 0}
m_LightingSettings: {fileID: 0}
--- !u!196 &4
NavMeshSettings:
serializedVersion: 2
m_ObjectHideFlags: 0
m_BuildSettings:
serializedVersion: 2
agentTypeID: 0
agentRadius: 0.5
agentHeight: 2
agentSlope: 45
agentClimb: 0.4
ledgeDropHeight: 0
maxJumpAcrossDistance: 0
minRegionArea: 2
manualCellSize: 0
cellSize: 0.16666667
manualTileSize: 0
tileSize: 256
accuratePlacement: 0
maxJobWorkers: 0
preserveTilesOutsideBounds: 0
debug:
m_Flags: 0
m_NavMeshData: {fileID: 0}
--- !u!1 &71307873
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 71307876}
- component: {fileID: 71307875}
- component: {fileID: 71307874}
m_Layer: 0
m_Name: EventSystem
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!114 &71307874
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 71307873}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 4f231c4fb786f3946a6b90b886c48677, type: 3}
m_Name:
m_EditorClassIdentifier:
m_SendPointerHoverToParent: 1
m_HorizontalAxis: Horizontal
m_VerticalAxis: Vertical
m_SubmitButton: Submit
m_CancelButton: Cancel
m_InputActionsPerSecond: 10
m_RepeatDelay: 0.5
m_ForceModuleActive: 0
--- !u!114 &71307875
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 71307873}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 76c392e42b5098c458856cdf6ecaaaa1, type: 3}
m_Name:
m_EditorClassIdentifier:
m_FirstSelected: {fileID: 0}
m_sendNavigationEvents: 1
m_DragThreshold: 10
--- !u!4 &71307876
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 71307873}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &330585543
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 330585546}
- component: {fileID: 330585545}
- component: {fileID: 330585544}
- component: {fileID: 330585547}
m_Layer: 0
m_Name: Main Camera
m_TagString: MainCamera
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!81 &330585544
AudioListener:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 330585543}
m_Enabled: 1
--- !u!20 &330585545
Camera:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 330585543}
m_Enabled: 1
serializedVersion: 2
m_ClearFlags: 1
m_BackGroundColor: {r: 0.19215687, g: 0.3019608, b: 0.4745098, a: 0}
m_projectionMatrixMode: 1
m_GateFitMode: 2
m_FOVAxisMode: 0
m_SensorSize: {x: 36, y: 24}
m_LensShift: {x: 0, y: 0}
m_FocalLength: 50
m_NormalizedViewPortRect:
serializedVersion: 2
x: 0
y: 0
width: 1
height: 1
near clip plane: 0.3
far clip plane: 1000
field of view: 60
orthographic: 0
orthographic size: 5
m_Depth: -1
m_CullingMask:
serializedVersion: 2
m_Bits: 4294967295
m_RenderingPath: -1
m_TargetTexture: {fileID: 0}
m_TargetDisplay: 0
m_TargetEye: 3
m_HDR: 1
m_AllowMSAA: 1
m_AllowDynamicResolution: 0
m_ForceIntoRT: 0
m_OcclusionCulling: 1
m_StereoConvergence: 10
m_StereoSeparation: 0.022
--- !u!4 &330585546
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 330585543}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 1, z: -10}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &330585547
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 330585543}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: a79441f348de89743a2939f4d699eac1, type: 3}
m_Name:
m_EditorClassIdentifier:
m_RenderShadows: 1
m_RequiresDepthTextureOption: 2
m_RequiresOpaqueTextureOption: 2
m_CameraType: 0
m_Cameras: []
m_RendererIndex: -1
m_VolumeLayerMask:
serializedVersion: 2
m_Bits: 1
m_VolumeTrigger: {fileID: 0}
m_VolumeFrameworkUpdateModeOption: 2
m_RenderPostProcessing: 1
m_Antialiasing: 0
m_AntialiasingQuality: 2
m_StopNaN: 0
m_Dithering: 0
m_ClearDepth: 1
m_AllowXRRendering: 1
m_RequiresDepthTexture: 0
m_RequiresColorTexture: 0
m_Version: 2
--- !u!1 &330895702 stripped
GameObject:
m_CorrespondingSourceObject: {fileID: 2354870448391347380, guid: 1a1201bb09fe35a4ba7a1d787be0c122,
type: 3}
m_PrefabInstance: {fileID: 2354870448281023138}
m_PrefabAsset: {fileID: 0}
--- !u!1 &878783925
GameObject:
m_ObjectHideFlags: 11
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 878783927}
- component: {fileID: 878783926}
m_Layer: 0
m_Name: Prefab Indexer
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!114 &878783926
MonoBehaviour:
m_ObjectHideFlags: 11
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 878783925}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 05a7c62fccbafd342991629222351294, type: 3}
m_Name:
m_EditorClassIdentifier:
_scenePrefabInstances:
- _gameObject: {fileID: 330895702}
_prefab: Assets/SensorModule/SensorConsole.prefab
--- !u!4 &878783927
Transform:
m_ObjectHideFlags: 11
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 878783925}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 3
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1001 &2354870448281023138
PrefabInstance:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
m_TransformParent: {fileID: 0}
m_Modifications:
- target: {fileID: 1538575156, guid: 1a1201bb09fe35a4ba7a1d787be0c122, type: 3}
propertyPath: m_AnchorMax.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1538575156, guid: 1a1201bb09fe35a4ba7a1d787be0c122, type: 3}
propertyPath: m_AnchorMin.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1538575156, guid: 1a1201bb09fe35a4ba7a1d787be0c122, type: 3}
propertyPath: m_SizeDelta.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1538575156, guid: 1a1201bb09fe35a4ba7a1d787be0c122, type: 3}
propertyPath: m_AnchoredPosition.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1538575156, guid: 1a1201bb09fe35a4ba7a1d787be0c122, type: 3}
propertyPath: m_AnchoredPosition.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1551160554, guid: 1a1201bb09fe35a4ba7a1d787be0c122, type: 3}
propertyPath: m_IsActive
value: 1
objectReference: {fileID: 0}
- target: {fileID: 1551160555, guid: 1a1201bb09fe35a4ba7a1d787be0c122, type: 3}
propertyPath: m_AnchorMax.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1551160555, guid: 1a1201bb09fe35a4ba7a1d787be0c122, type: 3}
propertyPath: m_AnchorMin.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1551160555, guid: 1a1201bb09fe35a4ba7a1d787be0c122, type: 3}
propertyPath: m_SizeDelta.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1551160555, guid: 1a1201bb09fe35a4ba7a1d787be0c122, type: 3}
propertyPath: m_SizeDelta.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1551160555, guid: 1a1201bb09fe35a4ba7a1d787be0c122, type: 3}
propertyPath: m_AnchoredPosition.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1551160555, guid: 1a1201bb09fe35a4ba7a1d787be0c122, type: 3}
propertyPath: m_AnchoredPosition.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 2131783165, guid: 1a1201bb09fe35a4ba7a1d787be0c122, type: 3}
propertyPath: m_AnchorMax.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 2131783165, guid: 1a1201bb09fe35a4ba7a1d787be0c122, type: 3}
propertyPath: m_AnchorMin.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 2131783165, guid: 1a1201bb09fe35a4ba7a1d787be0c122, type: 3}
propertyPath: m_SizeDelta.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 2131783165, guid: 1a1201bb09fe35a4ba7a1d787be0c122, type: 3}
propertyPath: m_AnchoredPosition.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 2131783165, guid: 1a1201bb09fe35a4ba7a1d787be0c122, type: 3}
propertyPath: m_AnchoredPosition.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 2354870447667348738, guid: 1a1201bb09fe35a4ba7a1d787be0c122,
type: 3}
propertyPath: m_AnchorMax.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 2354870447667348738, guid: 1a1201bb09fe35a4ba7a1d787be0c122,
type: 3}
propertyPath: m_AnchorMin.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 2354870447667348738, guid: 1a1201bb09fe35a4ba7a1d787be0c122,
type: 3}
propertyPath: m_SizeDelta.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 2354870447667348738, guid: 1a1201bb09fe35a4ba7a1d787be0c122,
type: 3}
propertyPath: m_SizeDelta.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 2354870447667348738, guid: 1a1201bb09fe35a4ba7a1d787be0c122,
type: 3}
propertyPath: m_AnchoredPosition.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 2354870447667348738, guid: 1a1201bb09fe35a4ba7a1d787be0c122,
type: 3}
propertyPath: m_AnchoredPosition.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 2354870447667348797, guid: 1a1201bb09fe35a4ba7a1d787be0c122,
type: 3}
propertyPath: m_IsActive
value: 0
objectReference: {fileID: 0}
- target: {fileID: 2354870447797163002, guid: 1a1201bb09fe35a4ba7a1d787be0c122,
type: 3}
propertyPath: m_AnchorMax.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 2354870447797163002, guid: 1a1201bb09fe35a4ba7a1d787be0c122,
type: 3}
propertyPath: m_AnchorMin.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 2354870447797163002, guid: 1a1201bb09fe35a4ba7a1d787be0c122,
type: 3}
propertyPath: m_SizeDelta.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 2354870447797163002, guid: 1a1201bb09fe35a4ba7a1d787be0c122,
type: 3}
propertyPath: m_AnchoredPosition.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 2354870447797163002, guid: 1a1201bb09fe35a4ba7a1d787be0c122,
type: 3}
propertyPath: m_AnchoredPosition.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 2354870447873841641, guid: 1a1201bb09fe35a4ba7a1d787be0c122,
type: 3}
propertyPath: m_AnchorMax.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 2354870447873841641, guid: 1a1201bb09fe35a4ba7a1d787be0c122,
type: 3}
propertyPath: m_AnchorMin.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 2354870447873841641, guid: 1a1201bb09fe35a4ba7a1d787be0c122,
type: 3}
propertyPath: m_SizeDelta.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 2354870447873841641, guid: 1a1201bb09fe35a4ba7a1d787be0c122,
type: 3}
propertyPath: m_AnchoredPosition.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 2354870447873841641, guid: 1a1201bb09fe35a4ba7a1d787be0c122,
type: 3}
propertyPath: m_AnchoredPosition.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 2354870448391347380, guid: 1a1201bb09fe35a4ba7a1d787be0c122,
type: 3}
propertyPath: m_Name
value: SensorConsole
objectReference: {fileID: 0}
- target: {fileID: 2354870448391347381, guid: 1a1201bb09fe35a4ba7a1d787be0c122,
type: 3}
propertyPath: m_RootOrder
value: 2
objectReference: {fileID: 0}
- target: {fileID: 2354870448391347381, guid: 1a1201bb09fe35a4ba7a1d787be0c122,
type: 3}
propertyPath: m_LocalPosition.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 2354870448391347381, guid: 1a1201bb09fe35a4ba7a1d787be0c122,
type: 3}
propertyPath: m_LocalPosition.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 2354870448391347381, guid: 1a1201bb09fe35a4ba7a1d787be0c122,
type: 3}
propertyPath: m_LocalPosition.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 2354870448391347381, guid: 1a1201bb09fe35a4ba7a1d787be0c122,
type: 3}
propertyPath: m_LocalRotation.w
value: 1
objectReference: {fileID: 0}
- target: {fileID: 2354870448391347381, guid: 1a1201bb09fe35a4ba7a1d787be0c122,
type: 3}
propertyPath: m_LocalRotation.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 2354870448391347381, guid: 1a1201bb09fe35a4ba7a1d787be0c122,
type: 3}
propertyPath: m_LocalRotation.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 2354870448391347381, guid: 1a1201bb09fe35a4ba7a1d787be0c122,
type: 3}
propertyPath: m_LocalRotation.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 2354870448391347381, guid: 1a1201bb09fe35a4ba7a1d787be0c122,
type: 3}
propertyPath: m_LocalEulerAnglesHint.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 2354870448391347381, guid: 1a1201bb09fe35a4ba7a1d787be0c122,
type: 3}
propertyPath: m_LocalEulerAnglesHint.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 2354870448391347381, guid: 1a1201bb09fe35a4ba7a1d787be0c122,
type: 3}
propertyPath: m_LocalEulerAnglesHint.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 2354870448391347386, guid: 1a1201bb09fe35a4ba7a1d787be0c122,
type: 3}
propertyPath: dataType
value: 0
objectReference: {fileID: 0}
- target: {fileID: 2354870448391347386, guid: 1a1201bb09fe35a4ba7a1d787be0c122,
type: 3}
propertyPath: portName
value: COM3
objectReference: {fileID: 0}
- target: {fileID: 2354870449063151044, guid: 1a1201bb09fe35a4ba7a1d787be0c122,
type: 3}
propertyPath: m_AnchorMax.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 2354870449063151044, guid: 1a1201bb09fe35a4ba7a1d787be0c122,
type: 3}
propertyPath: m_AnchorMin.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 2354870449063151044, guid: 1a1201bb09fe35a4ba7a1d787be0c122,
type: 3}
propertyPath: m_SizeDelta.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 2354870449063151044, guid: 1a1201bb09fe35a4ba7a1d787be0c122,
type: 3}
propertyPath: m_AnchoredPosition.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 2354870449063151044, guid: 1a1201bb09fe35a4ba7a1d787be0c122,
type: 3}
propertyPath: m_AnchoredPosition.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 2354870449216273281, guid: 1a1201bb09fe35a4ba7a1d787be0c122,
type: 3}
propertyPath: m_AnchorMax.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 2354870449216273281, guid: 1a1201bb09fe35a4ba7a1d787be0c122,
type: 3}
propertyPath: m_AnchorMin.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 2354870449216273281, guid: 1a1201bb09fe35a4ba7a1d787be0c122,
type: 3}
propertyPath: m_SizeDelta.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 2354870449216273281, guid: 1a1201bb09fe35a4ba7a1d787be0c122,
type: 3}
propertyPath: m_AnchoredPosition.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 2354870449216273281, guid: 1a1201bb09fe35a4ba7a1d787be0c122,
type: 3}
propertyPath: m_AnchoredPosition.y
value: 0
objectReference: {fileID: 0}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 1a1201bb09fe35a4ba7a1d787be0c122, type: 3}

View File

@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: b88bb5a823adfb341827864762779906
guid: 7aa75609ef342f84288ea7ec5a82a345
DefaultImporter:
externalObjects: {}
userData:

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 241b85daacaad9c4ba0c421dd706f7af
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 23cd81b4a2fb0584489fc0f58b41cd58
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,136 @@
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
/// <summary>
/// 通用工具
/// </summary>
public class CommonTools
{
/// <summary>
/// 获取角度
/// </summary>.
/// <returns></returns>
public static float GetDu(string data1, string data2)
{
float loData = (Convert.ToInt32(data1, 16) << 8 | Convert.ToInt32(data2, 16)) / 100f;
if (loData > 360)
{
loData = 360 - (Convert.ToInt32("0xffff", 16) - (Convert.ToInt32(data1, 16) << 8 | Convert.ToInt32(data2, 16))) / 100f;
}
return loData;
}
/// <summary>
/// 获取数据
/// </summary>
/// <param name="data1"></param>
/// <param name="data2"></param>
/// <returns></returns>
public static float GetShuJu(string data1, string data2)
{
return Convert.ToInt32(data1, 16) * 256 + Convert.ToInt32(data2, 16);
}
/// <summary>
/// 获取角度
/// </summary>
public static Quaternion GetEuler(float pitch, float yaw, float roll)
{
Vector3 eulerAngles2 = new(pitch, yaw, roll);
return Quaternion.Euler(eulerAngles2);
}
#region 16
/// <summary>
/// 字节数组转16进制字符串
/// </summary>
public static string byteToHexStr(byte[] bytes)
{
string returnStr = "";
if (bytes != null)
{
for (int i = 0; i < bytes.Length; i++)
{
returnStr += bytes[i].ToString("X2");
returnStr += "-";
}
}
return returnStr;
}
/// <summary>
/// 字符串转16进制
/// </summary>
/// <param name="input">要转格式的字符串</param>
/// <returns>转化为16进制的字符串</returns>
private static string ToSixteen(string input)
{
char[] values = input.ToCharArray();
string end = string.Empty;
foreach (char letter in values)
{
int value = Convert.ToInt32(letter);
string hexoutput = string.Format("{0:X}", value); //0 表示占位符 x或X表示十六进制
end += hexoutput + "_";
}
end = end.Remove(end.Length - 1);
return end;
}
/// <summary>
/// 16进制转回字符串
/// </summary>
/// <param name="input">16进制</param>
/// <returns>转回的字符串</returns>
private static string ToMyString(string input)
{
string[] hexvaluesplit = input.Split('_');
string end = string.Empty;
foreach (string hex in hexvaluesplit)
{
int value = Convert.ToInt32(hex, 16);
string stringvalue = char.ConvertFromUtf32(value);
char charValue = (char)value;
end += charValue;
}
return end;
}
/// <summary>
/// 字符串转字节流
/// </summary>
/// <param name="hexStr"></param>
/// <returns></returns>
public static byte[] HexStringToBytes(string hexStr)
{
if (string.IsNullOrEmpty(hexStr))
{
return new byte[0];
}
if (hexStr.StartsWith("0x"))
{
hexStr = hexStr.Remove(0, 2);
}
var count = hexStr.Length;
var byteCount = count / 2;
var result = new byte[byteCount];
for (int ii = 0; ii < byteCount; ++ii)
{
var tempBytes = Byte.Parse(hexStr.Substring(2 * ii, 2), System.Globalization.NumberStyles.HexNumber);
result[ii] = tempBytes;
}
return result;
}
/// <summary>
/// 字符串转字节流 -- 推荐用法
/// </summary>
public static byte[] Convert16(string strText)
{
strText = strText.Replace(" ", "");
byte[] bText = new byte[strText.Length / 2];
for (int i = 0; i < strText.Length / 2; i++)
{
bText[i] = Convert.ToByte(Convert.ToInt32(strText.Substring(i * 2, 2), 16));
}
return bText;
}
#endregion
}

View File

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

View File

@ -0,0 +1,80 @@
using UnityEngine;
using System.Collections.Generic;
namespace UnityThreadingUtils
{
/// <summary>
/// 用于在子线程中将任务安全地调度到Unity主线程执行的工具类
/// </summary>
public class UnityMainThreadDispatcher : MonoBehaviour
{
private static UnityMainThreadDispatcher _instance;
// 用于存储需要在主线程执行的任务队列
private readonly Queue<System.Action> _actionQueue = new Queue<System.Action>();
private void Awake()
{
if (_instance == null)
{
_instance = this;
// 让这个游戏对象在场景切换时不被销毁,确保持续可用
DontDestroyOnLoad(gameObject);
}
else
{
//Destroy(gameObject);
}
}
/// <summary>
/// 获取单例实例
/// </summary>
/// <returns>UnityMainThreadDispatcher单例对象</returns>
public static UnityMainThreadDispatcher Instance()
{
if (_instance == null)
{
// 创建一个新的游戏对象来挂载该组件
GameObject dispatcherGameObject = new GameObject("UnityMainThreadDispatcher");
_instance = dispatcherGameObject.AddComponent<UnityMainThreadDispatcher>();
// 让这个游戏对象在场景切换时不被销毁,确保持续可用
UnityEngine.Object.DontDestroyOnLoad(dispatcherGameObject);
}
return _instance;
}
/// <summary>
/// 将一个任务添加到主线程执行的队列中
/// </summary>
/// <param name="action">需要在主线程执行的任务以Action委托表示</param>
public void Enqueue(System.Action action)
{
lock (_actionQueue)
{
_actionQueue.Enqueue(action);
}
}
private void Update()
{
// 加锁确保线程安全地处理任务队列
lock (_actionQueue)
{
while (_actionQueue.Count > 0)
{
System.Action action = _actionQueue.Dequeue();
try
{
action.Invoke();
}
catch (System.Exception ex)
{
//Debug.LogError($"执行主线程任务时出错: {ex.Message}");
}
}
}
}
}
}

View File

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

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 5a6238098e030c84fad1cc5546bd27db
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,17 @@
using UnityEngine;
using UnityEngine.UI;
public class AngleSensor : Sensor
{
public Text x;
public Text y;
public Text z;
public override void ReceiveData(string datas)
{
base.ReceiveData(datas);
Debug.Log(datas);
}
public override void Display(string datas)
{
}
}

View File

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

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 2eccb318e4dfaf5449eff90d3387cb45
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,28 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
/// <summary>
/// ´«¸ÐÆ÷»ùÀà
/// </summary>
public abstract class Sensor : MonoBehaviour
{
SensorManager sensorManager;
public void Init(SensorManager sm)
{
sensorManager = sm;
}
public void SendData(string data)
{
sensorManager.SendFunction(data);
}
public virtual void ReceiveData(string datas)
{
if (!gameObject.activeSelf) return;
Display(datas);
}
public virtual void Display(string datas)
{
}
}

View File

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

View File

@ -0,0 +1,32 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class DYKGSensor : Sensor
{
/// <summary>
/// µçÔ´ÊÇ·ñ¿ªÆô
/// </summary>
[HideInInspector]
public bool isOpen;
public override void ReceiveData(string datas)
{
base.ReceiveData(datas);
//if (!datas.Split(',')[0].Split(':')[1].Equals(" XWJ")) return;
this.Log(datas);
if (datas.Contains("CONNECTED 1") || !string.IsNullOrEmpty(datas))
{
isOpen = true;
}
if (datas.Contains("DISCONNECTED"))
{
isOpen = false;
}
//isOpen = (!string.IsNullOrEmpty(datas));
}
public override void Display(string datas)
{
//pressText.text = press;
}
}

View File

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

View File

@ -0,0 +1,52 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
/// <summary>
/// 洗胃机接入三个管道
/// </summary>
public class PipeSensor : Sensor
{
/// <summary>
/// 接胃管是否链接
/// </summary>
[HideInInspector]
public bool isJieWei;
/// <summary>
/// 排污管是否链接
/// </summary>
[HideInInspector]
public bool isPaiWu;
/// <summary>
/// 进液管是否链接
/// </summary>
[HideInInspector]
public bool isJinYe;
public override void ReceiveData(string datas)
{
base.ReceiveData(datas);
//if (!datas.Split(',')[0].Split(':')[1].Equals(" XWJ")) return;
if (datas.Contains("Channl"))
{
if (datas.Split(',')[8].Split(':')[1].Equals("1"))
{
isPaiWu = true;
}
else if (datas.Split(',')[8].Split(':')[1].Equals("2"))
{
isJieWei = true;
}
else if (datas.Split(',')[8].Split(':')[1].Equals("3"))
{
isJinYe = true;
}
}
}
public override void Display(string datas)
{
base.Display(datas);
}
}

View File

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

View File

@ -0,0 +1,213 @@
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Data.SqlTypes;
using System.IO.Ports;
using System.Text;
using System.Threading;
//using UnityEditor.PackageManager.UI;
using UnityEngine;
using UnityThreadingUtils;
using ZXKFramework;
public class SensorManager : MonoBehaviour /*MonoSingleton<SensorManager>*/
{
public enum DataType
{
,
,
}
#region ,
[Header("串口名")]
public string portName = "COM10";
[Header("波特率")]
public int baudRate = 115200;
[Header("奇偶校验")]
private Parity parity = Parity.None;
[Header("数据位")]
private int dataBits = 8;
[Header("停止位")]
private StopBits stopBits = StopBits.One;
SerialPort sp = null;
Thread dataReceiveThread;
[Header("接收数据格式")]
public DataType dataType;
#endregion
private Dictionary<string, Sensor> allSensor = new Dictionary<string, Sensor>();
StringBuilder sb = new StringBuilder();
private void Start()
{
sp = new SerialPort(portName, baudRate, parity, dataBits, stopBits);
foreach (Sensor s in GetComponentsInChildren<Sensor>())
{
allSensor.TryAdd(s.GetType().Name, s);
}
switch (dataType)
{
case DataType.:
dataReceiveThread = new Thread(new ThreadStart(DataReceiveBytesThread));
break;
case DataType.:
dataReceiveThread = new Thread(new ThreadStart(DataReceiveStrThread));
break;
}
OpenPort();
}
/// <summary>
/// 接收字节流
/// </summary>
private void DataReceiveBytesThread()
{
while (true)
{
if (sp != null && sp.IsOpen)
{
try
{
if (sp.BytesToRead > 0)
{
byte[] buffer = new byte[sp.BytesToRead];
sp.Read(buffer, 0, sp.BytesToRead);
string receivedData = Encoding.Default.GetString(buffer);
//Debug.Log(receivedData);
UnityMainThreadDispatcher.Instance().Enqueue(() =>
{
foreach (var s in allSensor)
{
s.Value.ReceiveData(receivedData);
}
});
}
}
catch (Exception)
{
Debug.Log("消息接收失败");
}
}
Thread.Sleep(20);
}
}
/// <summary>
/// 接收字符串
/// </summary>
private void DataReceiveStrThread()
{
while (true)
{
if (sp != null && sp.IsOpen)
{
try
{
if (sp.BytesToRead > 0)
{
sb.Append(sp.ReadExisting());
//this.ColorLog(GDLog.LogColorState.Blue, sp.ReadLine());
UnityMainThreadDispatcher.Instance().Enqueue(() =>
{
foreach (var s in allSensor)
{
s.Value.ReceiveData(sb.ToString());
}
sb.Clear();
});
}
}
catch (Exception)
{
Debug.Log("消息接收失败");
}
}
Thread.Sleep(20);
}
}
/// <summary>
/// 发送消息
/// </summary>
/// <param name="dataSend"></param>
public void SendFunction(string str)
{
try
{
byte[] dataSend = Encoding.ASCII.GetBytes(str);
if (sp != null && sp.IsOpen)
{
if (dataSend != null && dataSend.Length > 0)
{
sp.Write(dataSend, 0, dataSend.Length);
Debug.Log("发送消息成功:" + str);
}
}
}
catch (Exception)
{
Debug.Log("发送消息失败:" + str);
}
}
//获取指定传感器
public T GetSensor<T>() where T : Sensor
{
try
{
string name = typeof(T).Name;
if (!allSensor.ContainsKey(name))
{
allSensor.TryAdd(name, GetComponentInChildren<T>());
allSensor[name].Init(this);
}
//Debug.Log("传感器获取成功");
return allSensor[name] as T;
}
catch (Exception)
{
Debug.Log("传感器获取失败");
return null;
}
}
#region
//打开串口
public void OpenPort()
{
try
{
if (!sp.IsOpen)
{
sp.Open();
dataReceiveThread.Start();
Debug.Log("串口打开成功");
}
}
catch (Exception)
{
Debug.Log("串口打开失败");
}
}
//关闭串口
public void ClosePort()
{
try
{
sp.Close();
dataReceiveThread.Abort();
Debug.Log("串口关闭");
}
catch (Exception)
{
Debug.Log("串口关闭失败");
}
}
#endregion
#region Unity 退
private void OnApplicationQuit()
{
ClosePort();
}
private void OnDisable()
{
this.Log("为什么关闭了:" + gameObject.name);
ClosePort();
}
#endregion
}

View File

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

File diff suppressed because it is too large Load Diff

View File

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

File diff suppressed because it is too large Load Diff

View File

@ -12,7 +12,8 @@ namespace DongWuYiXue.QiGuanChaGuan
base.OnStateEnter();
this.Log("进入暴露会厌状态");
fsm.ShowCamera("暴露会厌_Camera");
fsm.ShowTip(0);
fsm.ShowTip(1);
fsm.PlayBgm(1);
cor = Game.Instance.IEnumeratorManager.Run(3.0f, () =>
{
isChaRu = true;
@ -24,6 +25,14 @@ namespace DongWuYiXue.QiGuanChaGuan
if (isChaRu)
{
isChaRu = false;
if (fsm.main_gameModel.modeType == ModeType.ShiXun)
{
fsm.AddScore(6, 0);
}
if (fsm.main_gameModel.modeType == ModeType.KaoHe)
{
fsm.AddScore(6, 0);
}
fsm.PlayClip("暴露会厌_TimeLine", () =>
{
fsm.nextState = true;

View File

@ -7,7 +7,7 @@ namespace DongWuYiXue.QiGuanChaGuan
{
base.OnStateEnter();
this.Log("进入病例信息状态");
fsm.ShowTip(0);
fsm.ShowTip(0, true);
fsm.ShowCamera("病例信息1_Camera");
fsm.PlayClip("病例信息_TimeLine", () =>
{

View File

@ -1,4 +1,5 @@
using FSM;
using ZXKFramework;
namespace DongWuYiXue.QiGuanChaGuan
{
public class CeSuanDaoGuanChaRuChangDuState : FsmState<FSMManager>
@ -9,11 +10,20 @@ namespace DongWuYiXue.QiGuanChaGuan
this.Log("쏵흙꿎炬돔밗꿨흙낀똑榴檄");
fsm.ShowCamera("꿎炬돔밗꿨흙낀똑1_Camera");
fsm.ShowTip(0);
fsm.PlayBgm(0);
fsm.Light("12mm폭밗돔밗");
fsm.EnableInteraction("12폭밗돔밗쇱꿴폭쵱昑");
fsm.InteractionDown("12폭밗돔밗쇱꿴폭쵱昑", c =>
{
if (fsm.main_gameModel.modeType == ModeType.ShiXun)
{
fsm.AddScore(5, 0);
}
if (fsm.main_gameModel.modeType == ModeType.KaoHe)
{
fsm.AddScore(4, 0);
}
fsm.Unlight("12mm폭밗돔밗");
fsm.DisableInteraction("12폭밗돔밗쇱꿴폭쵱昑");
fsm.ShowCamera("꿎炬돔밗꿨흙낀똑2_Camera");
@ -21,6 +31,7 @@ namespace DongWuYiXue.QiGuanChaGuan
fsm.PlayClip("꿎炬돔밗꿨흙낀똑1_TimeLine", () =>
{
fsm.ShowTip(1);
fsm.PlayBgm(1);
fsm.Show("미땍<EBAFB8>깃션貫零");
fsm.Light_EnableInteraction("미땍<EBAFB8>깃션貫零");
fsm.ShowArrow("헝듐샌미땍<EBAFB8>깃션貫零", "미땍<EBAFB8>깃션貫零");
@ -29,6 +40,14 @@ namespace DongWuYiXue.QiGuanChaGuan
fsm.InteractionDown("미땍<EBAFB8>깃션貫零", c =>
{
if (fsm.main_gameModel.modeType == ModeType.ShiXun)
{
fsm.AddScore(5, 1);
}
if (fsm.main_gameModel.modeType == ModeType.KaoHe)
{
fsm.AddScore(4, 1);
}
fsm.HideArrow();
fsm.Unlight_DisableInteraction("미땍<EBAFB8>깃션貫零");
fsm.Hide("미땍<EBAFB8>깃션貫零");

View File

@ -12,11 +12,13 @@ namespace DongWuYiXue.QiGuanChaGuan
base.OnStateEnter();
this.Log("½øÈë²åÈëÆø¹Üµ¼¹Ü״̬");
fsm.ShowCamera("²åÈëÆø¹Üµ¼¹Ü_Camera");
fsm.ShowTip(0);
fsm.ShowTip(1);
fsm.PlayBgm(1);
cor = Game.Instance.IEnumeratorManager.Run(3.0f, () =>
{
isChaRu = true;
});
}
public override void OnStateStay()
{
@ -24,9 +26,23 @@ namespace DongWuYiXue.QiGuanChaGuan
if (isChaRu)
{
isChaRu = false;
if (fsm.main_gameModel.modeType == ModeType.ShiXun)
{
fsm.AddScore(8, 0);
}
if (fsm.main_gameModel.modeType == ModeType.KaoHe)
{
fsm.AddScore(6, 0);
}
fsm.PlayClip("²åÈëÆø¹Üµ¼¹Ü_TimeLine", () =>
{
fsm.nextState = true;
if (fsm.main_gameModel.modeType == ModeType.KaoHe)
{
fsm.ShowTxtQuestion(3, 3, 1, () =>
{
fsm.nextState = true;
});
}
});
}
}

View File

@ -1,23 +1,107 @@
using FSM;
using UnityEngine;
using ZXKFramework;
namespace DongWuYiXue.QiGuanChaGuan
{
public class ChongYingTaoNangState : FsmState<FSMManager>
{
bool isLa;
float laValue;
bool isTui;
float tuiValue;
Coroutine cor;
Coroutine cor2;
public override void OnStateEnter()
{
base.OnStateEnter();
this.Log("½øÈë³äÓ¯Ì×ÄÒ״̬");
fsm.ShowTip(0);
isLa = false;
laValue = 0;
isTui = false;
tuiValue = 0;
fsm.ShowTip(1);
fsm.PlayBgm(1);
fsm.ShowCamera("³äÓ¯Ì×ÄÒ_Camera");
fsm.Show("注射器");
fsm.Show("实物5ml注射器");
cor = Game.Instance.IEnumeratorManager.Run(3.0f, () =>
{
isLa = true;
});
}
public override void OnStateStay()
{
base.OnStateStay();
if (isLa)
{
laValue = GameManager.Instance.senSor.GetSensor<ZhuSheQi_5SenSor>().progressValue;
fsm.PlayClip("充盈胃囊拉_TimeLine", null, laValue);
if (Input.GetKeyDown(KeyCode.L))
{
laValue = 1.0f;
}
if (laValue >= 1.0f)
{
if (fsm.main_gameModel.modeType == ModeType.ShiXun)
{
fsm.AddScore(5, 0);
}
if (fsm.main_gameModel.modeType == ModeType.KaoHe)
{
fsm.AddScore(4, 0);
}
isLa = false;
laValue = 0;
cor2=Game.Instance.IEnumeratorManager.Run(1.0f, () =>
{
isTui = true;
});
fsm.ShowTip(3);
fsm.PlayBgm(3);
}
}
if (isTui)
{
tuiValue = 1 - GameManager.Instance.senSor.GetSensor<ZhuSheQi_5SenSor>().progressValue;
fsm.PlayClip("充盈胃囊推_TimeLine", null, tuiValue);
if (Input.GetKeyDown(KeyCode.L))
{
tuiValue = 1.0f;
}
if (tuiValue >= 1.0f)
{
if (fsm.main_gameModel.modeType == ModeType.ShiXun)
{
fsm.AddScore(5, 1);
}
if (fsm.main_gameModel.modeType == ModeType.KaoHe)
{
fsm.AddScore(2, 1);
}
isTui = false;
tuiValue = 0;
fsm.nextState = true;
fsm.Hide("实物5ml注射器");
}
}
}
public override void OnStateExit()
{
base.OnStateExit();
fsm.Hide("实物5ml注射器");
if (null != cor)
{
Game.Instance.IEnumeratorManager.Stop(cor);
cor = null;
}
isLa = false;
laValue = 0;
isTui = false;
tuiValue = 0;
fsm.nextState = false;
}
}
}

View File

@ -18,8 +18,8 @@ namespace DongWuYiXue.QiGuanChaGuan
this.Log("½øÈë´ò¿ª¿Úǻ״̬");
isOpen = false;
fsm.ShowCamera("´ò¿ª¿ÚÇ»1_Camera");
fsm.ShowTip(0);
fsm.ShowTip(1);
fsm.PlayBgm(1);
cor = Game.Instance.IEnumeratorManager.Run(3.0f, () =>
{
isOpen = true;
@ -31,6 +31,14 @@ namespace DongWuYiXue.QiGuanChaGuan
if (isOpen)
{
isOpen = false;
if (fsm.main_gameModel.modeType == ModeType.ShiXun)
{
fsm.AddScore(6, 0);
}
if (fsm.main_gameModel.modeType == ModeType.KaoHe)
{
fsm.AddScore(6, 0);
}
fsm.PlayClip("´ò¿ª¿ÚÇ»1_TimeLine", () =>
{
fsm.nextState = true;

View File

@ -1,4 +1,5 @@
using FSM;
using ZXKFramework;
namespace DongWuYiXue.QiGuanChaGuan
{
public class GuDingDaoGuanState : FsmState<FSMManager>
@ -12,18 +13,33 @@ namespace DongWuYiXue.QiGuanChaGuan
fsm.Light_EnableInteraction("固定导管的高亮");
fsm.ShowCamera("固定导管_Camera");
fsm.ShowTip(0);
fsm.PlayBgm(0);
fsm.ShowArrow("请拖拽纱布", "利多卡因纱布");
fsm.InteractionTrigger("利多卡因纱布", c =>
{
if (c.name.Equals("固定导管的高亮"))
{
if (fsm.main_gameModel.modeType == ModeType.ShiXun)
{
fsm.AddScore(5, 0);
}
if (fsm.main_gameModel.modeType == ModeType.KaoHe)
{
fsm.AddScore(4, 0);
}
fsm.Unlight_DisableInteraction("利多卡因纱布");
fsm.Unlight_DisableInteraction("固定导管的高亮");
fsm.Hide("利多卡因纱布");
fsm.PlayClip("固定导管_TimeLine", () =>
{
fsm.nextState = true;
if (fsm.main_gameModel.modeType == ModeType.KaoHe)
{
fsm.ShowTxtQuestion(4, 3, 1, () =>
{
fsm.nextState = true;
});
}
});
}
});

View File

@ -10,6 +10,7 @@ namespace DongWuYiXue.QiGuanChaGuan
this.Log("进入检查喉镜状态");
fsm.ShowCamera("检查喉镜_Camera");
fsm.ShowTip(0);
fsm.PlayBgm(0);
fsm.Light_EnableInteraction("160mm喉镜");
fsm.ShowArrow("请点击检查喉镜", "160mm喉镜");
fsm.ShowTipBtn(() =>
@ -28,7 +29,7 @@ namespace DongWuYiXue.QiGuanChaGuan
}
if (fsm.main_gameModel.modeType == ModeType.KaoHe)
{
fsm.AddScore(3, 0);
fsm.AddScore(4, 0);
}
fsm.Unlight_DisableInteraction("160mm喉镜");
fsm.PlayClip("检查喉镜_TimeLine", () =>

View File

@ -1,4 +1,5 @@
using FSM;
using ZXKFramework;
namespace DongWuYiXue.QiGuanChaGuan
{
public class JianChaTaoNangQiMiXingState : FsmState<FSMManager>
@ -8,16 +9,42 @@ namespace DongWuYiXue.QiGuanChaGuan
base.OnStateEnter();
this.Log("进入检查套囊气密性状态");
fsm.ShowCamera("检查套囊气密性_Camera");
fsm.ShowTip(0);
fsm.Show("5ml注射器");
fsm.Light_EnableInteraction("5ml注射器");
fsm.Light("10mm气管导管");
fsm.EnableInteraction("10气管导管气密性");
fsm.ShowArrow("请拖拽5ml注射器", "5ml注射器");
if (fsm.main_gameModel.modeType == ModeType.KaoHe)
{
fsm.ShowTxtQuestion(1, 4, 3, () =>
{
fsm.ShowTip(0);
fsm.PlayBgm(0);
fsm.Show("5ml注射器");
fsm.Light_EnableInteraction("5ml注射器");
fsm.Light("10mm气管导管");
fsm.EnableInteraction("10气管导管气密性");
fsm.ShowArrow("请拖拽5ml注射器", "5ml注射器");
});
}
else if(fsm.main_gameModel.modeType == ModeType.ShiXun)
{
fsm.ShowTip(0);
fsm.PlayBgm(0);
fsm.Show("5ml注射器");
fsm.Light_EnableInteraction("5ml注射器");
fsm.Light("10mm气管导管");
fsm.EnableInteraction("10气管导管气密性");
fsm.ShowArrow("请拖拽5ml注射器", "5ml注射器");
}
fsm.InteractionTrigger("5ml注射器", c =>
{
if (c.name.Equals("10气管导管气密性"))
{
if (fsm.main_gameModel.modeType == ModeType.ShiXun)
{
fsm.AddScore(2, 0);
}
if (fsm.main_gameModel.modeType == ModeType.KaoHe)
{
fsm.AddScore(4, 0);
}
fsm.HideArrow();
fsm.Hide("5ml注射器");
fsm.DisableInteraction("10气管导管气密性");
@ -34,6 +61,14 @@ namespace DongWuYiXue.QiGuanChaGuan
}
if (c.name.Equals("12气管导管检查气密性"))
{
if (fsm.main_gameModel.modeType == ModeType.ShiXun)
{
fsm.AddScore(2, 1);
}
if (fsm.main_gameModel.modeType == ModeType.KaoHe)
{
fsm.AddScore(4, 1);
}
fsm.HideArrow();
fsm.Hide("5ml注射器");
fsm.Unlight_DisableInteraction("5ml注射器");
@ -50,6 +85,14 @@ namespace DongWuYiXue.QiGuanChaGuan
}
if (c.name.Equals("14气管导管检查气密性"))
{
if (fsm.main_gameModel.modeType == ModeType.ShiXun)
{
fsm.AddScore(1, 2);
}
if (fsm.main_gameModel.modeType == ModeType.KaoHe)
{
fsm.AddScore(4, 2);
}
fsm.HideArrow();
fsm.Hide("5ml注射器");
fsm.Unlight_DisableInteraction("5ml注射器");

View File

@ -6,6 +6,9 @@ namespace DongWuYiXue.QiGuanChaGuan
public override void OnStateEnter()
{
base.OnStateEnter();
this.Log("½øÈë½á¹û״̬");
GameManager.Instance.timeCounterManager.StopTimeCounter();
GameManager.Instance.uiManager.ShowUI<ChengJiPanel>();
}
public override void OnStateStay()
{
@ -14,6 +17,8 @@ namespace DongWuYiXue.QiGuanChaGuan
public override void OnStateExit()
{
base.OnStateExit();
GameManager.Instance.uiManager.CloseUI<ChengJiPanel>();
fsm.nextState = false;
}
}
}

View File

@ -1,4 +1,5 @@
using FSM;
using ZXKFramework;
namespace DongWuYiXue.QiGuanChaGuan
{
public class QueRenChaGuanWeiZhiState : FsmState<FSMManager>
@ -9,6 +10,7 @@ namespace DongWuYiXue.QiGuanChaGuan
this.Log("进入确认插管位置状态");
fsm.ShowCamera("确认插管位置1_Camera");
fsm.ShowTip(0);
fsm.PlayBgm(0);
fsm.Show("二氧化碳监测装置");
fsm.Light_EnableInteraction("二氧化碳监测装置");
fsm.Light_EnableInteraction("二氧化碳监测装置位置");
@ -17,6 +19,14 @@ namespace DongWuYiXue.QiGuanChaGuan
{
if (c.name.Equals("二氧化碳监测装置位置"))
{
if (fsm.main_gameModel.modeType == ModeType.ShiXun)
{
fsm.AddScore(5, 0);
}
if (fsm.main_gameModel.modeType == ModeType.KaoHe)
{
fsm.AddScore(4, 0);
}
fsm.HideArrow();
fsm.Hide("二氧化碳监测装置");
fsm.Unlight_DisableInteraction("二氧化碳监测装置");
@ -25,6 +35,7 @@ namespace DongWuYiXue.QiGuanChaGuan
{
fsm.ShowCamera("确认插管位置2_Camera");
fsm.ShowTip(1);
fsm.PlayBgm(1);
fsm.Light_EnableInteraction("呼吸机");
fsm.ShowArrow("请点击呼吸机", "呼吸机");
});
@ -33,6 +44,14 @@ namespace DongWuYiXue.QiGuanChaGuan
fsm.InteractionDown("呼吸机", c =>
{
if (fsm.main_gameModel.modeType == ModeType.ShiXun)
{
fsm.AddScore(5, 1);
}
if (fsm.main_gameModel.modeType == ModeType.KaoHe)
{
fsm.AddScore(4, 1);
}
fsm.HideArrow();
fsm.Unlight_DisableInteraction("呼吸机");
fsm.PlayClip("确认插管位置2_TimeLine", () =>

View File

@ -1,4 +1,5 @@
using FSM;
using ZXKFramework;
namespace DongWuYiXue.QiGuanChaGuan
{
public class ShuZheZhunBeiState : FsmState<FSMManager>
@ -7,7 +8,18 @@ namespace DongWuYiXue.QiGuanChaGuan
{
base.OnStateEnter();
this.Log("进入术者准备装填");
fsm.nextState = true;
if (fsm.main_gameModel.modeType == ModeType.ShiXun)
{
fsm.AddScore(5, 0);
}
if (fsm.main_gameModel.modeType == ModeType.KaoHe)
{
fsm.ShowTxtQuestion(0, 3, 1, () =>
{
fsm.AddScore(4, 0);
fsm.nextState = true;
});
}
}
public override void OnStateStay()
{

View File

@ -1,4 +1,5 @@
using FSM;
using ZXKFramework;
namespace DongWuYiXue.QiGuanChaGuan
{
public class TuMoLiDuoKaYinState : FsmState<FSMManager>
@ -9,6 +10,7 @@ namespace DongWuYiXue.QiGuanChaGuan
this.Log("进入涂抹多卡因凝胶状态");
fsm.ShowCamera("涂抹利多卡因凝胶1_Camera");
fsm.ShowTip(0);
fsm.PlayBgm(0);
fsm.Show("利多卡因喷壶");
fsm.Light("测算导管插入长度");
fsm.EnableInteraction("测算导管插入长度触发");
@ -18,6 +20,14 @@ namespace DongWuYiXue.QiGuanChaGuan
{
if (c.name.Equals("测算导管插入长度触发"))
{
if (fsm.main_gameModel.modeType == ModeType.ShiXun)
{
fsm.AddScore(5, 0);
}
if (fsm.main_gameModel.modeType == ModeType.KaoHe)
{
fsm.AddScore(2, 0);
}
fsm.HideArrow();
fsm.Hide("利多卡因喷壶");
fsm.Unlight("测算导管插入长度");
@ -27,6 +37,7 @@ namespace DongWuYiXue.QiGuanChaGuan
fsm.PlayClip("涂抹利多卡因1_TimeLine", () =>
{
fsm.ShowTip(1);
fsm.PlayBgm(1);
fsm.Show("利多卡因纱布");
fsm.Light("测算导管插入长度");
fsm.EnableInteraction("测算导管插入长度触发");
@ -40,6 +51,14 @@ namespace DongWuYiXue.QiGuanChaGuan
{
if (c.name.Equals("测算导管插入长度触发"))
{
if (fsm.main_gameModel.modeType == ModeType.ShiXun)
{
fsm.AddScore(5, 1);
}
if (fsm.main_gameModel.modeType == ModeType.KaoHe)
{
fsm.AddScore(2, 1);
}
fsm.HideArrow();
fsm.Unlight("测算导管插入长度");
fsm.Hide("利多卡因纱布");

View File

@ -18,7 +18,7 @@ namespace DongWuYiXue.QiGuanChaGuan
}
if (fsm.main_gameModel.modeType == ModeType.KaoHe)
{
fsm.ShowImgQuestion(0, 3, 0, () =>
fsm.ShowImgQuestion(0, 4, 0, () =>
{
fsm.nextState = true;
});

View File

@ -18,7 +18,7 @@ namespace DongWuYiXue.QiGuanChaGuan
}
if (fsm.main_gameModel.modeType == ModeType.KaoHe)
{
fsm.ShowImgQuestion(1, 3, 0, () =>
fsm.ShowImgQuestion(1, 4, 0, () =>
{
fsm.nextState = true;
});

View File

@ -18,7 +18,7 @@ namespace DongWuYiXue.QiGuanChaGuan
}
if (fsm.main_gameModel.modeType == ModeType.KaoHe)
{
fsm.ShowImgQuestion(2, 3, 0, () =>
fsm.ShowImgQuestion(2, 4, 0, () =>
{
fsm.nextState = true;
});

View File

@ -18,9 +18,12 @@ namespace DongWuYiXue.QiGuanChaGuan
}
if (fsm.main_gameModel.modeType == ModeType.KaoHe)
{
fsm.ShowImgQuestion(3, 3, 0, () =>
fsm.ShowImgQuestion(3, 4, 0, () =>
{
fsm.nextState = true;
fsm.ShowTxtQuestion(2, 3, 1, () =>
{
fsm.nextState = true;
});
});
}
}

View File

@ -6,6 +6,16 @@ namespace DongWuYiXue.QiGuanChaGuan
{
public class GameManager : MonoSingleton<GameManager>
{
bool isActive = false;
[SerializeField]
GameObject yingJianCanvas;
/// <summary>
/// ×¢ÉäÆ÷µÄsensorManager
/// </summary>
public SensorManager senSor;
//½»»¥Ä£¿é
[HideInInspector]
public InteractionManager interactionManager;
@ -89,6 +99,22 @@ namespace DongWuYiXue.QiGuanChaGuan
}
}
private void Update()
{
if (Input.GetKeyDown(KeyCode.Escape))
{
isActive = !isActive;
if (isActive)
{
yingJianCanvas.SetActive(true);
}
else
{
yingJianCanvas.SetActive(false);
}
}
}
private void PlaySound(PlaySoundEvent e)
{
Game.Instance.sound.PlayBGM(e.path, false, clip => {

View File

@ -8,7 +8,7 @@ using UnityEngine.UI;
using ZXKFramework;
namespace DongWuYiXue.QiGuanChaGuan
{
public class Drag : MonoBehaviour, IBeginDragHandler, IDragHandler, IEndDragHandler,IPointerEnterHandler,IPointerExitHandler
public class Drag : MonoBehaviour, IBeginDragHandler, IDragHandler, IEndDragHandler, IPointerEnterHandler, IPointerExitHandler
{
public enum Group
{
@ -39,8 +39,10 @@ namespace DongWuYiXue.QiGuanChaGuan
private Vector2 offset;
[HideInInspector]
public bool right;
private Canvas canvas;
private void Awake()
{
canvas = GetComponentInParent<Canvas>();
rectTransform = GetComponent<RectTransform>();
startPos = rectTransform.localPosition;
falseImage = transform.FindFirst("FalseImg");
@ -65,9 +67,11 @@ namespace DongWuYiXue.QiGuanChaGuan
{
if (drag && !falseImage.activeSelf && !rightImage.activeSelf)
{
RectTransform rectTransform = transform as RectTransform;
Vector2 localPoint;
// ʹÓø¸¼¶ RectTransform ½øÐÐ×ø±êת»»
RectTransformUtility.ScreenPointToLocalPointInRectangle(rectTransform.parent as RectTransform, eventData.position, canvas.worldCamera, out localPoint);
// 计算鼠标相对于 UI 元素的偏移量
offset = rectTransform.anchoredPosition - eventData.position;
offset = rectTransform.anchoredPosition - localPoint;
dragManager.drag = this;
}
}
@ -79,9 +83,10 @@ namespace DongWuYiXue.QiGuanChaGuan
{
dragImage.SetActive(true);
hoverImage.SetActive(false);
RectTransform rectTransform = transform as RectTransform;
Vector2 localPoint;
RectTransformUtility.ScreenPointToLocalPointInRectangle(rectTransform.parent as RectTransform, eventData.position, canvas.worldCamera, out localPoint);
// 根据鼠标位置和偏移量更新 UI 元素的位置
rectTransform.anchoredPosition = eventData.position + offset;
rectTransform.anchoredPosition = localPoint + offset;
}
}
@ -97,10 +102,10 @@ namespace DongWuYiXue.QiGuanChaGuan
{
rectTransform.localPosition = startPos;
}
public void OnPointerEnter(PointerEventData eventData)
{
// 获取当前的 EventSystem
EventSystem eventSystem = EventSystem.current;
// 检查鼠标是否在 UI 上

Some files were not shown because too many files have changed in this diff Show More