|
@@ -128,6 +128,10 @@ public class RKZYLayer : YZTRootLayer
|
|
|
public LinePathUnit linePathUnitPrefab;
|
|
|
|
|
|
public LinePath linePathPrefab;
|
|
|
+
|
|
|
+ public RectTransform startPos;
|
|
|
+ public RectTransform endPos;
|
|
|
+ public RectTransform pathSign;
|
|
|
// Start is called before the first frame update
|
|
|
async void Start()
|
|
|
{
|
|
@@ -233,6 +237,7 @@ public class RKZYLayer : YZTRootLayer
|
|
|
{
|
|
|
LinePath lineParent = Instantiate(linePathPrefab);
|
|
|
lineParent.transform.SetParent(beforeC);
|
|
|
+ float clolorLerpUnit = 1.0f / (GlobalData.allServerMovePlans[i].paths.Count - 1);
|
|
|
for (int j = 0; j < GlobalData.allServerMovePlans[i].paths.Count - 1; j++)
|
|
|
{
|
|
|
LinePathUnit linePath = Instantiate(linePathUnitPrefab);
|
|
@@ -247,7 +252,21 @@ public class RKZYLayer : YZTRootLayer
|
|
|
worldPos1.z = -583;
|
|
|
|
|
|
linePath.SetPath(worldPos, worldPos1);
|
|
|
-
|
|
|
+ linePath.SetColor(Color.Lerp(Color.yellow, Color.red, j * clolorLerpUnit), Color.Lerp(Color.yellow, Color.red, (j + 1) * clolorLerpUnit));
|
|
|
+ if (j == 0)
|
|
|
+ {
|
|
|
+ RectTransform startSign = Instantiate(startPos);
|
|
|
+ startSign.SetParent(pathSign);
|
|
|
+ startSign.transform.localScale = Vector3.one;
|
|
|
+ startSign.GetComponent<PathSign>().bindObj = linePath.gameObject;
|
|
|
+ }
|
|
|
+ if (j == GlobalData.allServerMovePlans[i].paths.Count - 2)
|
|
|
+ {
|
|
|
+ RectTransform endSign = Instantiate(endPos);
|
|
|
+ endSign.SetParent(pathSign);
|
|
|
+ endSign.transform.localScale = Vector3.one;
|
|
|
+ endSign.GetComponent<PathSign>().bindObj = linePath.gameObject;
|
|
|
+ }
|
|
|
}
|
|
|
lineParent.startPos = GlobalData.allServerMovePlans[i].from;
|
|
|
lineParent.endPos = GlobalData.allServerMovePlans[i].to;
|
|
@@ -280,6 +299,8 @@ public class RKZYLayer : YZTRootLayer
|
|
|
LinePath lineParent = Instantiate(linePathPrefab);
|
|
|
lineParent.transform.SetParent(afterC);
|
|
|
|
|
|
+ float clolorLerpUnit = 1.0f / (GlobalData.allServerMovePlans[i].paths.Count - 1);
|
|
|
+
|
|
|
for (int j = 0; j < GlobalData.allServerMovePlans[i].paths.Count - 1; j++)
|
|
|
{
|
|
|
LinePathUnit linePath = Instantiate(linePathUnitPrefab);
|
|
@@ -291,6 +312,22 @@ public class RKZYLayer : YZTRootLayer
|
|
|
Vector3 worldPos1 = runtimPointParent.TransformPoint(localPos1);
|
|
|
worldPos1.z = -583;
|
|
|
linePath.SetPath(worldPos, worldPos1);
|
|
|
+ linePath.SetColor(Color.Lerp(Color.yellow, Color.red, j * clolorLerpUnit), Color.Lerp(Color.yellow, Color.red, (j + 1) * clolorLerpUnit));
|
|
|
+
|
|
|
+ if (j == 0)
|
|
|
+ {
|
|
|
+ RectTransform startSign = Instantiate(startPos);
|
|
|
+ startSign.SetParent(pathSign);
|
|
|
+ startSign.transform.localScale = Vector3.one;
|
|
|
+ startSign.GetComponent<PathSign>().bindObj = linePath.gameObject;
|
|
|
+ }
|
|
|
+ if (j == GlobalData.allServerMovePlans[i].paths.Count - 2)
|
|
|
+ {
|
|
|
+ RectTransform endSign = Instantiate(endPos);
|
|
|
+ endSign.SetParent(pathSign);
|
|
|
+ endSign.transform.localScale = Vector3.one;
|
|
|
+ endSign.GetComponent<PathSign>().bindObj = linePath.gameObject;
|
|
|
+ }
|
|
|
}
|
|
|
lineParent.startPos = GlobalData.allServerMovePlans[i].from;
|
|
|
lineParent.endPos = GlobalData.allServerMovePlans[i].to;
|