lzx před 1 dnem
rodič
revize
212334d657

+ 30 - 0
Assets/Scripts/GameLogic/Player/AccountFileInfo.cs

@@ -110,6 +110,36 @@ public class AccountFileInfo : Singleton<AccountFileInfo>
         /// 
         /// </summary>
         public List<EventList> eventList = new List<EventList>();
+        
+        public List<SentimentData> SentimentDatas = new List<SentimentData>();
+    }
+    
+    /// <summary>
+    /// 心境数据
+    /// </summary>
+    [System.Serializable]
+    public class SentimentData
+    {
+        public int id;
+        
+        //主属性
+        public SentimentProperty mainSentiment;
+        
+        public List<SentimentProperty> sentimentProperties = new List<SentimentProperty>();
+        
+       
+    }
+    
+    /// <summary>
+    /// 心境属性
+    /// </summary>
+    public class SentimentProperty
+    {
+        // 属性类别
+        public int groupId;
+        // 词条档位
+        public int level = 1;
+  
     }
 
 

+ 28 - 1
Assets/Scripts/GameLogic/Player/PlayerManager.cs

@@ -55,6 +55,33 @@ public class PlayerManager : Singleton<PlayerManager>
         RandownDaoYou(gameConstantConfig.Daoyoushowuptime + 1000);
     }
 
+    //添加心境
+    public void AddSentimentData(int id)
+    {
+        AccountFileInfo.SentimentData sentimentData = AccountFileInfo.Instance.playerData.SentimentDatas.FirstOrDefault(sd => sd.id == id);
+        if (sentimentData != null)
+        {
+            LogTool.Error("已经用心境 id:" + id);
+            return;
+        }
+
+        SentimentConfig sentimentConfig = ConfigComponent.Instance.Get<SentimentConfig>(id);
+
+        sentimentData = new AccountFileInfo.SentimentData();
+        sentimentData.id = id;
+        sentimentData.mainSentiment = new AccountFileInfo.SentimentProperty();
+        sentimentData.mainSentiment.groupId = sentimentConfig.mainSentimentEffect;
+        foreach (var i in sentimentConfig.sentimentEffect)
+        {
+            AccountFileInfo.SentimentProperty sentimentProperty = new AccountFileInfo.SentimentProperty();
+            sentimentProperty.groupId = i;
+            sentimentData.sentimentProperties.Add(sentimentProperty);
+        }
+
+        AccountFileInfo.Instance.playerData.SentimentDatas.Add(sentimentData);
+        AccountFileInfo.Instance.SavePlayerData();
+    }
+
     public void RandownDaoYou(int m)
     {
         _timerEntity?.Dispose();
@@ -119,7 +146,7 @@ public class PlayerManager : Singleton<PlayerManager>
                 levelBl = daoyouguajiResourcLevel.para2;
                 bl = (int)(guajibuff.GivingRate * levelBl * daoyouLevelupConfig.guajiGrowup * 0.01f * 0.01f);
                 return bl;
-    
+
                 break;
             case 2:
                 levelBl = daoyouguajiResourcLevel.para2;

+ 5 - 2
Assets/Scripts/GameUI/GameApplction.cs

@@ -125,6 +125,8 @@ public class GameApplction : IGameStart
         //     skillInfo.index = -1;
         //     PlayerManager.Instance.GongFaControl.AddSkillInfo(skillInfo);
         // }
+
+        PlayerManager.Instance.AddSentimentData(1);
         foreach (var playerDataAllSkillData in AccountFileInfo.Instance.playerData.AllSkillDatas)
         {
             SkillInfo skillInfo = new SkillInfo(playerDataAllSkillData);
@@ -161,13 +163,14 @@ public class GameApplction : IGameStart
         CombatDrive.Instance.AddCombatController(new CombatController());
         gameStartUIPanel.ShowMassge("loadCombat");
         gameStartUIPanel.SetSlider(0.95f);
-        var eventList = EventSystemManager.Instance.AddEvent(10018);
-      
+        var eventList = EventSystemManager.Instance.AddEvent(10001);
+
         if (eventList != null)
         {
             AccountFileInfo.Instance.playerData.eventList.Add(eventList);
             AccountFileInfo.Instance.SavePlayerData();
         }
+
         EventSystemManager.Instance.UpdateZuizhongEventData();
         await CombatDrive.Instance.StartCombat(startCombatInfo);
         PlayerManager.Instance.GongFaControl.SaveUseSkill();

+ 38 - 17
Assets/Scripts/GameUI/UI/SentimentPanel/SentimentWidget.cs

@@ -1,24 +1,45 @@
+using System.Linq;
+using Core.Language;
+using Excel2Json;
+using Fort23.UTool;
+
 namespace Fort23.Mono
 {
-	[UIBinding(prefab = "SentimentWidget"  )]
-	public partial class SentimentWidget : UIComponent
-	{
-		private void Init()
-		{
+    [UIBinding(prefab = "SentimentWidget")]
+    public partial class SentimentWidget : ItemWidgetBasic
+    {
+        public AccountFileInfo.SentimentData sentimentData;
 
-		}
-		public override void AddEvent()
-		{
+        private void Init()
+        {
+        }
 
-		}
-		public override void DelEvent()
-		{
+        public override void AddEvent()
+        {
+        }
 
-		}
-		public override void AddButtonEvent()
-		{
+        public override void DelEvent()
+        {
+        }
 
-		}
+        public override void AddButtonEvent()
+        {
+            base.AddButtonEvent();
+        }
 
-	}
-}
+        public void CustomInit(int id)
+        {
+            sentimentData = AccountFileInfo.Instance.playerData.SentimentDatas.FirstOrDefault(sd => sd.id == id);
+            SentimentConfig sentimentConfig = ConfigComponent.Instance.Get<SentimentConfig>(id);
+            Text_Name.text = LanguageManager.Instance.Text(sentimentConfig.name);
+            if (sentimentData == null)
+            {
+                transform.Gray();
+            }
+            else
+            {
+                transform.RecoverColor();
+            }
+        }
+    }
+}

+ 29 - 0
Assets/Scripts/GameUI/UI/SentimentPanel/SentimentWidgetData.cs

@@ -0,0 +1,29 @@
+using Fort23.Core;
+using Fort23.UTool;
+using UnityEngine.UI;
+using UnityEngine;
+using System.Collections.Generic;
+namespace Fort23.Mono
+{
+	public partial class SentimentWidget 
+	{
+	  #region 自定义数据 
+	  private Text _Text_Name;
+	  public Text Text_Name
+	   {
+	   get{
+	      if (_Text_Name == null)
+	       {
+	         _Text_Name  = GetUIUnit<Text>("Text_Name"); 
+	       }
+	      return _Text_Name;
+	     }
+	   }
+	  #endregion 自定义数据结束 
+	 public override async CTask SetUIGameObject(GameObject gObjectPoolInterface)
+	{
+	 await base.SetUIGameObject(gObjectPoolInterface);
+	 Init();
+	}
+	}
+}

+ 11 - 0
Assets/Scripts/GameUI/UI/SentimentPanel/SentimentWidgetData.cs.meta

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

Rozdílová data souboru nebyla zobrazena, protože soubor je příliš velký
+ 0 - 0
Assets/StreamingAssets/assetConfig.txt


binární
Excel2Json/Excel/Sentiment.xlsx


Některé soubory nejsou zobrazeny, neboť je v těchto rozdílových datech změněno mnoho souborů