Browse Source

提交人口转移修改

wartheking 1 month ago
parent
commit
c7038cefef

BIN
Assets/Art/Textrue/Effect/TB1.png


BIN
Assets/Art/Textrue/Effect/TB2.png


+ 11 - 0
Assets/PathSign.cs

@@ -1,3 +1,4 @@
+using System;
 using System.Collections;
 using System.Collections.Generic;
 using Unity.Mathematics;
@@ -9,6 +10,10 @@ public class PathSign : MonoBehaviour
     public GameObject bindObj;
     public Vector3 bindPos;
 
+
+    public void SetIndex(int index) { 
+        this.GetComponentInChildren<Text>().text = index.ToString();
+    }
     // Update is called once per frame
     void LateUpdate()
     {
@@ -23,9 +28,15 @@ public class PathSign : MonoBehaviour
             if (!bindObj.activeSelf || !bindObj.transform.parent.gameObject.activeSelf || !bindObj.transform.parent.parent.gameObject.activeSelf)
             {
                 this.GetComponent<Image>().enabled = false;
+                this.GetComponentInChildren<Text>().enabled = false;
+                if(this.GetComponentInChildren<Button>() != null)
+                    this.GetComponentInChildren<Button>().interactable = false;
             }
             else {
                 this.GetComponent<Image>().enabled = true;
+                this.GetComponentInChildren<Text>().enabled = true;
+                if (this.GetComponentInChildren<Button>() != null)
+                    this.GetComponentInChildren<Button>().interactable = true;
             }
 
         }

+ 205 - 1
Assets/Prefabs/UI/Start.prefab

@@ -30,7 +30,9 @@ RectTransform:
   m_LocalPosition: {x: 0, y: 0, z: 0}
   m_LocalScale: {x: 1, y: 1, z: 1}
   m_ConstrainProportionsScale: 0
-  m_Children: []
+  m_Children:
+  - {fileID: 7812312644182504010}
+  - {fileID: 1122381128211880134}
   m_Father: {fileID: 0}
   m_RootOrder: 0
   m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
@@ -90,3 +92,205 @@ MonoBehaviour:
   m_Name: 
   m_EditorClassIdentifier: 
   bindObj: {fileID: 0}
