From 14cc691f539d15fd0fba2bc8297fb22d80d4d395 Mon Sep 17 00:00:00 2001
From: client_Hale <339726288@qq.com>
Date: 星期四, 06 十二月 2018 20:29:00 +0800
Subject: [PATCH] Merge branch 'master' of http://192.168.0.87:10010/r/snxxz_scripts

---
 System/Activity/ActivityModel.cs |   20 +++++++++++++-------
 1 files changed, 13 insertions(+), 7 deletions(-)

diff --git a/System/Activity/ActivityModel.cs b/System/Activity/ActivityModel.cs
index 457301e..7742222 100644
--- a/System/Activity/ActivityModel.cs
+++ b/System/Activity/ActivityModel.cs
@@ -146,8 +146,7 @@
             else
             {
                 ancientRandomName.Clear();
-                firstNameRandoms.Clear();
-                secondNameRandoms.Clear();
+                nameRandomIndexs.Clear();
             }
         }
 
@@ -364,8 +363,7 @@
         #endregion
 
         Dictionary<int, Dictionary<int, string>> ancientRandomName = new Dictionary<int, Dictionary<int, string>>();
-        List<int> firstNameRandoms = new List<int>();
-        List<int> secondNameRandoms = new List<int>();
+        List<int> nameRandomIndexs = new List<int>();
         public string GetAncientRobotName(int objId, int npcId)
         {
             if (ancientRandomName.ContainsKey(objId)
@@ -373,9 +371,17 @@
             {
                 return ancientRandomName[objId][npcId];
             }
-            var firstName = RandomNameConfig.GetFirstName(ref firstNameRandoms);
-            var secondName = RandomNameConfig.GetSecondName(ref secondNameRandoms);
-            var name = StringUtility.Contact(firstName, secondName);
+            var configs = Config.Instance.GetAllValues<AncientRobotNameConfig>();
+            if (nameRandomIndexs.Count == 0)
+            {
+                for (int i = 0; i < configs.Count; i++)
+                {
+                    nameRandomIndexs.Add(configs[i].id);
+                }
+            }
+            var index = UnityEngine.Random.Range(0, nameRandomIndexs.Count);
+            var name = Config.Instance.Get<AncientRobotNameConfig>(nameRandomIndexs[index]).Name;
+            nameRandomIndexs.RemoveAt(index);
             Dictionary<int, string> dict;
             if (!ancientRandomName.ContainsKey(objId))
             {

--
Gitblit v1.8.0