From 448feacbaaad6fed8cac0f16f72d24a241ba0b51 Mon Sep 17 00:00:00 2001
From: lwb <q3213421wrwqr>
Date: 星期三, 13 一月 2021 19:08:06 +0800
Subject: [PATCH] 9527 InjectFix

---
 Assets/Editor/ScriptEditor/NewBieGuideEditorWindow.cs |  104 +++++++++++++++++++++++++++++-----------------------
 1 files changed, 58 insertions(+), 46 deletions(-)

diff --git a/Assets/Editor/ScriptEditor/NewBieGuideEditorWindow.cs b/Assets/Editor/ScriptEditor/NewBieGuideEditorWindow.cs
index c7d1308..64a4ae5 100644
--- a/Assets/Editor/ScriptEditor/NewBieGuideEditorWindow.cs
+++ b/Assets/Editor/ScriptEditor/NewBieGuideEditorWindow.cs
@@ -1,14 +1,14 @@
-锘縰sing System.Collections;
-using System.Collections.Generic;
-using UnityEngine;
-using UnityEditor;
-using Snxxz.UI;
-using UnityEngine.UI;
-using TableConfig;
-
+锘縰sing System.Collections;
+using System.Collections.Generic;
+using UnityEngine;
+using UnityEditor;
+using Snxxz.UI;
+using UnityEngine.UI;
+
+
 public class NewBieGuideEditorWindow : EditorWindow
-{
-    [MenuItem("绋嬪簭/鏂版墜璋冭瘯鍣�")]
+{
+    [MenuItem("绋嬪簭/鏂版墜璋冭瘯鍣�")]
     public static void Create()
     {
         var window = GetWindow(typeof(NewBieGuideEditorWindow), false, "鏂版墜璋冭瘯鍣�") as NewBieGuideEditorWindow;
@@ -157,8 +157,8 @@
         }
 
         EditorGUILayout.EndVertical();
-    }
-
+    }
+
     private void ImportNewBieConfig()
     {
         var fileName = StringUtility.Contact("NewBieGuideStep_", stepId, ".asset");
@@ -181,7 +181,7 @@
                     uiroot = GameObject.FindObjectOfType<UIRoot>();
                     if (uiroot == null)
                     {
-                        var rootPrefab = Resources.Load<GameObject>("UI/Prefabs/UIRoot");
+                        var rootPrefab = BuiltInLoader.LoadPrefab("UIRoot");
                         var root = GameObject.Instantiate(rootPrefab, Vector3.zero, Quaternion.identity);
                         root.name = "UIRoot";
                         uiroot = root.GetComponent<UIRoot>();
@@ -270,8 +270,8 @@
         }
 
         Repaint();
-    }
-
+    }
+
     private void ExportNewBieConfig()
     {
         var fileName = StringUtility.Contact("NewBieGuideStep_", stepId, ".asset");
@@ -308,8 +308,8 @@
         AssetDatabase.Refresh();
         EditorUtility.SetDirty(so);
         AssetDatabase.SaveAssets();
-    }
-
+    }
+
     private void ImportRecommondConfig()
     {
         var fileName = StringUtility.Contact("FunctionalGuideStep_", stepId, ".asset");
@@ -332,7 +332,7 @@
                     uiroot = GameObject.FindObjectOfType<UIRoot>();
                     if (uiroot == null)
                     {
-                        var rootPrefab = Resources.Load<GameObject>("UI/Prefabs/UIRoot");
+                        var rootPrefab = BuiltInLoader.LoadPrefab("UIRoot");
                         var root = GameObject.Instantiate(rootPrefab, Vector3.zero, Quaternion.identity);
                         root.name = "UIRoot";
                         uiroot = root.GetComponent<UIRoot>();
@@ -363,6 +363,7 @@
             guideContent = so.tipContent;
             arrowPosition = so.arrowPosition;
             selectBox = so.selectBox;
+            effect2 = so.effect2;
             var selectBosAssetName = string.Empty;
             switch (so.selectBox)
             {
@@ -391,8 +392,8 @@
         }
 
         Repaint();
-    }
-
+    }
+
     private void ExportRecommondConfig()
     {
         var fileName = StringUtility.Contact("FunctionalGuideStep_", stepId, ".asset");
@@ -410,6 +411,7 @@
             so.tipContent = guideContent;
             so.arrowPosition = arrowPosition;
             so.selectBox = selectBox;
+            so.effect2 = effect2;
             if (m_ClickTarget != null)
             {
                 so.UIElementPath = UIUtility.GetUIElementRelativePath(uiroot, m_ClickTarget);
@@ -419,14 +421,14 @@
         AssetDatabase.Refresh();
         EditorUtility.SetDirty(so);
         AssetDatabase.SaveAssets();
-    }
-
+    }
+
     private void StartNewBieGuide()
     {
         NewBieCenter.Instance.currentGuide = guideId;
         NewBieCenter.Instance.StartNewBieGuide(guideId);
-    }
-
+    }
+
     private void StartFunctionalGuide()
     {
         FunctionalGuideCenter.Instance.StartGuide(guideId);
@@ -437,24 +439,24 @@
         var instance = UIUtility.CreateWidget("GuideUsher", "GuideUsher");
 
         return instance;
-    }
-
+    }
+
     enum GuideType
     {
         NewBie,        //鏂版墜寮曞锛屽崐寮哄埗鎬х殑銆�
         Recommend,//鍔熻兘鎬у紩瀵硷紝鎺ㄨ崘鎬х殑銆�
-    }
-
-    List<NewBieGuide> newbieGuides = null;
+    }
+
+    List<NewBieGuide> newbieGuides = null;
     List<FunctionalGuide> functionalGuides = null;