+  bindPos: {x: 0, y: 0, z: 0}
+--- !u!1 &8445359137569073576
+GameObject:
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  serializedVersion: 6
+  m_Component:
+  - component: {fileID: 7812312644182504010}
+  - component: {fileID: 3753794381227371803}
+  - component: {fileID: 6304016053549215156}
+  m_Layer: 5
+  m_Name: Text
+  m_TagString: Untagged
+  m_Icon: {fileID: 0}
+  m_NavMeshLayer: 0
+  m_StaticEditorFlags: 0
+  m_IsActive: 1
+--- !u!224 &7812312644182504010
+RectTransform:
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  m_GameObject: {fileID: 8445359137569073576}
+  m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
+  m_LocalPosition: {x: 0, y: 0, z: 0}
+  m_LocalScale: {x: 1, y: 1, z: 1}
+  m_ConstrainProportionsScale: 0
+  m_Children: []
+  m_Father: {fileID: 6175645393292098230}
+  m_RootOrder: 0
+  m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
+  m_AnchorMin: {x: 0.5, y: 0.5}
+  m_AnchorMax: {x: 0.5, y: 0.5}
+  m_AnchoredPosition: {x: 0, y: 16.1}
+  m_SizeDelta: {x: 30, y: 30}
+  m_Pivot: {x: 0.5, y: 0.5}
+--- !u!222 &3753794381227371803
+CanvasRenderer:
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  m_GameObject: {fileID: 8445359137569073576}
+  m_CullTransparentMesh: 1
+--- !u!114 &6304016053549215156
+MonoBehaviour:
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  m_GameObject: {fileID: 8445359137569073576}
+  m_Enabled: 1
+  m_EditorHideFlags: 0
+  m_Script: {fileID: 11500000, guid: 5f7201a12d95ffc409449d95f23cf332, type: 3}
+  m_Name: 
+  m_EditorClassIdentifier: 
+  m_Material: {fileID: 0}
+  m_Color: {r: 0.9921569, g: 0.60784316, b: 0.16078432, a: 1}
+  m_RaycastTarget: 0
+  m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
+  m_Maskable: 1
+  m_OnCullStateChanged:
+    m_PersistentCalls:
+      m_Calls: []
+  m_FontData:
+    m_Font: {fileID: 12800000, guid: 85c13d115126ca04ca985ec0156f4c61, type: 3}
+    m_FontSize: 14
+    m_FontStyle: 0
+    m_BestFit: 0
+    m_MinSize: 10
+    m_MaxSize: 40
+    m_Alignment: 4
+    m_AlignByGeometry: 0
+    m_RichText: 1
+    m_HorizontalOverflow: 0
+    m_VerticalOverflow: 0
+    m_LineSpacing: 1
+  m_Text: 1
+--- !u!1 &9101192297239480734
+GameObject:
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  serializedVersion: 6
+  m_Component:
+  - component: {fileID: 1122381128211880134}
+  - component: {fileID: 1154744844346504758}
+  - component: {fileID: 5297971309655142600}
+  - component: {fileID: 3874103577596549413}
+  m_Layer: 5
+  m_Name: Button
+  m_TagString: Untagged
+  m_Icon: {fileID: 0}
+  m_NavMeshLayer: 0
+  m_StaticEditorFlags: 0
+  m_IsActive: 1
+--- !u!224 &1122381128211880134
+RectTransform:
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  m_GameObject: {fileID: 9101192297239480734}
+  m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
+  m_LocalPosition: {x: 0, y: 0, z: 0}
+  m_LocalScale: {x: 1, y: 1, z: 1}
+  m_ConstrainProportionsScale: 0
+  m_Children: []
+  m_Father: {fileID: 6175645393292098230}
+  m_RootOrder: 1
+  m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
+  m_AnchorMin: {x: 0, y: 0}
+  m_AnchorMax: {x: 1, y: 1}
+  m_AnchoredPosition: {x: 0, y: 0}
+  m_SizeDelta: {x: 0, y: 0}
+  m_Pivot: {x: 0.5, y: 0.5}
+--- !u!222 &1154744844346504758
+CanvasRenderer:
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  m_GameObject: {fileID: 9101192297239480734}
+  m_CullTransparentMesh: 1
+--- !u!114 &5297971309655142600
+MonoBehaviour:
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  m_GameObject: {fileID: 9101192297239480734}
+  m_Enabled: 1
+  m_EditorHideFlags: 0
+  m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3}
+  m_Name: 
+  m_EditorClassIdentifier: 
+  m_Material: {fileID: 0}
+  m_Color: {r: 0, g: 0, b: 0, a: 0.003921569}
+  m_RaycastTarget: 1
+  m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
+  m_Maskable: 1
+  m_OnCullStateChanged:
+    m_PersistentCalls:
+      m_Calls: []
+  m_Sprite: {fileID: 10905, guid: 0000000000000000f000000000000000, type: 0}
+  m_Type: 1
+  m_PreserveAspect: 0
+  m_FillCenter: 1
+  m_FillMethod: 4
+  m_FillAmount: 1
+  m_FillClockwise: 1
+  m_FillOrigin: 0
+  m_UseSpriteMesh: 0
+  m_PixelsPerUnitMultiplier: 1
+--- !u!114 &3874103577596549413
+MonoBehaviour:
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  m_GameObject: {fileID: 9101192297239480734}
+  m_Enabled: 1
+  m_EditorHideFlags: 0
+  m_Script: {fileID: 11500000, guid: 4e29b1a8efbd4b44bb3f3716e73f07ff, type: 3}
+  m_Name: 
+  m_EditorClassIdentifier: 
+  m_Navigation:
+    m_Mode: 3
+    m_WrapAround: 0
+    m_SelectOnUp: {fileID: 0}
+    m_SelectOnDown: {fileID: 0}
+    m_SelectOnLeft: {fileID: 0}
+    m_SelectOnRight: {fileID: 0}
+  m_Transition: 1
+  m_Colors:
+    m_NormalColor: {r: 1, g: 1, b: 1, a: 1}
+    m_HighlightedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1}
+    m_PressedColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 1}
+    m_SelectedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1}
+    m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608}
+    m_ColorMultiplier: 1
+    m_FadeDuration: 0.1
+  m_SpriteState:
+    m_HighlightedSprite: {fileID: 0}
+    m_PressedSprite: {fileID: 0}
+    m_SelectedSprite: {fileID: 0}
+    m_DisabledSprite: {fileID: 0}
+  m_AnimationTriggers:
+    m_NormalTrigger: Normal
+    m_HighlightedTrigger: Highlighted
+    m_PressedTrigger: Pressed
+    m_SelectedTrigger: Selected
+    m_DisabledTrigger: Disabled
+  m_Interactable: 1
+  m_TargetGraphic: {fileID: 5297971309655142600}
+  m_OnClick:
+    m_PersistentCalls:
+      m_Calls: []

