Commit 3ec4f836 authored by wanqing's avatar wanqing

手指图标位置适配

parent 9825c061
...@@ -572,8 +572,8 @@ public class ChainRopeView : MonoBehaviour ...@@ -572,8 +572,8 @@ public class ChainRopeView : MonoBehaviour
//float varY = Input.mousePosition.y - Screen.height / 2f; //float varY = Input.mousePosition.y - Screen.height / 2f;
//BattleCtrl.instance.battleUI.SetMousePos(varX, varY); //BattleCtrl.instance.battleUI.SetMousePos(varX, varY);
Vector3 varVec3 = Camera.main.WorldToScreenPoint(m_topCollider.transform.position); Vector3 varVec3 = Camera.main.WorldToScreenPoint(m_topCollider.transform.position);
varVec3.x = varVec3.x - Screen.width / 2f + 100; varVec3.x = (varVec3.x - Screen.width / 2f)/ (Screen.width / GlobalConfig.NormalWidth) + 100;
varVec3.y = varVec3.y - Screen.height / 2f - 100; varVec3.y = (varVec3.y - Screen.height / 2f)/(Screen.width / GlobalConfig.NormalWidth) - 100;
BattleCtrl.instance.battleUI.SetMousePos(varVec3.x, varVec3.y); BattleCtrl.instance.battleUI.SetMousePos(varVec3.x, varVec3.y);
} }
else if (Input.GetMouseButtonUp(0)) else if (Input.GetMouseButtonUp(0))
......
...@@ -25,6 +25,15 @@ public class GlobalConfig ...@@ -25,6 +25,15 @@ public class GlobalConfig
public static string VibrationKey = "VibrationKey";//震动Key public static string VibrationKey = "VibrationKey";//震动Key
public static string SoundKey = "SoundKey";//音效Key public static string SoundKey = "SoundKey";//音效Key
public static string BgmKey = "BgmKey";//音乐Key public static string BgmKey = "BgmKey";//音乐Key
public static float NormalWidth = 1080f;
public static float NormalHeight = 1920f;
public static float CurRatio = (float)UnityEngine.Screen.height / (float)UnityEngine.Screen.width;
public static float NormalRatio = NormalHeight / NormalWidth;
public static float Ratio = CurRatio / NormalRatio;
public static float CanvaUIScaleX = BattleCtrl.instance.battleUI.gameObject.transform.localScale.x;//uicanva适配大小
} }
public enum LangeType public enum LangeType
......
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