浏览代码

Fix Quest Tool : Add Remove buttons and AddDialogue Buttons

/main
uChema 3 年前
当前提交
50525348
共有 26 个文件被更改,包括 953 次插入431 次删除
  1. 32
      UOP1_Project/Assets/LocalizationFiles/AssetTables/QuestSystem/Questline Dialogue_en.asset
  2. 4
      UOP1_Project/Assets/LocalizationFiles/AssetTables/QuestSystem/Questline Dialogue_fr.asset
  3. 1
      UOP1_Project/Assets/ScriptableObjects/Quests/Questline1/Quest2/Step1/S1-Q2-QL1.asset
  4. 34
      UOP1_Project/Assets/ScriptableObjects/Quests/Questline1/Quest2/Step1/SD-S1-Q2-QL1.asset
  5. 1
      UOP1_Project/Assets/ScriptableObjects/Quests/Questline1/Quest2/Step3/S3-Q2-QL1.asset
  6. 64
      UOP1_Project/Assets/Scripts/Dialogues/DialogueDataSO.cs
  7. 1
      UOP1_Project/Assets/Scripts/Quests/Editor/LocalizationUtils.cs
  8. 992
      UOP1_Project/Assets/Scripts/Quests/Editor/QuestEditorWindow.cs
  9. 37
      UOP1_Project/Assets/Scripts/Quests/Resources/QuestEditorWindow.uxml
  10. 13
      UOP1_Project/Assets/Scripts/Quests/ScriptableObjects/QuestSO.cs
  11. 13
      UOP1_Project/Assets/Scripts/Quests/ScriptableObjects/QuestlineSO.cs
  12. 31
      UOP1_Project/Assets/Scripts/Quests/ScriptableObjects/StepSO.cs
  13. 2
      UOP1_Project/ProjectSettings/ProjectSettings.asset
  14. 18
      UOP1_Project/Assets/ScriptableObjects/Quests/Questline1/Quest1/Step1/CD-S1-Q1-QL1.asset
  15. 8
      UOP1_Project/Assets/ScriptableObjects/Quests/Questline1/Quest1/Step1/CD-S1-Q1-QL1.asset.meta
  16. 18
      UOP1_Project/Assets/ScriptableObjects/Quests/Questline1/Quest1/Step1/ID-S1-Q1-QL1.asset
  17. 8
      UOP1_Project/Assets/ScriptableObjects/Quests/Questline1/Quest1/Step1/ID-S1-Q1-QL1.asset.meta
  18. 18
      UOP1_Project/Assets/ScriptableObjects/Quests/Questline1/Quest1/Step2/ID-S2-Q1-QL1.asset
  19. 8
      UOP1_Project/Assets/ScriptableObjects/Quests/Questline1/Quest1/Step2/ID-S2-Q1-QL1.asset.meta
  20. 24
      UOP1_Project/Assets/ScriptableObjects/Quests/Questline1/Quest2/Step1/CD-S1-Q2-QL1.asset
  21. 8
      UOP1_Project/Assets/ScriptableObjects/Quests/Questline1/Quest2/Step1/CD-S1-Q2-QL1.asset.meta
  22. 18
      UOP1_Project/Assets/ScriptableObjects/Quests/Questline1/Quest2/Step1/ID-S1-Q2-QL1.asset
  23. 8
      UOP1_Project/Assets/ScriptableObjects/Quests/Questline1/Quest2/Step1/ID-S1-Q2-QL1.asset.meta
  24. 15
      UOP1_Project/ProjectSettings/TimelineSettings.asset
  25. 8
      UOP1_Project/Assets/ScriptableObjects/Quests/Questline3.meta

32
UOP1_Project/Assets/LocalizationFiles/AssetTables/QuestSystem/Questline Dialogue_en.asset


m_Localized: Who are you!
m_Metadata:
m_Items: []
- m_Id: 45599299228000256
m_Localized: This is an example
m_Metadata:
m_Items: []
- m_Id: 45599303694934016
m_Localized: This is an example
m_Metadata:
m_Items: []
- m_Id: 45599308925231104
m_Localized: This is an example
m_Metadata:
m_Items: []
- m_Id: 45602155272200192
m_Localized: test
m_Metadata:
m_Items: []
- m_Id: 45602159407783936
m_Localized: Ok
m_Metadata:
m_Items: []
- m_Id: 45602163023273984
m_Localized: Boo
m_Metadata:
m_Items: []
- m_Id: 45667467006959616
m_Localized: Test
m_Metadata:
m_Items: []
- m_Id: 45668460641771520
m_Localized: NO
m_Metadata:
m_Items: []
references:
version: 1