+ 83 - 1
Assets/Prefabs/UI/To.prefab

@@ -1,5 +1,85 @@
 %YAML 1.1
 %TAG !u! tag:unity3d.com,2011:
+--- !u!1 &4047594202152504446
+GameObject:
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  serializedVersion: 6
+  m_Component:
+  - component: {fileID: 496006772353453775}
+  - component: {fileID: 8617432931020959719}
+  - component: {fileID: 7955649616833722520}
+  m_Layer: 5
+  m_Name: Text
+  m_TagString: Untagged
+  m_Icon: {fileID: 0}
+  m_NavMeshLayer: 0
+  m_StaticEditorFlags: 0
+  m_IsActive: 1
+--- !u!224 &496006772353453775
+RectTransform:
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  m_GameObject: {fileID: 4047594202152504446}
+  m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
+  m_LocalPosition: {x: 0, y: 0, z: 0}
+  m_LocalScale: {x: 1, y: 1, z: 1}
+  m_ConstrainProportionsScale: 0
+  m_Children: []
+  m_Father: {fileID: 7373640821659385369}
+  m_RootOrder: 0
+  m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
+  m_AnchorMin: {x: 0.5, y: 0.5}
+  m_AnchorMax: {x: 0.5, y: 0.5}
+  m_AnchoredPosition: {x: 0, y: 15}
+  m_SizeDelta: {x: 30, y: 30}
+  m_Pivot: {x: 0.5, y: 0.5}
+--- !u!222 &8617432931020959719
+CanvasRenderer:
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  m_GameObject: {fileID: 4047594202152504446}
+  m_CullTransparentMesh: 1
+--- !u!114 &7955649616833722520
+MonoBehaviour:
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  m_GameObject: {fileID: 4047594202152504446}
+  m_Enabled: 1
+  m_EditorHideFlags: 0
+  m_Script: {fileID: 11500000, guid: 5f7201a12d95ffc409449d95f23cf332, type: 3}
+  m_Name: 
+  m_EditorClassIdentifier: 
+  m_Material: {fileID: 0}
+  m_Color: {r: 1, g: 0.15686275, b: 0.8078432, a: 1}
+  m_RaycastTarget: 0
+  m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
+  m_Maskable: 1
+  m_OnCullStateChanged:
+    m_PersistentCalls:
+      m_Calls: []
+  m_FontData:
+    m_Font: {fileID: 12800000, guid: 85c13d115126ca04ca985ec0156f4c61, type: 3}
+    m_FontSize: 14
+    m_FontStyle: 0
+    m_BestFit: 0
+    m_MinSize: 10
+    m_MaxSize: 40
+    m_Alignment: 4
+    m_AlignByGeometry: 0
+    m_RichText: 1
+    m_HorizontalOverflow: 0
+    m_VerticalOverflow: 0
+    m_LineSpacing: 1
+  m_Text: 1
 --- !u!1 &6388259274068347658
 GameObject:
   m_ObjectHideFlags: 0
@@ -30,7 +110,8 @@ RectTransform:
   m_LocalPosition: {x: 0, y: 0, z: 0}
   m_LocalScale: {x: 1, y: 1, z: 1}
   m_ConstrainProportionsScale: 0
