最新对接硬件提交;连接集尿袋需要图像识别训练
This commit is contained in:
parent
041a4a01ff
commit
d6e7eaa5ae
@ -13,17 +13,39 @@ public class DaoNiao_Sensor : Sensor
|
|||||||
public float daoNiaoDeep;
|
public float daoNiaoDeep;
|
||||||
string data;
|
string data;
|
||||||
public Text txt;
|
public Text txt;
|
||||||
|
|
||||||
|
[HideInInspector]
|
||||||
|
public bool isOpen;
|
||||||
|
|
||||||
|
float time;
|
||||||
|
float lastTime;
|
||||||
|
|
||||||
public override void ReceiveData(string datas, SerialPort sp = null)
|
public override void ReceiveData(string datas, SerialPort sp = null)
|
||||||
{
|
{
|
||||||
base.ReceiveData(datas);
|
base.ReceiveData(datas);
|
||||||
data = datas.Split("#")[1].Split("%")[0];
|
data = datas.Split("#")[1].Split("%")[0];
|
||||||
if (!data.Contains("DWYX2")) return;
|
if (!data.Contains("DWYX2")) return;
|
||||||
|
lastTime = time;
|
||||||
if (data.Contains("DNDeep"))
|
if (data.Contains("DNDeep"))
|
||||||
{
|
{
|
||||||
daoNiaoDeep = float.Parse(data.Split(",")[4].Split(":")[1].Split("mm")[0]);
|
daoNiaoDeep = float.Parse(data.Split(",")[4].Split(":")[1].Split("mm")[0]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void Update()
|
||||||
|
{
|
||||||
|
time += Time.deltaTime;
|
||||||
|
if (time - lastTime < 1.0f)
|
||||||
|
{
|
||||||
|
isOpen = true;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
isOpen = false;
|
||||||
|
//progressValue = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public override void Display(string datas)
|
public override void Display(string datas)
|
||||||
{
|
{
|
||||||
base.Display(datas);
|
base.Display(datas);
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
@ -0,0 +1,7 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: fb337db497dfbe846a1692aa0b373fbb
|
||||||
|
DefaultImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
File diff suppressed because one or more lines are too long
@ -0,0 +1,7 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 11778fdebc501ae4ca00d9f9f2f177b7
|
||||||
|
DefaultImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -0,0 +1,7 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 4fce289712ef5eb4096c950151b7ed41
|
||||||
|
DefaultImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
File diff suppressed because one or more lines are too long
@ -0,0 +1,7 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 3df8ad9a4d4d2d747a5c89891e5082e7
|
||||||
|
DefaultImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
File diff suppressed because one or more lines are too long
@ -0,0 +1,7 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: bdd0af839a36d54418ad4e939aa574f2
|
||||||
|
DefaultImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -0,0 +1,7 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: f2a6ea8234b3aa34d9e2b30369fabc4c
|
||||||
|
DefaultImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -0,0 +1,7 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 74b1cd8af5c2fa24abec377e745b2a6f
|
||||||
|
DefaultImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
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
@ -0,0 +1,7 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 10eec1baf7f40e046beae5ec2394efc3
|
||||||
|
DefaultImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
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
@ -0,0 +1,7 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 889b0d5851379c540b5d32218fb51cf5
|
||||||
|
DefaultImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -0,0 +1,7 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: e380661f98d27544f9e5abfda009d423
|
||||||
|
DefaultImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
File diff suppressed because one or more lines are too long
@ -0,0 +1,7 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 85195b27ebe602b47a6675e63e5f53ce
|
||||||
|
DefaultImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -0,0 +1,7 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 26139468688cb194ba244461e3d9365b
|
||||||
|
DefaultImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -0,0 +1,7 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 10f3f85b3f090f944a9860c93fc1b66d
|
||||||
|
DefaultImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
File diff suppressed because one or more lines are too long
@ -180,6 +180,15 @@ namespace DongWuYiXue.DaoNiaoShu
|
|||||||
//²¥·ÅTimeline
|
//²¥·ÅTimeline
|
||||||
Coroutine coroutine;
|
Coroutine coroutine;
|
||||||
|
|
||||||
|
public void StopClip(string value)
|
||||||
|
{
|
||||||
|
if (Game.Instance)
|
||||||
|
{
|
||||||
|
Game.Instance.IEnumeratorManager.Stop(coroutine);
|
||||||
|
GameManager.Instance.timelineManager.StopNormalCilp(value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public void PlayClip(string value, Action callBack = null)
|
public void PlayClip(string value, Action callBack = null)
|
||||||
{
|
{
|
||||||
float t = GetClipLength(value);
|
float t = GetClipLength(value);
|
||||||
|
|||||||
@ -9,6 +9,7 @@ namespace DongWuYiXue.DaoNiaoShu
|
|||||||
AVProValue avProValue;
|
AVProValue avProValue;
|
||||||
bool isBaGuan = false;
|
bool isBaGuan = false;
|
||||||
float baGuanValue = 0;
|
float baGuanValue = 0;
|
||||||
|
float value;
|
||||||
public override void OnStateEnter()
|
public override void OnStateEnter()
|
||||||
{
|
{
|
||||||
base.OnStateEnter();
|
base.OnStateEnter();
|
||||||
@ -37,19 +38,24 @@ namespace DongWuYiXue.DaoNiaoShu
|
|||||||
if (isBaGuan && Input.GetKeyDown(KeyCode.L))
|
if (isBaGuan && Input.GetKeyDown(KeyCode.L))
|
||||||
{
|
{
|
||||||
baGuanValue = 1.0f;
|
baGuanValue = 1.0f;
|
||||||
fsm.PlayClip("°Î¹Ü_TimeLine", null, baGuanValue);
|
isBaGuan = false;
|
||||||
|
fsm.PlayClip("°Î¹Ü_TimeLine", () =>
|
||||||
|
{
|
||||||
|
fsm.nextState = true;
|
||||||
|
});
|
||||||
avProValue.PlayValue = baGuanValue;
|
avProValue.PlayValue = baGuanValue;
|
||||||
avProValue.PlayVideoAsValue();
|
avProValue.PlayVideoAsValue();
|
||||||
}
|
}
|
||||||
if (isBaGuan && GameManager.Instance.senSor.GetSensor<DaoNiao_Sensor>().daoNiaoDeep <= 0f)
|
if (isBaGuan && GameManager.Instance.senSor.GetSensor<DaoNiao_Sensor>().isOpen)
|
||||||
{
|
{
|
||||||
//baGuanValue += .0005f;
|
//baGuanValue += .0005f;
|
||||||
baGuanValue = 1.0f;
|
value = GameManager.Instance.senSor.GetSensor<DaoNiao_Sensor>().daoNiaoDeep / 20;
|
||||||
fsm.PlayClip("°Î¹Ü_TimeLine", null, baGuanValue);
|
//baGuanValue = 1.0f;
|
||||||
avProValue.PlayValue = baGuanValue;
|
fsm.PlayClip("°Î¹Ü_TimeLine", null, 1 - value);
|
||||||
|
avProValue.PlayValue = 1 - value;
|
||||||
avProValue.PlayVideoAsValue();
|
avProValue.PlayVideoAsValue();
|
||||||
}
|
}
|
||||||
if (baGuanValue >= 1.0f && isBaGuan)
|
if (1 - value >= 1.0f && isBaGuan)
|
||||||
{
|
{
|
||||||
isBaGuan = false;
|
isBaGuan = false;
|
||||||
|
|
||||||
@ -64,6 +70,10 @@ namespace DongWuYiXue.DaoNiaoShu
|
|||||||
}
|
}
|
||||||
fsm.nextState = true;
|
fsm.nextState = true;
|
||||||
}
|
}
|
||||||
|
if (!GameManager.Instance.senSor.GetSensor<DaoNiao_Sensor>().isOpen)
|
||||||
|
{
|
||||||
|
fsm.StopClip("°Î¹Ü_TimeLine");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
public override void OnStateExit()
|
public override void OnStateExit()
|
||||||
{
|
{
|
||||||
|
|||||||
@ -10,6 +10,7 @@ namespace DongWuYiXue.DaoNiaoShu
|
|||||||
float chaGuanValue = 0;
|
float chaGuanValue = 0;
|
||||||
Coroutine cor;
|
Coroutine cor;
|
||||||
AVProValue avProValue;
|
AVProValue avProValue;
|
||||||
|
float value;
|
||||||
public override void OnStateEnter()
|
public override void OnStateEnter()
|
||||||
{
|
{
|
||||||
base.OnStateEnter();
|
base.OnStateEnter();
|
||||||
@ -39,18 +40,44 @@ namespace DongWuYiXue.DaoNiaoShu
|
|||||||
if (isChaGuan && Input.GetKeyDown(KeyCode.L))
|
if (isChaGuan && Input.GetKeyDown(KeyCode.L))
|
||||||
{
|
{
|
||||||
chaGuanValue = 1.0f;
|
chaGuanValue = 1.0f;
|
||||||
fsm.PlayClip("²å¹Ü_TimeLine", null, chaGuanValue);
|
isChaGuan = false;
|
||||||
avProValue.PlayValue = chaGuanValue;
|
fsm.PlayClip("²å¹Ü_TimeLine", () =>
|
||||||
avProValue.PlayVideoAsValue();
|
{
|
||||||
|
fsm.ShowCamera("²å¹Ü2_Camera");
|
||||||
|
fsm.PlayClip("²å¹ÜºóÅÅÄò_TimeLine", () =>
|
||||||
|
{
|
||||||
|
if (fsm.main_gameModel.modeType == ModeType.ShiXun)
|
||||||
|
{
|
||||||
|
fsm.nextState = true;
|
||||||
|
}
|
||||||
|
if (fsm.main_gameModel.modeType == ModeType.KaoHe)
|
||||||
|
{
|
||||||
|
fsm.ShowTxtQuestion("²åÈëµ¼Äò¹Ü¡·²å¹Ü¡·²½Öè2", 3, 5, 3, () =>
|
||||||
|
{
|
||||||
|
fsm.nextState = true;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
avProValue.gameObject.SetActive(false);
|
||||||
}
|
}
|
||||||
if (isChaGuan && GameManager.Instance.senSor.GetSensor<DaoNiao_Sensor>().daoNiaoDeep > 20f)
|
|
||||||
|
if (isChaGuan && GameManager.Instance.senSor.GetSensor<DaoNiao_Sensor>().isOpen)
|
||||||
{
|
{
|
||||||
chaGuanValue = 1.0f;
|
value = GameManager.Instance.senSor.GetSensor<DaoNiao_Sensor>().daoNiaoDeep / 20;
|
||||||
fsm.PlayClip("²å¹Ü_TimeLine", null, chaGuanValue);
|
fsm.PlayClip("²å¹Ü_TimeLine", null, value);
|
||||||
avProValue.PlayValue = chaGuanValue;
|
avProValue.PlayValue = value;
|
||||||
avProValue.PlayVideoAsValue();
|
avProValue.PlayVideoAsValue();
|
||||||
}
|
}
|
||||||
if (chaGuanValue >= 1.0f && isChaGuan)
|
|
||||||
|
//if (isChaGuan && GameManager.Instance.senSor.GetSensor<DaoNiao_Sensor>().daoNiaoDeep > 20f)
|
||||||
|
//{
|
||||||
|
// chaGuanValue = 1.0f;
|
||||||
|
// fsm.PlayClip("²å¹Ü_TimeLine", null, chaGuanValue);
|
||||||
|
// avProValue.PlayValue = chaGuanValue;
|
||||||
|
// avProValue.PlayVideoAsValue();
|
||||||
|
//}
|
||||||
|
if (value >= 1.0f && isChaGuan)
|
||||||
{
|
{
|
||||||
isChaGuan = false;
|
isChaGuan = false;
|
||||||
|
|
||||||
@ -79,6 +106,10 @@ namespace DongWuYiXue.DaoNiaoShu
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
if (!GameManager.Instance.senSor.GetSensor<DaoNiao_Sensor>().isOpen)
|
||||||
|
{
|
||||||
|
fsm.StopClip("²å¹Ü_TimeLine");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
public override void OnStateExit()
|
public override void OnStateExit()
|
||||||
{
|
{
|
||||||
|
|||||||
@ -41,10 +41,11 @@ namespace DongWuYiXue.DaoNiaoShu
|
|||||||
|
|
||||||
for (int i = 0; i < listBaseData.Count; i++)
|
for (int i = 0; i < listBaseData.Count; i++)
|
||||||
{
|
{
|
||||||
numID++;
|
|
||||||
Step st = steps.Find(e => e.parentName == listBaseData[i].parentName && e.stepName == listBaseData[i].name);
|
Step st = steps.Find(e => e.parentName == listBaseData[i].parentName && e.stepName == listBaseData[i].name);
|
||||||
if (st != null)
|
if (st != null)
|
||||||
{
|
{
|
||||||
|
numID++;
|
||||||
|
|
||||||
//Step s = steps[i];
|
//Step s = steps[i];
|
||||||
GameObject obj = Instantiate(step, content);
|
GameObject obj = Instantiate(step, content);
|
||||||
obj.SetActive(true);
|
obj.SetActive(true);
|
||||||
@ -58,6 +59,8 @@ namespace DongWuYiXue.DaoNiaoShu
|
|||||||
{
|
{
|
||||||
if (!string.IsNullOrEmpty(listBaseData[i].score_sx))
|
if (!string.IsNullOrEmpty(listBaseData[i].score_sx))
|
||||||
{
|
{
|
||||||
|
numID++;
|
||||||
|
|
||||||
GameObject obj = Instantiate(step, content);
|
GameObject obj = Instantiate(step, content);
|
||||||
obj.SetActive(true);
|
obj.SetActive(true);
|
||||||
obj.transform.FindFirst<Text>("ID").text = numID.ToString();
|
obj.transform.FindFirst<Text>("ID").text = numID.ToString();
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user