/// <summary> /// 延迟处理面部结果 /// </summary> private IEnumerator DelayHandleFace(Texture2D faceTex) { yield return(new WaitForSeconds(4)); if (_face != null) { _webCam?.Close(); _fsmSystem?.SetTransition((int)UIFaceRecTransition.Analyze, _face, faceTex); } else { _fsmSystem?.SetTransition((int)UIFaceRecTransition.Default); } }
public override void OnStay() { if (Input.GetKeyDown(KeyCode.B)) { if (_fsmSystem != null) { _fsmSystem.SetTransition((int)State.B, "A to B"); } } if (Input.GetKeyDown(KeyCode.C)) { if (_fsmSystem != null) { _fsmSystem.SetTransition((int)State.C); } } }
protected override void OnEnterStart() { if (_fsmSystem == null) { GenerateFSM(); } _fsmSystem?.SetTransition((int)UIFaceRecTransition.Default); }
private void Update() { if (_fsmSystem != null) { _fsmSystem.Update(); } if (Input.GetKeyDown(KeyCode.Space)) { if (_fsmSystem != null) { _fsmSystem.SetTransition((int)State.C); } } if (Input.GetKeyDown(KeyCode.Escape)) { if (_fsmSystem != null) { _fsmSystem.TurnDefault(); } } }
private void MInput_OnSimpleTap(MGesture gesture) { _fsmSystem?.SetTransition((int)UIFaceRecTransition.Detect); }