Ejemplo n.º 1
0
    void TouchBegin(ref TouchEvent evt)
    {
//		Debug.Log("BENY: -------------------------------------------------------------------------------------------------------------------------");
//		Debug.Log("BENY: " + Time.timeSinceLevelLoad +  " TouchBegin : id=" + evt.Id + ", pos=" + evt.Position + ", delta=" + touch.deltaPosition);

        if (FingerIdInUse(ref evt, false))
        {
            if (m_MoveJoystick.FingerID == evt.Id)
            {
                m_MoveJoystick.OnTouchEnd(ref evt);
            }
            else if (m_ViewJoystick.FingerID == evt.Id)
            {
                m_ViewJoystick.OnTouchEnd(ref evt);
            }
        }

        /*InteractionObject touchedInteraction = TouchedInteractionIcon(evt.Position);
         * if(touchedInteraction)
         * {
         *      _States.UseObjectDelegate(touchedInteraction);
         *      return;
         * }*/

        if (m_States.Move.Enabled && m_MoveJoystick.FingerID == -1 && m_MoveJoystick.IsInside(ref evt))
        {
            m_MoveJoystick.OnTouchBegin(ref evt);
            return;
        }

        if (m_States.View.Enabled && m_ViewJoystick.On == false && m_ViewJoystick.IsInside(ref evt))
        {
            //Debug.Log(Time.timeSinceLevelLoad + " View Joystick aquired " + evt.Id + "pos " + evt.Position);

            //Debug.Log(">>>> VIEW BEGIN");

            m_ViewJoystick.FingerID = evt.Id;
            m_ViewJoystick.SetCenter(evt.Position);
            m_ViewJoystick.Rotation = Player.LocalInstance.Owner.BlackBoard.Desires.Rotation;

            m_States.View.ZeroInput();
        }
    }