-    private Vector2 scrollPosition;
-
+    private Vector2 scrollPosition;
+
     void DrawNewbieGuides()
     {
-        if (Config.Instance.inited && newbieGuides == null)
+        if (ConfigInitiator.done && newbieGuides == null)
         {
             newbieGuides = new List<NewBieGuide>();
-            var guides = Config.Instance.GetAllValues<GuideConfig>();
+            var guides = GuideConfig.GetValues();
             foreach (var config in guides)
             {
                 if (config.Type == 1)
@@ -503,14 +505,14 @@
             GUILayout.EndScrollView();
         }
 
-    }
-
+    }
+
     void DrawFunctionalGuides()
     {
-        if (Config.Instance.inited && functionalGuides == null)
+        if (ConfigInitiator.done && functionalGuides == null)
         {
             functionalGuides = new List<FunctionalGuide>();
-            var guides = Config.Instance.GetAllValues<GuideConfig>();
+            var guides = GuideConfig.GetValues();
             foreach (var config in guides)
             {
                 if (config.Type == 2)
@@ -546,6 +548,11 @@
                     guide.Finish();
                 }
 
+                if (GUILayout.Button("閲嶇疆"))
+                {
+                    guide.Reset();
+                }
+
                 EditorGUILayout.Space();
                 EditorGUILayout.EndHorizontal();
             }
@@ -554,8 +561,8 @@
         }
 
 
-    }
-
+    }
+
     public class NewBieGuide
     {
         public int guideId;
@@ -580,8 +587,8 @@
         {
             NewBieCenter.Instance.ResetGuide(guideId);
         }
-    }
-
+    }
+
     public class FunctionalGuide
     {
         public int guideId;
@@ -602,8 +609,13 @@
             FunctionalGuideCenter.Instance.RemoveGuide(guideId);
         }
 
-    }
-
-
-
-}
+        public void Reset()
+        {
+            NewBieCenter.Instance.ResetGuide(guideId);
+        }
+
+    }
+
+
+
+}

--
Gitblit v1.8.0