调整剧情的character data

This commit is contained in:
SoulliesOfficial
2025-11-12 05:20:22 -05:00
parent 92668e1b20
commit 24656aba1a
10 changed files with 21 additions and 14 deletions

View File

@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="AgentMigrationStateService">
<option name="migrationStatus" value="COMPLETED" />
</component>
</project>

View File

@@ -10,7 +10,7 @@ MonoBehaviour:
m_Enabled: 1 m_Enabled: 1
m_EditorHideFlags: 0 m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 9a4129cdd7011ca46b83d8c17d9f3623, type: 3} m_Script: {fileID: 11500000, guid: 9a4129cdd7011ca46b83d8c17d9f3623, type: 3}
m_Name: CardData_Basic_CommomHolyWater m_Name: CardData_Basic_CommonHolyWater
m_EditorClassIdentifier: Assembly-CSharp::Continentis.MainGame.Card.CardData m_EditorClassIdentifier: Assembly-CSharp::Continentis.MainGame.Card.CardData
modName: Basic modName: Basic
className: CommonHolyWater className: CommonHolyWater

View File

@@ -55,5 +55,5 @@ MonoBehaviour:
customDescriptions: [] customDescriptions: []
prefabRefs: [] prefabRefs: []
derivativeCardDataRefs: derivativeCardDataRefs:
- CardData_Basic_CommomHolyWater - CardData_Basic_CommonHolyWater
derivativeCharacterDataRefs: [] derivativeCharacterDataRefs: []

View File

@@ -139,7 +139,7 @@ namespace Continentis.MainGame
public OrderedDictionary<string, PrioritizedAction<BuffBase<T>>> onOtherBuffApplied; //Buff被添加时参数为被添加的Buff实例 public OrderedDictionary<string, PrioritizedAction<BuffBase<T>>> onOtherBuffApplied; //Buff被添加时参数为被添加的Buff实例
public OrderedDictionary<string, PrioritizedAction<BuffBase<T>>> onOtherBuffFirstApplied; //Buff被新添加时参数为被添加的Buff实例 public OrderedDictionary<string, PrioritizedAction<BuffBase<T>>> onOtherBuffFirstApplied; //Buff被新添加时参数为被添加的Buff实例
public OrderedDictionary<string, PrioritizedAction<BuffBase<T>>> onOtherBuffRemoved; //Buff被移除参数为被移除的Buff实例 public OrderedDictionary<string, PrioritizedAction<BuffBase<T>>> onOtherBuffRemoved; //Buff被移除参数为被移除的Buff实例
public OrderedDictionary<string, PrioritizedAction<CharacterBase, IntendedCard, CharacterBase>> onOpponentDecideAction; //对手AI决定行动时参数为对手和原定的目标角色 public OrderedDictionary<string, PrioritizedAction<CharacterBase, IntendedCard, CharacterBase>> onOpponentDecideAction; //对手AI决定行动时参数为对手和原定的目标角色

View File

@@ -97,7 +97,7 @@ namespace Continentis.Mods
} }
} }
Debug.Log($"Collected {collectedDataIDList.Count} CardData assets."); Debug.Log($"Collected {collectedDataIDList.Count} {typeof(T).Name} assets.");
return collectedDataIDList; return collectedDataIDList;
} }

View File

@@ -34,10 +34,10 @@ namespace SLSFramework.StorySystem.Dialog
// -- 角色名 -- // -- 角色名 --
_characterField = new ObjectField("Character") _characterField = new ObjectField("Character")
{ {
objectType = typeof(CharacterData), objectType = typeof(StoryCharacterData),
allowSceneObjects = false allowSceneObjects = false
}; };
_characterField.SetValueWithoutNotify(_data.characterData); _characterField.SetValueWithoutNotify(_data.storyCharacterData);
_characterField.RegisterValueChangedCallback(OnCharacterDataChanged); _characterField.RegisterValueChangedCallback(OnCharacterDataChanged);
extensionContainer.Add(_characterField); extensionContainer.Add(_characterField);
@@ -88,7 +88,7 @@ namespace SLSFramework.StorySystem.Dialog
// --- 6. 核心逻辑:当 ObjectField 变化时调用 --- // --- 6. 核心逻辑:当 ObjectField 变化时调用 ---
private void OnCharacterDataChanged(ChangeEvent<Object> evt) private void OnCharacterDataChanged(ChangeEvent<Object> evt)
{ {
_data.characterData = evt.newValue as CharacterData; _data.storyCharacterData = evt.newValue as StoryCharacterData;
// 清空旧的表情 // 清空旧的表情
_data.expressionKey = null; _data.expressionKey = null;
@@ -110,7 +110,7 @@ namespace SLSFramework.StorySystem.Dialog
// 清空旧选项 // 清空旧选项
_expressionField.choices.Clear(); _expressionField.choices.Clear();
if (_data.characterData == null) if (_data.storyCharacterData == null)
{ {
// 如果没有角色,禁用下拉框 // 如果没有角色,禁用下拉框
_expressionField.SetValueWithoutNotify(null); _expressionField.SetValueWithoutNotify(null);
@@ -119,7 +119,7 @@ namespace SLSFramework.StorySystem.Dialog
} }
// 从 CharacterData 中提取所有表情的 "name" // 从 CharacterData 中提取所有表情的 "name"
List<string> expressionKeys = _data.characterData.expressions List<string> expressionKeys = _data.storyCharacterData.expressions
.Select(expr => expr.key) .Select(expr => expr.key)
.ToList(); .ToList();

View File

@@ -1,6 +1,7 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using UnityEngine; using UnityEngine;
using UnityEngine.Serialization;
namespace SLSFramework.StorySystem.Dialog namespace SLSFramework.StorySystem.Dialog
{ {
@@ -11,7 +12,7 @@ namespace SLSFramework.StorySystem.Dialog
[Serializable] [Serializable]
public class DialogNodeData : BaseNodeData public class DialogNodeData : BaseNodeData
{ {
public CharacterData characterData; [FormerlySerializedAs("characterData")] public StoryCharacterData storyCharacterData;
public string expressionKey; // 用于存储所选表情的 name public string expressionKey; // 用于存储所选表情的 name
public Vector2 characterPosition; public Vector2 characterPosition;
[TextArea(3, 10)] public string dialogueText; [TextArea(3, 10)] public string dialogueText;

View File

@@ -2,17 +2,17 @@ using System;
using System.Collections.Generic; using System.Collections.Generic;
using UnityEngine; using UnityEngine;
namespace SLSFramework.StorySystem.Dialog namespace SLSFramework.StorySystem
{ {
[CreateAssetMenu(fileName = "NewCharacterData", menuName = "StorySystem/Dialog/Character Data")] [CreateAssetMenu(fileName = "NewCharacterData", menuName = "StorySystem/Character Data")]
public partial class CharacterData : ScriptableObject public partial class StoryCharacterData : ScriptableObject
{ {
public string characterName; public string characterName;
public List<Expression> expressions = new List<Expression>(); public List<Expression> expressions = new List<Expression>();
} }
public partial class CharacterData public partial class StoryCharacterData
{ {
[Serializable] [Serializable]
public class Expression public class Expression