最新对接硬件提交
This commit is contained in:
parent
38977d0e7f
commit
bfeee3810e
@ -43,7 +43,7 @@ public class MianQian_SenSor : Sensor
|
||||
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}");
|
||||
//this.Error($"当前旋转角度为:{X},{Y},{Z}");
|
||||
}
|
||||
|
||||
public override void Display(string datas)
|
||||
|
||||
@ -30,7 +30,11 @@ public class ZhuSheQi_20SenSor : Sensor
|
||||
public override void ReceiveData(string datas)
|
||||
{
|
||||
base.ReceiveData(datas);
|
||||
if (!datas.Split('%')[0].Split("ID:")[1].Split(',')[0].Equals("ZSQ20")) return;
|
||||
if (!datas.Split('%')[0].Split("ID:")[1].Split(',')[0].Equals("ZSQ20"))
|
||||
{
|
||||
//progressValue = 0;
|
||||
return;
|
||||
}
|
||||
lastTime = time;
|
||||
//this.Error(datas);
|
||||
progressValue = ((Convert.ToInt32(datas.Split("%")[0].Split("LEVEL:")[1])) - 1) / 9.0f;
|
||||
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load Diff
@ -27,15 +27,23 @@ namespace DongWuYiXue.DaoNiaoShu
|
||||
public override void OnStateStay()
|
||||
{
|
||||
base.OnStateStay();
|
||||
if (isBaGuan)
|
||||
//if (isBaGuan)
|
||||
//{
|
||||
// baGuanValue += .0005f;
|
||||
// fsm.PlayClip("°Î¹Ü_TimeLine", null, baGuanValue);
|
||||
// avProValue.PlayValue = baGuanValue;
|
||||
// avProValue.PlayVideoAsValue();
|
||||
//}
|
||||
if (isBaGuan && Input.GetKeyDown(KeyCode.L))
|
||||
{
|
||||
baGuanValue += .0005f;
|
||||
baGuanValue = 1.0f;
|
||||
fsm.PlayClip("°Î¹Ü_TimeLine", null, baGuanValue);
|
||||
avProValue.PlayValue = baGuanValue;
|
||||
avProValue.PlayVideoAsValue();
|
||||
}
|
||||
if (isBaGuan && Input.GetKeyDown(KeyCode.L))
|
||||
if (isBaGuan && GameManager.Instance.senSor.GetSensor<DaoNiao_Sensor>().daoNiaoDeep <= 0f)
|
||||
{
|
||||
//baGuanValue += .0005f;
|
||||
baGuanValue = 1.0f;
|
||||
fsm.PlayClip("°Î¹Ü_TimeLine", null, baGuanValue);
|
||||
avProValue.PlayValue = baGuanValue;
|
||||
|
||||
@ -47,6 +47,7 @@ namespace DongWuYiXue.DaoNiaoShu
|
||||
isTui = true;
|
||||
});
|
||||
}
|
||||
bool isOpen;
|
||||
public override void OnStateStay()
|
||||
{
|
||||
base.OnStateStay();
|
||||
@ -78,9 +79,25 @@ namespace DongWuYiXue.DaoNiaoShu
|
||||
}
|
||||
if (isTui && GameManager.Instance.senSor.GetSensor<ZhuSheQi_20SenSor>().isOpen)
|
||||
{
|
||||
isOpen = true;
|
||||
tuiValue = GameManager.Instance.senSor.GetSensor<ZhuSheQi_20SenSor>().progressValue;
|
||||
fsm.PlayClip("冲洗包皮腔_TimeLine", null, 1.0f - tuiValue);
|
||||
}
|
||||
if (isOpen && !GameManager.Instance.senSor.GetSensor<ZhuSheQi_20SenSor>().isOpen)
|
||||
{
|
||||
tuiValue = 1.0f;
|
||||
fsm.PlayClip("łĺĎ´°üƤǝ_TimeLine", null, tuiValue);
|
||||
if (fsm.main_gameModel.modeType == ModeType.ShiXun)
|
||||
{
|
||||
fsm.AddScore(5, 1);
|
||||
}
|
||||
if (fsm.main_gameModel.modeType == ModeType.KaoHe)
|
||||
{
|
||||
fsm.AddScore(5, 1);
|
||||
}
|
||||
isTui = false;
|
||||
fsm.nextState = true;
|
||||
}
|
||||
if (tuiValue == 0f && GameManager.Instance.senSor.GetSensor<ZhuSheQi_20SenSor>().isOpen && isTui)
|
||||
{
|
||||
if (fsm.main_gameModel.modeType == ModeType.ShiXun)
|
||||
@ -99,6 +116,7 @@ namespace DongWuYiXue.DaoNiaoShu
|
||||
{
|
||||
base.OnStateExit();
|
||||
fsm.HideTipBtn();
|
||||
isOpen = false;
|
||||
isTui = false;
|
||||
fsm.Hide("20ml注射器放置后");
|
||||
fsm.nextState = false;
|
||||
|
||||
@ -6,11 +6,17 @@ namespace DongWuYiXue.DaoNiaoShu
|
||||
public class QingJieBaoPiKouState : FsmState<FSMManager>
|
||||
{
|
||||
Coroutine cor;
|
||||
GameObject nieZi;
|
||||
MianQian_SenSor mianQian;
|
||||
XiaoDu_Collider xiaoDu;
|
||||
public override void OnStateEnter()
|
||||
{
|
||||
base.OnStateEnter();
|
||||
this.Log("쏵흙헌썅관튄왯섟鷺鍋튄륀榴檄");
|
||||
|
||||
xiaoDu = GameManager.Instance.transform.parent.FindFirst<XiaoDu_Collider>("pasted__pasted__SM_MianQiu7");
|
||||
nieZi = GameManager.Instance.transform.parent.FindFirst("ÊÖÄÃÄ÷×ÓÏû¶¾");
|
||||
mianQian = GameManager.Instance.senSor.GetSensor<MianQian_SenSor>();
|
||||
fsm.ShowCamera("헌썅관튄왯1_Camera");
|
||||
fsm.Light_EnableInteraction("쪘성땍춈헷");
|
||||
fsm.ShowArrow("듐샌쪘성땍춈헷", "쪘성땍춈헷");
|
||||
@ -38,8 +44,8 @@ namespace DongWuYiXue.DaoNiaoShu
|
||||
fsm.ShowTip(1);
|
||||
fsm.PlayBgm(1);
|
||||
fsm.Show("癎컬퀄綾句뗀");
|
||||
cor = Game.Instance.IEnumeratorManager.Run(3.0f, () =>
|
||||
{
|
||||
//cor = Game.Instance.IEnumeratorManager.Run(3.0f, () =>
|
||||
//{
|
||||
if (fsm.main_gameModel.modeType == ModeType.ShiXun)
|
||||
{
|
||||
fsm.AddScore(5, 1);
|
||||
@ -48,17 +54,24 @@ namespace DongWuYiXue.DaoNiaoShu
|
||||
{
|
||||
fsm.AddScore(5, 1);
|
||||
}
|
||||
fsm.nextState = true;
|
||||
});
|
||||
//fsm.nextState = true;
|
||||
//});
|
||||
});
|
||||
}
|
||||
public override void OnStateStay()
|
||||
{
|
||||
base.OnStateStay();
|
||||
nieZi.transform.localEulerAngles = new Vector3(-mianQian.X, mianQian.Y, mianQian.Z);
|
||||
if (xiaoDu.colliderNum >= 4)
|
||||
{
|
||||
xiaoDu.ExitCollider();
|
||||
fsm.nextState = true;
|
||||
}
|
||||
}
|
||||
public override void OnStateExit()
|
||||
{
|
||||
base.OnStateExit();
|
||||
xiaoDu.ExitCollider();
|
||||
fsm.HideTipBtn();
|
||||
if (null != cor)
|
||||
{
|
||||
|
||||
@ -6,10 +6,17 @@ namespace DongWuYiXue.DaoNiaoShu
|
||||
public class QingJieNiaoDaoKouState : FsmState<FSMManager>
|
||||
{
|
||||
Coroutine cor;
|
||||
GameObject nieZi;
|
||||
MianQian_SenSor mianQian;
|
||||
XiaoDu_Collider xiaoDu;
|
||||
public override void OnStateEnter()
|
||||
{
|
||||
base.OnStateEnter();
|
||||
this.Log("쏵흙헌썅쿱돛왯榴檄");
|
||||
|
||||
xiaoDu = GameManager.Instance.transform.parent.FindFirst<XiaoDu_Collider>("pasted__pasted__SM_MianQiu7");
|
||||
nieZi = GameManager.Instance.transform.parent.FindFirst("ÊÖÄÃÄ÷×ÓÏû¶¾");
|
||||
mianQian = GameManager.Instance.senSor.GetSensor<MianQian_SenSor>();
|
||||
fsm.ShowCamera("헌썅쿱돛왯1_Camera");
|
||||
fsm.Light_EnableInteraction("쪘성땍춈헷");
|
||||
fsm.ShowArrow("듐샌쪘성땍춈헷", "쪘성땍춈헷");
|
||||
@ -37,8 +44,8 @@ namespace DongWuYiXue.DaoNiaoShu
|
||||
fsm.ShowTip(1);
|
||||
fsm.PlayBgm(1);
|
||||
fsm.Show("癎컬퀄綾句뗀");
|
||||
cor = Game.Instance.IEnumeratorManager.Run(3.0f, () =>
|
||||
{
|
||||
//cor = Game.Instance.IEnumeratorManager.Run(3.0f, () =>
|
||||
//{
|
||||
if (fsm.main_gameModel.modeType == ModeType.ShiXun)
|
||||
{
|
||||
fsm.AddScore(5, 1);
|
||||
@ -47,17 +54,24 @@ namespace DongWuYiXue.DaoNiaoShu
|
||||
{
|
||||
fsm.AddScore(5, 1);
|
||||
}
|
||||
fsm.nextState = true;
|
||||
});
|
||||
//fsm.nextState = true;
|
||||
//});
|
||||
});
|
||||
}
|
||||
public override void OnStateStay()
|
||||
{
|
||||
base.OnStateStay();
|
||||
nieZi.transform.localEulerAngles = new Vector3(-mianQian.X, mianQian.Y, mianQian.Z);
|
||||
if (xiaoDu.colliderNum >= 4)
|
||||
{
|
||||
xiaoDu.ExitCollider();
|
||||
fsm.nextState = true;
|
||||
}
|
||||
}
|
||||
public override void OnStateExit()
|
||||
{
|
||||
base.OnStateExit();
|
||||
xiaoDu.ExitCollider();
|
||||
fsm.HideTipBtn();
|
||||
if (null != cor)
|
||||
{
|
||||
|
||||
@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 4c747a350263f2a46aec4626ea6137bf
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@ -0,0 +1,99 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using ZXKFramework;
|
||||
|
||||
public class XiaoDu_Collider : MonoBehaviour
|
||||
{
|
||||
bool isCollider1;
|
||||
bool isCollider2;
|
||||
bool isCollider3;
|
||||
bool isCollider4;
|
||||
bool isCollider5;
|
||||
bool isCollider6;
|
||||
bool isCollider7;
|
||||
bool isCollider8;
|
||||
[HideInInspector]
|
||||
public int colliderNum;
|
||||
BoxCollider boxCollider;
|
||||
Coroutine cor;
|
||||
private void Start()
|
||||
{
|
||||
boxCollider = GetComponent<BoxCollider>();
|
||||
}
|
||||
private void OnTriggerEnter(Collider collision)
|
||||
{
|
||||
// this.Error(collision.gameObject.name);
|
||||
switch (collision.gameObject.name)
|
||||
{
|
||||
case "消毒碰撞器1":
|
||||
isCollider1 = true;
|
||||
break;
|
||||
case "消毒碰撞器2":
|
||||
isCollider2 = true;
|
||||
break;
|
||||
case "消毒碰撞器3":
|
||||
isCollider3 = true;
|
||||
break;
|
||||
case "消毒碰撞器4":
|
||||
isCollider4 = true;
|
||||
break;
|
||||
case "消毒碰撞器5":
|
||||
isCollider5 = true;
|
||||
break;
|
||||
case "消毒碰撞器6":
|
||||
isCollider6 = true;
|
||||
break;
|
||||
case "消毒碰撞器7":
|
||||
isCollider7 = true;
|
||||
break;
|
||||
case "消毒碰撞器8":
|
||||
isCollider8 = true;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
bool isTrigg;
|
||||
private void Update()
|
||||
{
|
||||
if (!isTrigg && isCollider1 && isCollider2 && isCollider3 && isCollider4 && isCollider5 && isCollider6 && isCollider7 && isCollider8)
|
||||
{
|
||||
colliderNum++;
|
||||
this.Error($"触发了{colliderNum}次");
|
||||
isTrigg = true;
|
||||
isCollider1 = false;
|
||||
isCollider2 = false;
|
||||
isCollider3 = false;
|
||||
isCollider4 = false;
|
||||
isCollider5 = false;
|
||||
isCollider6 = false;
|
||||
isCollider7 = false;
|
||||
isCollider8 = false;
|
||||
cor = Game.Instance.IEnumeratorManager.Run(2.0f, () =>
|
||||
{
|
||||
isTrigg = false;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
public void ExitCollider()
|
||||
{
|
||||
if (cor != null)
|
||||
{
|
||||
Game.Instance.IEnumeratorManager.Stop(cor);
|
||||
cor = null;
|
||||
isCollider1 = false;
|
||||
isCollider2 = false;
|
||||
isCollider3 = false;
|
||||
isCollider4 = false;
|
||||
isCollider5 = false;
|
||||
isCollider6 = false;
|
||||
isCollider7 = false;
|
||||
isCollider8 = false;
|
||||
colliderNum = 0;
|
||||
isTrigg = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 6db5a9d899b089341aabf73af2a5e8f9
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@ -3,7 +3,8 @@
|
||||
--- !u!78 &1
|
||||
TagManager:
|
||||
serializedVersion: 2
|
||||
tags: []
|
||||
tags:
|
||||
- XiaoDuColl
|
||||
layers:
|
||||
- Default
|
||||
- TransparentFX
|
||||
|
||||
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user