浏览代码

人口转移还有一些bug

wartheking 7 月之前
父节点
当前提交
04de8590f5
共有 2 个文件被更改,包括 6 次插入2 次删除
  1. 2 2
      Assets/PathSign.cs
  2. 4 0
      Assets/Scripts/UI/UIView/RKZY/RKZYLayer.cs

+ 2 - 2
Assets/PathSign.cs

@@ -7,14 +7,14 @@ using UnityEngine.UI;
 public class PathSign : MonoBehaviour
 public class PathSign : MonoBehaviour
 {
 {
     public GameObject bindObj;
     public GameObject bindObj;
-
+    public Vector3 bindPos;
 
 
     // Update is called once per frame
     // Update is called once per frame
     void LateUpdate()
     void LateUpdate()
     {
     {
         if (bindObj != null)
         if (bindObj != null)
         {
         {
-            this.GetComponent<RectTransform>().anchoredPosition = CameraManager.instance.secondCamera.WorldToScreenPoint(bindObj.transform.position) / Screen.width * 1920.0f;
+            this.GetComponent<RectTransform>().anchoredPosition = CameraManager.instance.secondCamera.WorldToScreenPoint(bindPos) / Screen.width * 1920.0f;
             float dyScale = 72 / CameraManager.instance.secondCamera.GetComponent<CameraBirdSec>().currentDistance;
             float dyScale = 72 / CameraManager.instance.secondCamera.GetComponent<CameraBirdSec>().currentDistance;
             dyScale = math.clamp(dyScale, 1, 6);
             dyScale = math.clamp(dyScale, 1, 6);
             this.transform.localScale = new Vector3(dyScale, dyScale, dyScale);
             this.transform.localScale = new Vector3(dyScale, dyScale, dyScale);

+ 4 - 0
Assets/Scripts/UI/UIView/RKZY/RKZYLayer.cs

@@ -259,6 +259,7 @@ public class RKZYLayer : YZTRootLayer
                         startSign.SetParent(pathSign);
                         startSign.SetParent(pathSign);
                         startSign.transform.localScale = Vector3.one;
                         startSign.transform.localScale = Vector3.one;
                         startSign.GetComponent<PathSign>().bindObj = linePath.gameObject;
                         startSign.GetComponent<PathSign>().bindObj = linePath.gameObject;
+                        startSign.GetComponent<PathSign>().bindPos = worldPos;
                     }
                     }
                     if (j == GlobalData.allServerMovePlans[i].paths.Count - 2)
                     if (j == GlobalData.allServerMovePlans[i].paths.Count - 2)
                     {
                     {
@@ -266,6 +267,7 @@ public class RKZYLayer : YZTRootLayer
                         endSign.SetParent(pathSign);
                         endSign.SetParent(pathSign);
                         endSign.transform.localScale = Vector3.one;
                         endSign.transform.localScale = Vector3.one;
                         endSign.GetComponent<PathSign>().bindObj = linePath.gameObject;
                         endSign.GetComponent<PathSign>().bindObj = linePath.gameObject;
+                        endSign.GetComponent<PathSign>().bindPos = worldPos1;
                     }
                     }
                 }
                 }
                 lineParent.startPos = GlobalData.allServerMovePlans[i].from;
                 lineParent.startPos = GlobalData.allServerMovePlans[i].from;
@@ -320,6 +322,7 @@ public class RKZYLayer : YZTRootLayer
                         startSign.SetParent(pathSign);
                         startSign.SetParent(pathSign);
                         startSign.transform.localScale = Vector3.one;
                         startSign.transform.localScale = Vector3.one;
                         startSign.GetComponent<PathSign>().bindObj = linePath.gameObject;
                         startSign.GetComponent<PathSign>().bindObj = linePath.gameObject;
+                        startSign.GetComponent<PathSign>().bindPos = worldPos;
                     }
                     }
                     if (j == GlobalData.allServerMovePlans[i].paths.Count - 2)
                     if (j == GlobalData.allServerMovePlans[i].paths.Count - 2)
                     {
                     {
@@ -327,6 +330,7 @@ public class RKZYLayer : YZTRootLayer
                         endSign.SetParent(pathSign);
                         endSign.SetParent(pathSign);
                         endSign.transform.localScale = Vector3.one;
                         endSign.transform.localScale = Vector3.one;
                         endSign.GetComponent<PathSign>().bindObj = linePath.gameObject;
                         endSign.GetComponent<PathSign>().bindObj = linePath.gameObject;
+                        endSign.GetComponent<PathSign>().bindPos = worldPos1;
                     }
                     }
                 }
                 }
                 lineParent.startPos = GlobalData.allServerMovePlans[i].from;
                 lineParent.startPos = GlobalData.allServerMovePlans[i].from;