浏览代码

Timeline颜色对应怪物组颜色

wgl 7 月之前
父节点
当前提交
d932c4ef00

+ 1 - 1
ActionTowerDefense/Assets/GameLevelEditor/GAAWCITY/TimelineUI/Prefabs/Components/SwimlaneItemLabel.prefab

@@ -191,7 +191,7 @@ MonoBehaviour:
   m_FontData:
     m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0}
     m_FontSize: 26
-    m_FontStyle: 0
+    m_FontStyle: 1
     m_BestFit: 0
     m_MinSize: 10
     m_MaxSize: 51

+ 2 - 3
ActionTowerDefense/Assets/GameLevelEditor/GAAWCITY/TimelineUI/Scripts/ButtonTest.cs

@@ -22,10 +22,9 @@ public class ButtonTest : MonoBehaviour
     [SerializeField] Transform swimLaneContainer;
 
 
-    public void AddSwimLane(string text)
+    public void AddSwimLane(string text, Color color)
     {
-        timelineController.AddNewSwimlane(text);
-
+        timelineController.AddNewSwimlane(text,color);
     }
 
     public void AddEventToTimeline(int value)

+ 4 - 5
ActionTowerDefense/Assets/GameLevelEditor/GAAWCITY/TimelineUI/Scripts/TimelineController.cs

@@ -27,9 +27,8 @@ namespace TimelineViewer
         [SerializeField] string timelineHeaderText;
         [SerializeField] Color timelineHeaderColor;
 
-        [Header("Dates & Times")]
-        [SerializeField] UnityDateTime startTime;
-        [SerializeField] UnityDateTime endTime;
+        [HideInInspector][SerializeField] UnityDateTime startTime;
+        [HideInInspector][SerializeField] UnityDateTime endTime;
 
         [Header("Clock Settings")]
         [SerializeField] int increments;
@@ -92,9 +91,9 @@ namespace TimelineViewer
             
         //}
 
-        public void AddNewSwimlane(string swimlaneName)
+        public void AddNewSwimlane(string swimlaneName,Color color)
         {
-            timelineSwimlaneController.AddSwimlane(swimlaneName, swimLaneLabelContent, TimeCount, DailyIncements);
+            timelineSwimlaneController.AddSwimlane(swimlaneName,color, swimLaneLabelContent, TimeCount, DailyIncements);
         }
 
         public void AddEventToTimeline(string title, UnityDateTime eventDate, double timeToComplete)

+ 2 - 2
ActionTowerDefense/Assets/GameLevelEditor/GAAWCITY/TimelineUI/Scripts/TimelineSwimlane.cs

@@ -18,12 +18,12 @@ namespace TimelineViewer
 
         public List<GameObject> rulerSections = new List<GameObject>();
 
-        public SwimlaneItemLabel SetupSwimlane(string laneName, Transform parent, int timeCount)
+        public SwimlaneItemLabel SetupSwimlane(string laneName,Color color, Transform parent, int timeCount)
         {
             var go = Instantiate(swimLaneContentItemLabelPrefab, parent, false);
             var swimlaneLabel = go.GetComponentInChildren<Text>();
             swimlaneLabel.text = laneName;
-                        
+            swimlaneLabel.color = color;
 
             for (int i = 0; i < timeCount; i++)
             {

+ 2 - 2
ActionTowerDefense/Assets/GameLevelEditor/GAAWCITY/TimelineUI/Scripts/TimelineSwimlaneController.cs

@@ -38,14 +38,14 @@ namespace TimelineViewer
         }
 
 
-        public void AddSwimlane(string laneName, Transform parent, int timeCount, int increments)
+        public void AddSwimlane(string laneName,Color color, Transform parent, int timeCount, int increments)
         {
             dailyIncrements = increments;
 
             var swimLane = Instantiate(swimLanePrefab, transform, false);
 
             swimLaneTS = swimLane.GetComponent<TimelineSwimlane>();
-            SwimlaneItemLabel label = swimLaneTS.SetupSwimlane(laneName, parent, timeCount);
+            SwimlaneItemLabel label = swimLaneTS.SetupSwimlane(laneName,color, parent, timeCount);
             swimlanes.Add(swimlanes.Count, new SwimLaneBracket(label, swimLaneTS));
         }
 

+ 1 - 1
ActionTowerDefense/Assets/GameLevelEditor/GameMap/Sample/Scripts/Main.cs

@@ -146,7 +146,7 @@ public class Main : MonoBehaviour
 							break;
 					}
 					if (ren == null) continue;
-					buttonTest.AddSwimLane(t.name);
+					buttonTest.AddSwimLane(t.name, t.color);
 					ren.color = t.color;
 					ren.transform.localScale = new Vector3(tileSize / ren.sprite.rect.width, tileSize / ren.sprite.rect.height, 1f);
 					ren.transform.localPosition = new Vector3(x * sz + offsX, y * sz + offsY, 0f);

+ 2 - 2
ActionTowerDefense/Assets/GameLevelEditor/tiles.asset

@@ -20,7 +20,7 @@ MonoBehaviour:
     opt1: 0
     color: {r: 0.17626214, g: 1, b: 0, a: 1}
     radius: {x: 0, y: 0}
-    name: 
+    name: "\u9632\u5FA1\u5854"
   - id: 166
     sprite: {fileID: 21300000, guid: 65b0651ef19a49c4e9c6c4ff297c3d52, type: 3}
     _aid: -1
@@ -28,7 +28,7 @@ MonoBehaviour:
     opt1: 0
     color: {r: 1, g: 0, b: 0, a: 1}
     radius: {x: 0, y: 0}
-    name: 
+    name: "\u654C\u65B9\u9632\u5FA1\u5854"
   - id: 163
     sprite: {fileID: 21300000, guid: 01c1ca6a4fe22a94b91a3b2b90b5c88f, type: 3}
     _aid: -1