Exemplo n.º 1
0
        /// <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);
            }
        }
Exemplo n.º 2
0
    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);
            }
        }
    }
Exemplo n.º 3
0
        protected override void OnEnterStart()
        {
            if (_fsmSystem == null)
            {
                GenerateFSM();
            }

            _fsmSystem?.SetTransition((int)UIFaceRecTransition.Default);
        }
Exemplo n.º 4
0
    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();
            }
        }
    }
Exemplo n.º 5
0
 private void MInput_OnSimpleTap(MGesture gesture)
 {
     _fsmSystem?.SetTransition((int)UIFaceRecTransition.Detect);
 }