RenderUtils.cs 748 B

1234567891011121314151617181920212223
  1. using ET;
  2. using UnityEngine;
  3. public static class RenderUtils
  4. {
  5. private static UnityEngine.Vector3 vecTemp;
  6. public static UnityEngine.Vector3 UnityPosFromBattle(CommonLang.Geometry.Vector3 pos)
  7. {
  8. vecTemp.Set(pos.X, pos.Z, BattleMgr.Instance.MapHeight - pos.Y);
  9. return vecTemp;
  10. }
  11. public static UnityEngine.Vector3 UnityPosFromBattle(UnityEngine.Vector3 pos)
  12. {
  13. vecTemp.Set(pos.x, pos.z, BattleMgr.Instance.MapHeight - pos.y);
  14. return vecTemp;
  15. }
  16. public static UnityEngine.Quaternion UnityRotationFromBattle(float rotation, float rotationX = 0f)
  17. {
  18. vecTemp.Set(-rotationX * Mathf.Rad2Deg, rotation * Mathf.Rad2Deg + 90, 0);
  19. return Quaternion.Euler(vecTemp);
  20. }
  21. }