ZXW 1 рік тому
батько
коміт
7feb9393e9

Різницю між файлами не показано, бо вона завелика
+ 728 - 127
Assets/GameResources/Font/nserif/nserif.asset


+ 0 - 0
Assets/Resources/Config/Framework/Course.txt


+ 7 - 0
Assets/Resources/Config/Framework/Course.txt.meta

@@ -0,0 +1,7 @@
+fileFormatVersion: 2
+guid: 4f3ed800d3d9ab94db8e8fc7fec3bbea
+TextScriptImporter:
+  externalObjects: {}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

Різницю між файлами не показано, бо вона завелика
+ 125 - 1447
Assets/Resources/UI/From/TypeOfCourseView.prefab


+ 0 - 0
Assets/Resources/UI/From/HarvestingProcessView.prefab.meta → Assets/Resources/UI/From/TypeOfCourseView.prefab.meta


+ 1 - 1
Assets/Scripts/Framework/MVC/View/ViewManager_partial.cs

@@ -11,7 +11,7 @@ namespace WS
 
         private void StartType()
         {
-            DicTypeToName.Add(typeof(HarvestingProcessView), "HarvestingProcessView");
+            DicTypeToName.Add(typeof(TypeOfCourseView), "TypeOfCourseView");
             DicTypeToName.Add(typeof(MainMenuView), "MainMenuView");
             DicTypeToName.Add(typeof(MainView), "MainView");
             DicTypeToName.Add(typeof(PointView), "PointView");

+ 4 - 4
Assets/Scripts/Project/ProjectInit.cs

@@ -12,12 +12,12 @@ public class ProjectInit : Init
         Game.Scene.AddComponent<HighlightComponent>();
         Game.Scene.AddComponent<SceneDataSaveComponent>();
         Game.Scene.AddComponent<InputManager>();
-        MainMenuController controller = FacadeComponent.Instance.CreateController<MainMenuController>();
-        controller.OpenView();
+        //MainMenuController controller = FacadeComponent.Instance.CreateController<MainMenuController>();
+        //controller.OpenView();
 
 
-        //SearchTypeEntryController controller2 = FacadeComponent.Instance.CreateController<SearchTypeEntryController>();
-        //controller2.OpenView();
+        TypeOfCourseController controller2 = FacadeComponent.Instance.CreateController<TypeOfCourseController>();
+        controller2.OpenView();
 
 
 

+ 120 - 0
Assets/Scripts/Project/Tools/ToggleHelp.cs

@@ -0,0 +1,120 @@
+using System;
+using System.Collections.Generic;
+using UnityEngine;
+using UnityEngine.UI;
+
+public class ToggleHelp : MonoBehaviour
+{
+
+    #region tog
+    public class TogItem
+    {
+        public GameObject on;
+        public GameObject off;
+        public Button btn;
+        public int idx;
+    }
+
+    public Action<int> funCallBack;
+    public int curChooseIdx;
+    public List<TogItem> listTogItem;
+
+
+    public Func<bool> funCantClick;
+
+    public Transform togTransform;
+    #endregion
+
+
+
+
+    #region tog
+
+    public void TogCreateBindEvent(Action<int, GameObject, GameObject> CreateFun, Action<int> fun, int count)
+    {
+        togTransform = GetComponent<Transform>();
+        var self = this;
+        var togTmp = self.togTransform.Find($"togTmp").transform;
+        togTmp.gameObject.SetActive(false);
+        for (int i = 0; i < count; i++)
+        {
+            TogItem tmp = new TogItem();
+            var tog = GameObject.Instantiate(togTmp, self.togTransform);
+            tog.gameObject.SetActive(true);
+            tmp.btn = tog.Find($"btn").GetComponent<Button>();
+            tmp.on = tog.Find($"on").gameObject;
+            tmp.off = tog.Find($"off").gameObject;
+            tmp.idx = i;
+            CreateFun?.Invoke(i, tmp.on, tmp.off);
+            tmp.btn.onClick.RemoveAllListeners();
+            tmp.btn.onClick.AddListener(() => { TogOnClick(tmp.idx); });
+
+            self.listTogItem.Add(tmp);
+        }
+
+        self.funCallBack = fun;
+    }
+    public void TogSetActive(bool isShow)
+    {
+        var self = this;
+        self.togTransform.gameObject.SetActive(isShow);
+    }
+
+    public void TogOnClick(int idx)
+    {
+        var self = this;
+        if (self.funCantClick != null && self.funCantClick.Invoke()) return;
+        if (self.curChooseIdx != idx)
+        {
+            self.curChooseIdx = idx;
+
+            TogUpdateChooseUI(idx);
+            self.funCallBack?.Invoke(idx);
+
+        }
+
+    }
+    public void TogSetCantClickFun(Func<bool> funCantClick)
+    {
+        var self = this;
+        self.funCantClick = funCantClick;
+    }
+    //如果 全部 重置为都不选中 idx 传入 -1
+    public void TogInitUI(int idx = 0)
+    {
+        var self = this;
+        self.funCantClick = null;
+
+        self.curChooseIdx = idx;
+        TogUpdateChooseUI(idx);
+
+
+
+
+    }
+
+    public int TogGetCurChooseIdx()
+    {
+        var self = this;
+        return self.curChooseIdx;
+    }
+    // 
+    public void TogUpdateChooseUI(int idx)
+    {
+        var self = this;
+        for (int i = 0; i < self.listTogItem.Count; i++)
+        {
+
+            self.listTogItem[i].on.SetActive(i == idx);
+            self.listTogItem[i].off.SetActive(i != idx);
+
+        }
+
+
+
+
+    }
+    #endregion
+
+
+}

+ 11 - 0
Assets/Scripts/Project/Tools/ToggleHelp.cs.meta

@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: c7cd94728fe5cb249a60d6f30a1dbfdc
+MonoImporter:
+  externalObjects: {}
+  serializedVersion: 2
+  defaultReferences: []
+  executionOrder: 0
+  icon: {instanceID: 0}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 31 - 2
Assets/Scripts/Project/View/SearchTypeEntry.cs

@@ -1,8 +1,11 @@
 using NPOI.SS.Formula.Functions;
 using ScrollViewUI;
+using System;
 using System.Collections.Generic;
 using System.Linq;
 using TMPro;
+using Unity.VisualScripting;
+using Unity.VisualScripting.ReorderableList.Internal;
 using UnityEngine;
 using UnityEngine.UI;
 using WS;
@@ -17,11 +20,11 @@ public class SearchTypeEntryController : Controller<SearchTypeEntryView, SearchT
     {
         base.Dispose();
     }
-    public void ShowUI(string type)
+    public void ShowUI(CoursType type)
     {
         this._View.txtTitle.text = type.ToString();
 
-        
+
         this._View.txtTitlePin.text = type.ToString();
 
     }
@@ -275,6 +278,19 @@ public class SearchTypeEntryController : Controller<SearchTypeEntryView, SearchT
 
 
     }