4
UOP1_Project/Assets/LocalizationFiles/AssetTables/QuestSystem/Questline Dialogue_fr.asset


m_Localized: T'es qui?
m_Metadata:
m_Items: []
- m_Id: 45667467006959616
m_Localized: Test
m_Metadata:
m_Items: []
references:
version: 1

1
UOP1_Project/Assets/ScriptableObjects/Quests/Questline1/Quest2/Step1/S1-Q2-QL1.asset


_item: {fileID: 0}
_type: 0
_isDone: 0
_endStepEvent: {fileID: 0}

34
UOP1_Project/Assets/ScriptableObjects/Quests/Questline1/Quest2/Step1/SD-S1-Q2-QL1.asset


_actor: {fileID: 11400000, guid: 5e7bd0eed8324794fad1bc460c565ecb, type: 2}
_dialogueLines:
- m_TableReference:
m_TableCollectionName: GUID:dde4d865ca93d7b4dbc6a1bbce6595b2
m_TableCollectionName: Questline Dialogue
m_KeyId: 238002471034882
m_Key:
m_KeyId: 0
m_Key: L1-SD-S1-Q2-QL1
m_FallbackState: 0
m_TableCollectionName: GUID:dde4d865ca93d7b4dbc6a1bbce6595b2
m_TableCollectionName: Questline Dialogue
m_KeyId: 238002471034883
m_Key:
_choices: []
m_KeyId: 0
m_Key: L2-SD-S1-Q2-QL1
m_FallbackState: 0
_choices:
- _response:
m_TableReference:
m_TableCollectionName: GUID:f81a49615d56c1a4fbbd14b4569b06f3
m_TableEntryReference:
m_KeyId: 20322714321281024
m_Key:
m_FallbackState: 0
_nextDialogue: {fileID: 11400000, guid: bc4422bcb6b4ecd4da1951a735f57b1f, type: 2}
_actionType: 0
- _response:
m_TableReference:
m_TableCollectionName: GUID:f81a49615d56c1a4fbbd14b4569b06f3
m_TableEntryReference:
m_KeyId: 20322813445267456
m_Key:
m_FallbackState: 0
_nextDialogue: {fileID: 11400000, guid: c1120b75e12d6424189743f165c33b40, type: 2}
_actionType: 0
_dialogueType: 0

1
UOP1_Project/Assets/ScriptableObjects/Quests/Questline1/Quest2/Step3/S3-Q2-QL1.asset


_item: {fileID: 11400000, guid: 4e4f02d17d76e4c94b68971951eaa717, type: 2}
_type: 3
_isDone: 0
_endStepEvent: {fileID: 0}

64
UOP1_Project/Assets/Scripts/Dialogues/DialogueDataSO.cs


using UnityEngine.Timeline;
using UnityEngine.Localization;
using UnityEditor.Localization;
using UnityEditor;
public enum DialogueType
{

public ActorSO Actor => _actor;
public List<LocalizedString> DialogueLines => _dialogueLines;
public List<Choice> Choices => _choices;
public DialogueType DialogueType => _dialogueType;
public DialogueType DialogueType
{
get { return _dialogueType; }
set { _dialogueType = value; }
}
public void SetActor(ActorSO newActor)
{

{
int index = 0;
LocalizedString _dialogueLine = null;
do
{
index++;

}
else
{
_dialogueLine = null;
}
} while (_dialogueLine != null);
}
}
public void CreateLine()
{
if (_dialogueLines == null)
_dialogueLines = new List<LocalizedString>();
_dialogueLines.Clear();
StringTableCollection collection = LocalizationEditorSettings.GetStringTableCollection("Questline Dialogue");
if (collection != null)
{
string DefaultKey = "L" + 1 + "-" + this.name;
if (!collection.SharedData.Contains(DefaultKey))
{
collection.SharedData.AddKey(DefaultKey);
}
}
SetDialogueLines();
}
public void RemoveLineFromSharedTable()
{
StringTableCollection collection = LocalizationEditorSettings.GetStringTableCollection("Questline Dialogue");
if (collection != null)
{
int index = 0;
LocalizedString _dialogueLine = null;
do
{
index++;
string key = "L" + index + "-" + this.name;
if (collection.SharedData.Contains(key))
{
collection.SharedData.RemoveKey(key);
}
else
{
_dialogueLine = null;
}

}
public string GetPath()
{
return AssetDatabase.GetAssetPath(this);
}
#endif
}

1
UOP1_Project/Assets/Scripts/Quests/Editor/LocalizationUtils.cs


{
StringTable table = (StringTable)tableCollection.GetTable(locale.Identifier);
if (table != null)
if (table.GetEntryFromReference(localizedStringReference.TableEntryReference)!=null)
text = table.GetEntryFromReference(localizedStringReference.TableEntryReference).LocalizedValue;
}
}

992
UOP1_Project/Assets/Scripts/Quests/Editor/QuestEditorWindow.cs
文件差异内容过多而无法显示
查看文件

37
UOP1_Project/Assets/Scripts/Quests/Resources/QuestEditorWindow.uxml


<ui:UXML xmlns:ui="UnityEngine.UIElements" xmlns:uie="UnityEditor.UIElements" xsi="http://www.w3.org/2001/XMLSchema-instance" engine="UnityEngine.UIElements" editor="UnityEditor.UIElements" noNamespaceSchemaLocation="../../../UIElementsSchema/UIElements.xsd" editor-extension-mode="False">
<Style src="QuestEditorWindow.uss" />
<Style src="DialogueUSS.uss" />
<ui:VisualElement name="quest-editor-window" style="flex-direction: row; height: 100%; width: 100%; min-height: 700px;">
<ui:VisualElement name="1st-column" style="width: 30%;">
<ui:VisualElement name="questlines" class="padding5 ColorStyling1" style="width: auto; height: 150px;">
<ui:VisualElement name="quest-editor-window" style="flex-direction: row; height: 100%; width: 100%; min-height: 500px;">
<ui:VisualElement name="1st-column" style="width: 30%; height: 100%;">
<ui:VisualElement name="questlines" class="padding5 ColorStyling1" style="width: auto; height: 25%;">
<ui:Button text="+" display-tooltip-when-elided="true" name="CreateQL" class="AddButton" />
<ui:Button text="-" display-tooltip-when-elided="true" name="remove-QL-btn" class="AddButton" />
<ui:Button text="+" display-tooltip-when-elided="true" name="create-QL-btn" class="AddButton" />
<ui:VisualElement name="steps" class="padding5 ColorStyling2" style="width: auto; height: 150px;">
<ui:VisualElement name="steps" class="padding5 ColorStyling2" style="width: auto; height: 25%;">
<ui:Button text="+" display-tooltip-when-elided="true" name="CreateS" class="AddButton" />
<ui:Button text="-" display-tooltip-when-elided="true" name="remove-S-btn" class="AddButton" />
<ui:Button text="+" display-tooltip-when-elided="true" name="create-S-btn" class="AddButton" />
<ui:VisualElement name="step-info-panel" class="padding5 ColorStyling1" style="width: auto; height: 100%;">
<ui:VisualElement name="step-info-panel" class="padding5 ColorStyling1" style="width: auto; height: 50%;">
<ui:VisualElement name="2nd-column" style="width: 30%;">
<ui:VisualElement name="quests" class="padding5 ColorStyling2" style="width: auto; height: 150px;">
<ui:VisualElement name="2nd-column" style="width: 30%; height: 100%;">
<ui:VisualElement name="quests" class="padding5 ColorStyling2" style="width: auto; height: 25%;">
<ui:Button text="+" display-tooltip-when-elided="true" name="CreateQ" class="AddButton" />
<ui:Button text="-" display-tooltip-when-elided="true" name="remove-Q-btn" class="AddButton" />
<ui:Button text="+" display-tooltip-when-elided="true" name="create-Q-btn" class="AddButton" />
<ui:VisualElement name="dialogues" class="padding5 ColorStyling1" style="width: auto; height: 150px;">
<ui:VisualElement name="dialogues" class="padding5 ColorStyling1" style="width: auto; height: 25%;">
<ui:VisualElement name="dialogues-list" style="height: 100%;" />
<ui:VisualElement name="dialogues-list" style="height: 100%;">
<ui:VisualElement name="buttons-panel" />
</ui:VisualElement>
<ui:VisualElement name="dialogue-info-panel" class="padding5 ColorStyling2" style="width: auto; height: 100%;">
<ui:VisualElement name="dialogue-info-panel" class="padding5 ColorStyling2" style="width: auto; height: 50%;">
<ui:VisualElement name="3rd-column" class="3rdColumn">
<ui:Label text="Quest Preview" display-tooltip-when-elided="true" name="quest-preview-title" class="title" style="color: rgb(65, 65, 65); height: 18.5px;" />
<ui:VisualElement name="3rd-column" class="3rdColumn" style="height: 100%;">
<ui:Label text="Preview" display-tooltip-when-elided="true" name="preview-title" class="title" style="color: rgb(65, 65, 65); height: 18.5px;" />
<ui:VisualElement name="questline-preview" />
<ui:VisualElement name="quest-preview" />
<ui:ScrollView name="actor-conversations" show-vertical-scroller="true" style="height: 100%;" />
</ui:VisualElement>
</ui:VisualElement>

13
UOP1_Project/Assets/Scripts/Quests/ScriptableObjects/QuestSO.cs


using System.Collections.Generic;
using UnityEditor;
using UnityEngine;
[CreateAssetMenu(fileName = "Quest", menuName = "Quests/Quest", order = 51)]

private List<StepSO> _steps = new List<StepSO>();
[SerializeField]
bool _isDone = false;
[SerializeField]
VoidEventChannelSO _endQuestEvent = default;
public VoidEventChannelSO EndQuestEvent => _endQuestEvent;
if(_endQuestEvent != null)
{
_endQuestEvent.RaiseEvent();
}
}
public void SetQuestId(int id)

}
public string GetPath()
{
return AssetDatabase.GetAssetPath(this);
}
}

13
UOP1_Project/Assets/Scripts/Quests/ScriptableObjects/QuestlineSO.cs


using System.Collections.Generic;
using UnityEditor;
using UnityEngine;
[CreateAssetMenu(fileName = "Questline", menuName = "Quests/Questline", order = 51)]

private List<QuestSO> _quests = new List<QuestSO>();
[SerializeField]
bool _isDone = false;
[SerializeField]
VoidEventChannelSO _endQuestlineEvent = default;
public VoidEventChannelSO EndQuestlineEvent => _endQuestlineEvent;
if(_endQuestlineEvent!=null)
{ _endQuestlineEvent.RaiseEvent(); }
public string GetPath()
{
return AssetDatabase.GetAssetPath(this);
}
}

31
UOP1_Project/Assets/Scripts/Quests/ScriptableObjects/StepSO.cs


using System.Collections.Generic;
using UnityEditor;
using UnityEngine;
using UnityEngine.Localization;
using UnityEngine.Serialization;

private StepType _type = default;
[SerializeField]
bool _isDone = false;
public DialogueDataSO DialogueBeforeStep => _dialogueBeforeStep;
public DialogueDataSO CompleteDialogue => _completeDialogue;
public DialogueDataSO IncompleteDialogue => _incompleteDialogue;
[SerializeField]
VoidEventChannelSO _endStepEvent = default;
public DialogueDataSO DialogueBeforeStep {
get { return _dialogueBeforeStep; }
set { _dialogueBeforeStep = value; }
}
public DialogueDataSO CompleteDialogue
{
get { return _completeDialogue; }
set { _completeDialogue = value; }
}
public DialogueDataSO IncompleteDialogue
{
get { return _incompleteDialogue; }
set { _incompleteDialogue = value; }
}
public VoidEventChannelSO EndStepEvent => _endStepEvent;
public StepType Type => _type;
public bool IsDone => _isDone;
public ActorSO Actor => _actor;

if(_endStepEvent!=null)
_endStepEvent.RaiseEvent();
_isDone = true;
}

return dialogueData;
}
public string GetPath()
{
return AssetDatabase.GetAssetPath(this);
}
}

2
UOP1_Project/ProjectSettings/ProjectSettings.asset


androidSupportedAspectRatio: 1
androidMaxAspectRatio: 2.1
applicationIdentifier:
Standalone: com.openprojects.chopchop
Standalone: com.UnityOpenProjects.ChopChop
buildNumber:
Standalone: 0
iPhone: 0

18
UOP1_Project/Assets/ScriptableObjects/Quests/Questline1/Quest1/Step1/CD-S1-Q1-QL1.asset


%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &11400000
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: a0c0171b565b4074a9462307824be26c, type: 3}
m_Name: CD-S1-Q1-QL1
m_EditorClassIdentifier:
_actor: {fileID: 0}
_dialogueLines: []
_choices: []
_dialogueType: 0

8
UOP1_Project/Assets/ScriptableObjects/Quests/Questline1/Quest1/Step1/CD-S1-Q1-QL1.asset.meta


fileFormatVersion: 2
guid: d7e7c043e16a39b49b6b40b3a4cc36c7
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 11400000
userData:
assetBundleName:
assetBundleVariant:

18
UOP1_Project/Assets/ScriptableObjects/Quests/Questline1/Quest1/Step1/ID-S1-Q1-QL1.asset


%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &11400000
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: a0c0171b565b4074a9462307824be26c, type: 3}
m_Name: ID-S1-Q1-QL1
m_EditorClassIdentifier:
_actor: {fileID: 0}
_dialogueLines: []
_choices: []
_dialogueType: 0

8
UOP1_Project/Assets/ScriptableObjects/Quests/Questline1/Quest1/Step1/ID-S1-Q1-QL1.asset.meta


fileFormatVersion: 2
guid: a226d788c70131247ae4d0e249fe9e76
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 11400000
userData:
assetBundleName:
assetBundleVariant:

18
UOP1_Project/Assets/ScriptableObjects/Quests/Questline1/Quest1/Step2/ID-S2-Q1-QL1.asset


%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &11400000
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: a0c0171b565b4074a9462307824be26c, type: 3}
m_Name: ID-S2-Q1-QL1
m_EditorClassIdentifier:
_actor: {fileID: 0}
_dialogueLines: []
_choices: []
_dialogueType: 0

8
UOP1_Project/Assets/ScriptableObjects/Quests/Questline1/Quest1/Step2/ID-S2-Q1-QL1.asset.meta


fileFormatVersion: 2
guid: 473361716230ea64da50adc3c5dc5a67
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 11400000
userData:
assetBundleName:
assetBundleVariant:

24
UOP1_Project/Assets/ScriptableObjects/Quests/Questline1/Quest2/Step1/CD-S1-Q2-QL1.asset


%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &11400000
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: a0c0171b565b4074a9462307824be26c, type: 3}
m_Name: CD-S1-Q2-QL1
m_EditorClassIdentifier:
_actor: {fileID: 0}
_dialogueLines:
- m_TableReference:
m_TableCollectionName: Questline Dialogue
m_TableEntryReference:
m_KeyId: 0
m_Key: L1-CD-S1-Q2-QL1
m_FallbackState: 0
_choices: []
_dialogueType: 1

8
UOP1_Project/Assets/ScriptableObjects/Quests/Questline1/Quest2/Step1/CD-S1-Q2-QL1.asset.meta


fileFormatVersion: 2
guid: bc4422bcb6b4ecd4da1951a735f57b1f
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 11400000
userData:
assetBundleName:
assetBundleVariant:

18
UOP1_Project/Assets/ScriptableObjects/Quests/Questline1/Quest2/Step1/ID-S1-Q2-QL1.asset


%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &11400000
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: a0c0171b565b4074a9462307824be26c, type: 3}
m_Name: ID-S1-Q2-QL1
m_EditorClassIdentifier:
_actor: {fileID: 0}
_dialogueLines: []
_choices: []
_dialogueType: 0

8
UOP1_Project/Assets/ScriptableObjects/Quests/Questline1/Quest2/Step1/ID-S1-Q2-QL1.asset.meta


fileFormatVersion: 2
guid: c1120b75e12d6424189743f165c33b40
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 11400000
userData:
assetBundleName:
assetBundleVariant:

15
UOP1_Project/ProjectSettings/TimelineSettings.asset


%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &1
MonoBehaviour:
m_ObjectHideFlags: 61
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: a287be6c49135cd4f9b2b8666c39d999, type: 3}
m_Name:
m_EditorClassIdentifier:
assetDefaultFramerate: 60

8
UOP1_Project/Assets/ScriptableObjects/Quests/Questline3.meta


fileFormatVersion: 2
guid: cc0d7169fb8564bec9db9943e8075cb4
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
正在加载...
取消
保存