ModelMinMap.cs 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. using UnityEngine.UI;
  5. public class ModelMinMap : MonoBehaviour
  6. {
  7. // Start is called before the first frame update
  8. public Vector3 modelMapScale;//获取模型地图的 比例
  9. private float offsetX;
  10. private float offsetZ;
  11. private void Start()
  12. {
  13. modelMapScale = this.transform.localScale;
  14. offsetX = this.transform.position.x;
  15. offsetZ = this.transform.position.z;
  16. }
  17. //public void AddPlayerTypeOfWorkMapArrow(string arrowPos)
  18. //{
  19. // GameObject arrow = Instantiate(cellPrefab) as GameObject;
  20. // playerTypeOfWorkPos = StrSubstringToV3(arrowPos);
  21. // arrow.transform.position = playerTypeOfWorkPos;
  22. // arrow.transform.parent = this.transform.parent.transform;
  23. //}
  24. //public void UpdatePlayerTypeOfWorkMapArrowTrasn(Vector3 pos)
  25. //{
  26. // float MyX = (1000 / modelMapScale.x) * 2;//比例尺
  27. // float MyZ = (1000 / modelMapScale.z) * 2;//比例尺
  28. // if (arrow != null)
  29. // arrow.transform.localPosition = new Vector3(pos.x / MyX, 0.01f, pos.z / MyZ);
  30. //}
  31. // Update is called once per frame
  32. }