-  m_Children: []
+  m_Children:
+  - {fileID: 496006772353453775}
   m_Father: {fileID: 0}
   m_RootOrder: 0
   m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
@@ -90,3 +171,4 @@ MonoBehaviour:
   m_Name: 
   m_EditorClassIdentifier: 
   bindObj: {fileID: 0}
+  bindPos: {x: 0, y: 0, z: 0}

File diff suppressed because it is too large
+ 98 - 1
Assets/Scene 1.unity


+ 36 - 2
Assets/Scripts/UI/UIView/RKZY/RKZYLayer.cs

@@ -292,13 +292,28 @@ 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));
-                    linePath.SetColor(Color.red, Color.red);
+                    linePath.SetColor(Color.Lerp(Color.yellow, Color.red, j * clolorLerpUnit), Color.Lerp(Color.yellow, Color.red, (j + 1) * clolorLerpUnit));
+                    //linePath.SetColor(Color.red, Color.red);
                     if (j == 0)
                     {
                         RectTransform startSign = Instantiate(startPos);
                         startSign.SetParent(pathSign);
                         startSign.transform.localScale = Vector3.one;
+                        startSign.GetComponent<PathSign>().SetIndex(beforeLinePaths.Count);
+                        int temp = beforeLinePaths.Count;
+                        startSign.GetComponentInChildren<Button>().onClick.AddListener(() =>
+                        {
+                            for (int i = 0; i < linePaths.Count; i++)
+                            {
+                                linePaths[i].gameObject.SetActive(false);
+                            }
+                            beforeLinePaths[temp].gameObject.SetActive(true);
+                            for (int k = 0; k < movePlans.Count; k++) {
+                                if (movePlans[k].bindLinePath == beforeLinePaths[temp]) {
+                                    CheckCalcUsable(movePlans[k]);
+                                }
+                            }
+                        });
                         startSign.GetComponent<PathSign>().bindObj = linePath.gameObject;
                         startSign.GetComponent<PathSign>().bindPos = worldPos;
                     }
@@ -307,6 +322,7 @@ public class RKZYLayer : YZTRootLayer
                         RectTransform endSign = Instantiate(endPos);
                         endSign.SetParent(pathSign);
                         endSign.transform.localScale = Vector3.one;
+                        endSign.GetComponent<PathSign>().SetIndex(beforeLinePaths.Count);
                         endSign.GetComponent<PathSign>().bindObj = linePath.gameObject;
                         endSign.GetComponent<PathSign>().bindPos = worldPos1;
                     }
@@ -364,6 +380,23 @@ public class RKZYLayer : YZTRootLayer
                         RectTransform startSign = Instantiate(startPos);
                         startSign.SetParent(pathSign);
                         startSign.transform.localScale = Vector3.one;
+                        startSign.GetComponent<PathSign>().SetIndex(afterLinePaths.Count);
+                        int temp = afterLinePaths.Count;
+                        startSign.GetComponentInChildren<Button>().onClick.AddListener(() =>
+                        {
+                            for (int i = 0; i < linePaths.Count; i++)
+                            {
+                                linePaths[i].gameObject.SetActive(false);
+                            }
+                            afterLinePaths[temp].gameObject.SetActive(true);
+                            for (int k = 0; k < movePlans.Count; k++)
+                            {
+                                if (movePlans[k].bindLinePath == afterLinePaths[temp])
+                                {
+                                    CheckCalcUsable(movePlans[k]);
+                                }
+                            }
+                        });
                         startSign.GetComponent<PathSign>().bindObj = linePath.gameObject;
                         startSign.GetComponent<PathSign>().bindPos = worldPos;
                     }
@@ -372,6 +405,7 @@ public class RKZYLayer : YZTRootLayer
                         RectTransform endSign = Instantiate(endPos);
                         endSign.SetParent(pathSign);
                         endSign.transform.localScale = Vector3.one;
+                        endSign.GetComponent<PathSign>().SetIndex(afterLinePaths.Count);
                         endSign.GetComponent<PathSign>().bindObj = linePath.gameObject;
                         endSign.GetComponent<PathSign>().bindPos = worldPos1;
                     }

Some files were not shown because too many files changed in this diff