+
+
+
+
+
+
+
+
+
+
+
+
+
 }
 
 public class SearchTypeEntryModel : Model
@@ -334,6 +350,7 @@ public class SearchTypeEntryView : View
     public CurClickGO curClickGO = new CurClickGO();
 
 
+ 
 
 
     public override void LoadInit()
@@ -378,4 +395,16 @@ public class SearchTypeEntryView : View
 
 
     }
+
+
+
+
+
+
+
+
+
+
+
+
 }

+ 48 - 10
Assets/Scripts/Project/View/HarvestingProcess.cs → Assets/Scripts/Project/View/TypeOfCourse.cs

@@ -1,14 +1,13 @@
-using System.Collections;
-using System.Collections.Generic;
 using TMPro;
 using UnityEngine;
 using UnityEngine.UI;
 using WS;
+using static TypeOfCourseModel;
 
 
 
 
-public class HarvestingProcessController : Controller<HarvestingProcessView, HarvestingProcessModel>
+public class TypeOfCourseController : Controller<TypeOfCourseView, TypeOfCourseModel>
 {
     public override void Dispose()
     {
@@ -22,32 +21,70 @@ public class HarvestingProcessController : Controller<HarvestingProcessView, Har
         {
             Debug.Log("返回主页面");
 
-            FacadeComponent.Instance.CreateController<HarvestingProcessController>().OpenView();
+            FacadeComponent.Instance.CreateController<TypeOfCourseController>().OpenView();
 
             FacadeComponent.Instance.CloseView(this._View, null);
         });
 
 
 
+        //生成事件
+        this._View.toggleHelp.TogCreateBindEvent((idx, on, off) =>
+        {
+            on.transform.Find("txt").GetComponent<Text>().text = ((HarProcessType)idx).ToString();
+            off.transform.Find("txt").GetComponent<Text>().text = ((HarProcessType)idx).ToString();
 
+        }, (idx) =>
+        {
+            switch (((HarProcessType)idx))
+            {
+                case HarProcessType.基础信息:
 
 
-    }
+                    break;
+                case HarProcessType.产地与生境:
 
 
+                    break;
+                case HarProcessType.采集方法:
+
+
+                    break;
+                case HarProcessType.加工方法:
+
+
+                    break;
+                case HarProcessType.Count:
+                    break;
+                default:
+                    break;
+            }
+
 
-    private void UpdateTog()
-    {
 
 
+        }, (int)HarProcessType.Count);
+
 
     }
 
 
+
+
+
 }
 
-public class HarvestingProcessModel : Model
+public class TypeOfCourseModel : Model
 {
+    public enum HarProcessType
+    {
+        基础信息,
+        产地与生境,
+        采集方法,
+        加工方法,
+        Count,
+    }
+
     public override void InitProperty()
     {
 
@@ -56,7 +93,7 @@ public class HarvestingProcessModel : Model
     }
 }
 
-public class HarvestingProcessView : View
+public class TypeOfCourseView : View
 {
     public TMPro.TMP_InputField ifMedcineSeach;
     public ScrollRect svSeach;
@@ -67,6 +104,7 @@ public class HarvestingProcessView : View
     public Button btnEnterClass;
     public Button btnBack;
 
+    public ToggleHelp toggleHelp;
 
     public override void LoadInit()
     {
@@ -81,7 +119,7 @@ public class HarvestingProcessView : View
         txtTitle = rc.GetComponent<TextMeshProUGUI>("txtTitle");
         btnEnterClass = rc.GetComponent<Button>("btnEnterClass");
         btnBack = rc.GetComponent<Button>("btnBack");
-
+        toggleHelp = rc.GetComponent<ToggleHelp>("cttTog");
 
     }
 }

+ 0 - 0
Assets/Scripts/Project/View/HarvestingProcess.cs.meta → Assets/Scripts/Project/View/TypeOfCourse.cs.meta


+ 1 - 1
Assets/StreamingAssets/build_info

@@ -1 +1 @@
-Build from HHH at 2024/1/24 18:00:48
+Build from HHH at 2024/1/25 10:38:08

Деякі файли не було показано, через те що забагато файлів було змінено