示例#1
0
 public bool GetAxisRange(ref float fXrange, ref float fYRange)
 {
     if (TsPlatform.IsMobile)
     {
         if (TsPlatform.IsEditor)
         {
             if (NkInputManager.GetMouseButton(1))
             {
                 fXrange  = Input.GetAxis("Mouse X");
                 fYRange  = Input.GetAxis("Mouse Y");
                 fXrange *= this.xSpeed;
                 fYRange *= this.ySpeed;
             }
             return(true);
         }
         bool flag = false;
         if (Scene.CurScene == Scene.Type.WORLD)
         {
             flag = true;
         }
         if (flag && NkInputManager.IsJoystick())
         {
             int touchCount = Input.touchCount;
             if (touchCount == 0)
             {
                 return(false);
             }
             if (touchCount != 2)
             {
                 return(false);
             }
             Vector2 deltaPosition  = Input.GetTouch(0).deltaPosition;
             Vector2 deltaPosition2 = Input.GetTouch(1).deltaPosition;
             Vector2 vector         = Vector2.zero;
             this.m_bRotate = false;
             if (Input.GetTouch(0).phase == TouchPhase.Moved && Input.GetTouch(1).phase == TouchPhase.Stationary)
             {
                 vector         = deltaPosition;
                 this.m_bRotate = true;
             }
             else if (Input.GetTouch(1).phase == TouchPhase.Moved && Input.GetTouch(0).phase == TouchPhase.Stationary)
             {
                 vector         = deltaPosition2;
                 this.m_bRotate = true;
             }
             else if (Input.GetTouch(0).phase == TouchPhase.Moved && Input.GetTouch(1).phase == TouchPhase.Moved)
             {
                 vector         = deltaPosition2;
                 this.m_bRotate = true;
             }
             if (this.m_bRotate)
             {
                 fXrange = vector.x / (float)Screen.width * 1280f * this.xSpeed * this.m_fMobileRotate;
                 fYRange = vector.y / (float)Screen.height * 720f * this.ySpeed * this.m_fMobileRotate;
             }
         }
         else if (flag)
         {
             if (NrTSingleton <FormsManager> .Instance.IsMouseOverForm())
             {
                 return(false);
             }
             int touchCount2 = Input.touchCount;
             if (touchCount2 != 1)
             {
                 return(false);
             }
             Vector2 deltaPosition3 = Input.GetTouch(0).deltaPosition;
             Vector2 vector2        = Vector2.zero;
             this.m_bRotate = false;
             if (Input.GetTouch(0).phase == TouchPhase.Moved)
             {
                 vector2        = deltaPosition3;
                 this.m_bRotate = true;
             }
             if (this.m_bRotate)
             {
                 fXrange = vector2.x / (float)Screen.width * 1280f * this.xSpeed * this.m_fMobileRotate;
                 fYRange = vector2.y / (float)Screen.height * 720f * this.ySpeed * this.m_fMobileRotate;
             }
         }
         else
         {
             int touchCount3 = Input.touchCount;
             if (touchCount3 == 0)
             {
                 return(false);
             }
             if (touchCount3 != 2)
             {
                 return(false);
             }
             Vector2 deltaPosition4 = Input.GetTouch(0).deltaPosition;
             Vector2 deltaPosition5 = Input.GetTouch(1).deltaPosition;
             Vector2 vector3        = Vector2.zero;
             this.m_bRotate = false;
             if (Input.GetTouch(0).phase == TouchPhase.Moved && Input.GetTouch(1).phase == TouchPhase.Stationary)
             {
                 vector3        = deltaPosition4;
                 this.m_bRotate = true;
             }
             else if (Input.GetTouch(1).phase == TouchPhase.Moved && Input.GetTouch(0).phase == TouchPhase.Stationary)
             {
                 vector3        = deltaPosition5;
                 this.m_bRotate = true;
             }
             else if (Input.GetTouch(0).phase == TouchPhase.Moved && Input.GetTouch(1).phase == TouchPhase.Moved)
             {
                 vector3        = deltaPosition5;
                 this.m_bRotate = true;
             }
             if (this.m_bRotate)
             {
                 fXrange = vector3.x / (float)Screen.width * 1280f * this.xSpeed * this.m_fMobileRotate;
                 fYRange = vector3.y / (float)Screen.height * 720f * this.ySpeed * this.m_fMobileRotate;
             }
         }
         if (Scene.CurScene == Scene.Type.BATTLE && Battle.BATTLE != null)
         {
             Battle.BATTLE.SetCameraRotate(this.m_bRotate);
         }
         return(true);
     }
     else
     {
         if (NkInputManager.GetMouseButton(1))
         {
             fXrange  = Input.GetAxis("Mouse X");
             fYRange  = Input.GetAxis("Mouse Y");
             fXrange *= this.xSpeed;
             fYRange *= this.ySpeed;
             return(true);
         }
         return(false);
     }
 }
示例#2
0
 public bool IsCharEventEnable()
 {
     return(!this.IsNPCTalkState() && (!this.IsWorldScene() || !NkInputManager.IsJoystick()));
 }