Beispiel #1
0
 private void OnTriggerExit2D(Collider2D col)
 {
     if (!col.CompareTag("Ground"))
     {
         _state = TouchingState.Luft;
     }
     Debug.Log("Wieder in der luft");
 }
Beispiel #2
0
 private void OnTriggerEnter2D(Collider2D col)
 {
     if (col.CompareTag("LW"))
     {
         _state = TouchingState.Links;
         Debug.Log("Links berührt");
     }
     if (col.CompareTag("RW"))
     {
         _state = TouchingState.Rechts;
         Debug.Log("Rechts berührt");
     }
     if (col.CompareTag("Ground"))
     {
         myRb.velocity = new Vector2(0, pushY);
         Debug.Log("U DED");
     }
 }
Beispiel #3
0
            public void SwitchState(HandGesture inputType)
            {
                BaseInputState state = null;

                switch (inputType)
                {
                case HandGesture.Touching:
                    state = new TouchingState(m_InputTouch);
                    break;

                case HandGesture.Click:
                    state = new ClickState(m_InputTouch);
                    break;

                case HandGesture.Holding:
                    state = new HoldingState(m_InputTouch);
                    break;

                case HandGesture.Drag:
                    state = new DragState(m_InputTouch);
                    break;

                case HandGesture.Slip:
                    state = new SlipState(m_InputTouch);
                    break;

                case HandGesture.Realease:
                    state = new ReleaseState(m_InputTouch);
                    break;

                default:
                    state = new NoneInput(m_InputTouch);
                    break;
                }
                if (state != null)
                {
                    Switch(state);
                }
                else
                {
                    Debug.Log("InputStateFSM.SwitchState " + inputType + "is None");
                }
            }