Commit 98bb0b13 authored by wanqing's avatar wanqing

更换手指图标,设置只支持竖屏

parent 19b119b3
...@@ -63,6 +63,12 @@ public class BattleCtrl : MonoBehaviour ...@@ -63,6 +63,12 @@ public class BattleCtrl : MonoBehaviour
void Init() void Init()
{ {
//设置竖屏
Screen.orientation = ScreenOrientation.Portrait;
Screen.autorotateToPortrait = true;
Screen.autorotateToPortraitUpsideDown = true;
Screen.autorotateToLandscapeLeft = false;
Screen.autorotateToLandscapeRight = false;
//GameServices.inputService.DisableService(); //GameServices.inputService.DisableService();
//预加载 //预加载
......
...@@ -146,13 +146,10 @@ public class ChainRopeView : MonoBehaviour ...@@ -146,13 +146,10 @@ public class ChainRopeView : MonoBehaviour
void OnMove(Vector3 dir) void OnMove(Vector3 dir)
{ {
//移动区域 //移动区域
if(Input.mousePosition.y > Screen.height / 2f) if (Input.mousePosition.y > Screen.height / 2f)
{ {
return; return;
} }
float varX = Input.mousePosition.x - Screen.width / 2f;
float varY = Input.mousePosition.y - Screen.height / 2f;
BattleCtrl.instance.battleUI.SetMousePos(varX, varY);
if (!BattleCtrl.instance.isStartBattle) if (!BattleCtrl.instance.isStartBattle)
{ {
return; return;
...@@ -246,7 +243,6 @@ public class ChainRopeView : MonoBehaviour ...@@ -246,7 +243,6 @@ public class ChainRopeView : MonoBehaviour
{ {
return; return;
} }
BattleCtrl.instance.battleUI.SetMousePos(0,0);
if (!BattleCtrl.instance.isStartBattle) if (!BattleCtrl.instance.isStartBattle)
{ {
return; return;
...@@ -568,7 +564,17 @@ public class ChainRopeView : MonoBehaviour ...@@ -568,7 +564,17 @@ public class ChainRopeView : MonoBehaviour
if(!BattleCtrl.instance.isStartBattle) if(!BattleCtrl.instance.isStartBattle)
{ {
return; return;
} }
if (Input.GetMouseButton(0))
{
float varX = Input.mousePosition.x - Screen.width / 2f;
float varY = Input.mousePosition.y - Screen.height / 2f;
BattleCtrl.instance.battleUI.SetMousePos(varX, varY);
}
else if (Input.GetMouseButtonUp(0))
{
BattleCtrl.instance.battleUI.SetMousePos(0, 0);
}
//if(Input.GetMouseButtonDown(0)) //if(Input.GetMouseButtonDown(0))
//{ //{
// mouse_event(MOUSEEVENTF_LEFTDOWN, 0, 0, 0, UIntPtr.Zero); // mouse_event(MOUSEEVENTF_LEFTDOWN, 0, 0, 0, UIntPtr.Zero);
......
...@@ -12839,7 +12839,7 @@ RectTransform: ...@@ -12839,7 +12839,7 @@ RectTransform:
m_GameObject: {fileID: 7975587463478854421} m_GameObject: {fileID: 7975587463478854421}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 0.3, y: 0.3, z: 1} m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: [] m_Children: []
m_Father: {fileID: 6064464677632144690} m_Father: {fileID: 6064464677632144690}
m_RootOrder: 11 m_RootOrder: 11
...@@ -12847,7 +12847,7 @@ RectTransform: ...@@ -12847,7 +12847,7 @@ RectTransform:
m_AnchorMin: {x: 0.5, y: 0.5} m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5} m_AnchorMax: {x: 0.5, y: 0.5}
m_AnchoredPosition: {x: 0, y: 0} m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 455, y: 538} m_SizeDelta: {x: 145, y: 167}
m_Pivot: {x: 0.5, y: 0.5} m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &3934230584123945970 --- !u!222 &3934230584123945970
CanvasRenderer: CanvasRenderer:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment