diff --git a/.github/workflows/UPMBranchUpdate.yml b/.github/workflows/UPMBranchUpdate.yml index 59a3519..f65fc27 100644 --- a/.github/workflows/UPMBranchUpdate.yml +++ b/.github/workflows/UPMBranchUpdate.yml @@ -10,6 +10,11 @@ jobs: runs-on: ubuntu-latest steps: + - name: Set Git Config + run: | + git config --global user.email "tazimtazim2012@gmail.com" + git config --global user.name "Warhammer4000" + - name: Checkout Repository uses: actions/checkout@v2 @@ -20,29 +25,65 @@ jobs: - name: Get Package Name from package.json id: get-package-name run: echo ::set-output name=package-name::$(jq -r .name ${{ steps.find-package-json.outputs.package-json-path }}) - - - name: Git Subtree Split - run: git subtree split -P Assets/Packages/${{ steps.get-package-name.outputs.package-name }}/ -b upm - - + - name: Get Version from package.json id: get-version run: echo ::set-output name=version::$(jq -r .version ${{ steps.find-package-json.outputs.package-json-path }}) + + - name: Git Subtree Split + run: git subtree split -P Assets/Packages/${{ steps.get-package-name.outputs.package-name }}/ -b upm - - name: Push Branch + - name: Rename Samples run: | git checkout upm if [[ -d "Samples" ]]; then - git mv Samples Samples~ - rm -f Samples.meta - git config --global user.name 'github-bot' - git config --global user.email 'github-bot@users.noreply.github.com' - git commit -am "fix: Samples => Samples~" + git mv Samples Samples~ + rm -f Samples.meta + git commit -am "fix: Samples => Samples~" fi - git push -f -u origin upm - name: Create Git Tag if: steps.get-version.outputs.version != '' - run: | - git tag v${{ steps.get-version.outputs.version }} upm - git push origin --tags \ No newline at end of file + run: git tag v${{ steps.get-version.outputs.version }} upm + + - name: Push Tags + run: | + git checkout upm + git push -f -u origin upm + git push --tags + + SelfHosted-Publish: + needs: update-and-tag + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + with: + ref: upm + - uses: actions/setup-node@v3 + with: + node-version: '20.x' + registry-url: ${{ secrets.NPM_SERVER }} + - run: npm publish + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }} + + GitHub-Publish: + needs: update-and-tag + runs-on: ubuntu-latest + permissions: + packages: write + + + steps: + - uses: actions/checkout@v4 + with: + ref: upm + + - uses: actions/setup-node@v3 + with: + node-version: '20.x' + + - uses: FrontEndDev-org/publish-node-package-action@v1 + with: + target: github diff --git a/.github/workflows/code_quality.yml b/.github/workflows/code_quality.yml new file mode 100644 index 0000000..a4b6a16 --- /dev/null +++ b/.github/workflows/code_quality.yml @@ -0,0 +1,23 @@ +name: Qodana +on: + workflow_dispatch: + push: + branches: # Specify your branches here + - main # The 'main' branch + +jobs: + qodana: + runs-on: ubuntu-latest + permissions: + contents: write + pull-requests: write + checks: write + steps: + - uses: actions/checkout@v3 + with: + ref: ${{ github.event.pull_request.head.sha }} # to check out the actual pull request commit, not the merge commit + fetch-depth: 0 # a full history is required for pull request analysis + - name: 'Qodana Scan' + uses: JetBrains/qodana-action@v2023.3 + env: + QODANA_TOKEN: ${{ secrets.QODANA_TOKEN }} diff --git a/.github/workflows/docgen.yml b/.github/workflows/docgen.yml index 54ee224..b98ff02 100644 --- a/.github/workflows/docgen.yml +++ b/.github/workflows/docgen.yml @@ -1,27 +1,36 @@ -name: docfx-unitypackage +name: docfx for GitHub Pages on: - workflow_dispatch: push: branches: - - main + - 'main' + release: + types: [published] + workflow_dispatch: + +permissions: + contents: read + pages: write + id-token: write + +concurrency: + group: "pages" + cancel-in-progress: false jobs: - build-and-deploy: - runs-on: ubuntu-latest + deploy: + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + runs-on: ubuntu-latest. + steps: - name: Checkout - uses: actions/checkout@v3 - with: - submodules: true - - - name: Find and copy specific files - run: | - # Look for LICENSE.md, README.md, and CHANGELOG.md in subdirectories - find . -name LICENSE.md -exec cp {} . \; - find . -name README.md -exec cp {} . \; - find . -name CHANGELOG.md -exec cp {} . \; + uses: actions/checkout@v4 + + - name: Remove csproj files + run: find . -name "*.csproj" -type f -delete shell: bash - name: Build @@ -29,9 +38,33 @@ jobs: with: github_token: ${{ secrets.GITHUB_TOKEN }} - - name: Deploy - uses: peaceiris/actions-gh-pages@v3 + + - name: Deploy with DocFX + uses: sator-imaging/docfx-pages@v1 + id: deployment with: + app_name: 'Dialoguesystem' + site_title: 'Dialoguesystem' + site_footer: '× Is HTML accepted?' + class_members: 'separatePages' + google_analytics: '' + define_symbols: '' + site_logo: '.svg' + site_favicon: '.svg' + main_js: | + export default { + defaultTheme: 'light', + showLightbox: (img) => true, + iconLinks: [ + { + icon: 'github', + href: 'https://github.com/sator-imaging', + title: 'GitHub' + }, + ], + } + main_css: | github_token: ${{ secrets.GITHUB_TOKEN }} publish_branch: gh-pages publish_dir: _site + diff --git a/Assets/Packages/com.studio23.ss2.dialoguesystem/Editor/Data/CharacterDataEditor.cs b/Assets/Packages/com.studio23.ss2.dialoguesystem/Editor/Data/CharacterDataEditor.cs new file mode 100644 index 0000000..c8e1dc5 --- /dev/null +++ b/Assets/Packages/com.studio23.ss2.dialoguesystem/Editor/Data/CharacterDataEditor.cs @@ -0,0 +1,36 @@ +using Studio23.SS2.DialogueSystem.Data; +using UnityEditor; +using UnityEditor.Localization.Plugins.XLIFF.V12; +using UnityEngine; + +namespace Editor.Data +{ + [CustomEditor(typeof(CharacterData))] + public class CharacterDataEditor:UnityEditor.Editor + { + private string newExpressionName = "QUESTIONABLE EMOJI FACE"; + public override void OnInspectorGUI() + { + base.OnInspectorGUI(); + var charData = target as CharacterData; + newExpressionName = EditorGUILayout.TextField(newExpressionName); + if (!string.IsNullOrEmpty(newExpressionName) && GUILayout.Button("Add new Expression")) + { + AddExpression(charData, newExpressionName); + } + } + + public static void AddExpression(CharacterData character, string expressionName) + { + var expression = ScriptableObject.CreateInstance(); + expression.Character = character; + expression.ExpressionName = expressionName; + expression.name = expression.GetAssetName(); + character.Expressions.Add(expression); + + AssetDatabase.AddObjectToAsset(expression, character); + AssetDatabase.SaveAssets(); + EditorUtility.SetDirty(character); + } + } +} \ No newline at end of file diff --git a/Assets/Packages/com.studio23.ss2.dialoguesystem/Editor/Data/CharacterDataEditor.cs.meta b/Assets/Packages/com.studio23.ss2.dialoguesystem/Editor/Data/CharacterDataEditor.cs.meta new file mode 100644 index 0000000..0c2412e --- /dev/null +++ b/Assets/Packages/com.studio23.ss2.dialoguesystem/Editor/Data/CharacterDataEditor.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 26263842f4194512aee5b70addde9c6b +timeCreated: 1710737129 \ No newline at end of file diff --git a/Assets/Packages/com.studio23.ss2.dialoguesystem/Editor/Data/CharacterExpressionDataEditor.cs b/Assets/Packages/com.studio23.ss2.dialoguesystem/Editor/Data/CharacterExpressionDataEditor.cs new file mode 100644 index 0000000..0203924 --- /dev/null +++ b/Assets/Packages/com.studio23.ss2.dialoguesystem/Editor/Data/CharacterExpressionDataEditor.cs @@ -0,0 +1,39 @@ +using Studio23.SS2.DialogueSystem.Data; +using UnityEditor; +using UnityEngine; + +namespace Editor.Data +{ + [CustomEditor(typeof(CharacterExpressionData))] + public class CharacterExpressionDataEditor:UnityEditor.Editor + { + public override void OnInspectorGUI() + { + base.OnInspectorGUI(); + var expressionData = target as CharacterExpressionData; + if (GUILayout.Button("RENAME")) + { + Rename(expressionData); + } + + if (GUILayout.Button("REMOVE")) + { + RemoveExpression(expressionData); + } + } + + public void RemoveExpression(CharacterExpressionData data) + { + data.Character.Expressions.Remove(data); + Undo.DestroyObjectImmediate(data); + AssetDatabase.SaveAssets(); + } + + public void Rename(CharacterExpressionData data) + { + data.name = data.GetAssetName(); + AssetDatabase.SaveAssets(); + EditorUtility.SetDirty(data); + } + } +} \ No newline at end of file diff --git a/Assets/Packages/com.studio23.ss2.dialoguesystem/Editor/Data/CharacterExpressionDataEditor.cs.meta b/Assets/Packages/com.studio23.ss2.dialoguesystem/Editor/Data/CharacterExpressionDataEditor.cs.meta new file mode 100644 index 0000000..c8daa86 --- /dev/null +++ b/Assets/Packages/com.studio23.ss2.dialoguesystem/Editor/Data/CharacterExpressionDataEditor.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 6ac4e383fb75455188c54c76e91aa0b2 +timeCreated: 1710737316 \ No newline at end of file diff --git a/Assets/Packages/com.studio23.ss2.dialoguesystem/Editor/Data/DialogueBaseNodeEditor.cs b/Assets/Packages/com.studio23.ss2.dialoguesystem/Editor/Data/DialogueBaseNodeEditor.cs index fd18874..4078135 100644 --- a/Assets/Packages/com.studio23.ss2.dialoguesystem/Editor/Data/DialogueBaseNodeEditor.cs +++ b/Assets/Packages/com.studio23.ss2.dialoguesystem/Editor/Data/DialogueBaseNodeEditor.cs @@ -10,7 +10,6 @@ public class DialogueBaseNodeEditor : NodeEditor public Color TextColor = Color.white; private DialogueNodeBase dialogueBase; private static GUIStyle editorLabelStyle; - public override void OnBodyGUI() { if (dialogueBase == null) dialogueBase = target as DialogueNodeBase; diff --git a/Assets/Packages/com.studio23.ss2.dialoguesystem/Editor/Data/DialogueLineNodeEditor.cs b/Assets/Packages/com.studio23.ss2.dialoguesystem/Editor/Data/DialogueLineNodeEditor.cs index 00c78fb..da89b24 100644 --- a/Assets/Packages/com.studio23.ss2.dialoguesystem/Editor/Data/DialogueLineNodeEditor.cs +++ b/Assets/Packages/com.studio23.ss2.dialoguesystem/Editor/Data/DialogueLineNodeEditor.cs @@ -20,7 +20,13 @@ public override void OnBodyGUI() // Update serialized object's representation serializedObject.Update(); var dialogueLineNode = target as DialogueLineNodeBase; - + DrawLocalizationStringHelperGUI(dialogueLineNode); + + base.OnBodyGUI(); + } + + private void DrawLocalizationStringHelperGUI(DialogueLineNodeBase dialogueLineNode) + { var collection = LocalizationEditorSettings.GetStringTableCollection(dialogueLineNode.DialogueLocalizedString.TableReference); var defaultLocaleTable = collection.GetTable(DEFAULT_LOCALE) as StringTable; if (defaultLocaleTable == null) diff --git a/Assets/Packages/com.studio23.ss2.dialoguesystem/Editor/Data/LineSpeakerDataPropertyDrawer.cs b/Assets/Packages/com.studio23.ss2.dialoguesystem/Editor/Data/LineSpeakerDataPropertyDrawer.cs new file mode 100644 index 0000000..05f5b91 --- /dev/null +++ b/Assets/Packages/com.studio23.ss2.dialoguesystem/Editor/Data/LineSpeakerDataPropertyDrawer.cs @@ -0,0 +1,77 @@ +using System.Linq; +using Studio23.SS2.DialogueSystem.Data; +using UnityEditor; +using UnityEngine; + +namespace Editor.Data +{ + [CustomPropertyDrawer(typeof(LineSpeakerData))] + public class LineSpeakerDataPropertyDrawer:PropertyDrawer + { + public override float GetPropertyHeight(SerializedProperty property, GUIContent label) + { + return base.GetPropertyHeight(property, label) * 3; + } + + public override void OnGUI(Rect position, SerializedProperty property, GUIContent label) + { + EditorGUI.BeginProperty(position, label, property); + // Don't make child fields be indented + var indent = EditorGUI.indentLevel; + EditorGUI.indentLevel = 0; + // // Calculate rects + // var charRect = new Rect(position.x, position.y, 30, position.height); + // var unitRect = new Rect(position.x + 35, position.y, 50, position.height); + // var nameRect = new Rect(position.x + 90, position.y, position.width - 90, position.height); + // + // // Draw fields - pass GUIContent.none to each so they are drawn without labels + // EditorGUI.PropertyField(unitRect, property.FindPropertyRelative("unit"), GUIContent.none); + // EditorGUI.PropertyField(nameRect, property.FindPropertyRelative("name"), GUIContent.none); + // position.y += 30; + var lineSpeakerData = property.boxedValue as LineSpeakerData; + // EditorGUI.LabelField(position, lineSpeakerData is LineSpeakerData?"asdas":"zz"); + var charFieldRect = position; + charFieldRect.height = EditorGUIUtility.singleLineHeight; + EditorGUI.PropertyField(charFieldRect, property.FindPropertyRelative("Character"), new GUIContent("Character")); + if (lineSpeakerData.Character != null) + { + position.y += EditorGUIUtility.singleLineHeight; + var expressions = lineSpeakerData.Character.Expressions.Select(ced => ced.ExpressionName).ToArray(); + // EditorGUI.LabelField(position," :" + lineSpeakerData); + if (expressions.Length == 0) + { + EditorGUI.HelpBox(position, "NO EXPRESSIONS", MessageType.Error); + } + else + { + var expressionProp = property.FindPropertyRelative("Expression"); + + var prevIndex = lineSpeakerData.Character.GetExpressionIndexByName(lineSpeakerData.Expression); + var expressionPopupRect = position; + expressionPopupRect.height = EditorGUIUtility.singleLineHeight; + var expressionIndex = EditorGUI.Popup(expressionPopupRect, prevIndex, expressions); + if (expressionIndex != prevIndex) + { + if (expressionIndex >= 0 && expressionIndex < expressions.Length) + { + expressionProp.objectReferenceValue = lineSpeakerData.Character.Expressions[expressionIndex]; + expressionProp.serializedObject.ApplyModifiedProperties(); + + } + } + position.y += EditorGUIUtility.singleLineHeight; + var expressionFieldRect = position; + expressionFieldRect.height = EditorGUIUtility.singleLineHeight; + EditorGUI.BeginDisabledGroup(true); + EditorGUI.ObjectField(expressionFieldRect, expressionProp, GUIContent.none); + EditorGUI.EndDisabledGroup(); + } + } + + // Set indent back to what it was + EditorGUI.indentLevel = indent; + + EditorGUI.EndProperty(); + } + } +} \ No newline at end of file diff --git a/Assets/Packages/com.studio23.ss2.dialoguesystem/Editor/Data/LineSpeakerDataPropertyDrawer.cs.meta b/Assets/Packages/com.studio23.ss2.dialoguesystem/Editor/Data/LineSpeakerDataPropertyDrawer.cs.meta new file mode 100644 index 0000000..89128c5 --- /dev/null +++ b/Assets/Packages/com.studio23.ss2.dialoguesystem/Editor/Data/LineSpeakerDataPropertyDrawer.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 59f0bb338dad4b80bad4324e08cc1343 +timeCreated: 1710738743 \ No newline at end of file diff --git a/Assets/Packages/com.studio23.ss2.dialoguesystem/Runtime/Data/Models/CharacterData.cs b/Assets/Packages/com.studio23.ss2.dialoguesystem/Runtime/Data/Models/CharacterData.cs index aa38df4..2f7a19c 100644 --- a/Assets/Packages/com.studio23.ss2.dialoguesystem/Runtime/Data/Models/CharacterData.cs +++ b/Assets/Packages/com.studio23.ss2.dialoguesystem/Runtime/Data/Models/CharacterData.cs @@ -1,7 +1,8 @@ using System; using System.Collections.Generic; +using System.Linq; using UnityEngine; - +using UnityEngine.Serialization; namespace Studio23.SS2.DialogueSystem.Data { @@ -9,16 +10,18 @@ namespace Studio23.SS2.DialogueSystem.Data [Serializable] public class CharacterData : ScriptableObject { - public string CharacterID; public string CharacterName; public Color DialogueColor; - public List ExpressionTable; - } + public List Expressions; - [Serializable] - public class CharacterExpressionImage - { - public string Reaction; - public Sprite Image; + public CharacterExpressionData GetExpressionByName(string expressionName) + { + return Expressions.FirstOrDefault(e => e.ExpressionName == expressionName); + } + + public int GetExpressionIndexByName(CharacterExpressionData expressionData) + { + return Expressions.IndexOf(expressionData); + } } } \ No newline at end of file diff --git a/Assets/Packages/com.studio23.ss2.dialoguesystem/Runtime/Data/Models/CharacterExpressionData.cs b/Assets/Packages/com.studio23.ss2.dialoguesystem/Runtime/Data/Models/CharacterExpressionData.cs new file mode 100644 index 0000000..fb270bc --- /dev/null +++ b/Assets/Packages/com.studio23.ss2.dialoguesystem/Runtime/Data/Models/CharacterExpressionData.cs @@ -0,0 +1,18 @@ +using System; +using UnityEngine; + +namespace Studio23.SS2.DialogueSystem.Data +{ + [Serializable] + public class CharacterExpressionData:ScriptableObject + { + public CharacterData Character; + public string ExpressionName; + public Sprite Image; + + public string GetAssetName() + { + return $"{Character.CharacterName}_{ExpressionName}" ; + } + } +} \ No newline at end of file diff --git a/Assets/Packages/com.studio23.ss2.dialoguesystem/Runtime/Data/Models/CharacterExpressionData.cs.meta b/Assets/Packages/com.studio23.ss2.dialoguesystem/Runtime/Data/Models/CharacterExpressionData.cs.meta new file mode 100644 index 0000000..b6e6f68 --- /dev/null +++ b/Assets/Packages/com.studio23.ss2.dialoguesystem/Runtime/Data/Models/CharacterExpressionData.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 2ea1a97ac8dd4be5aa1587a59f11d10d +timeCreated: 1710736682 \ No newline at end of file diff --git a/Assets/Packages/com.studio23.ss2.dialoguesystem/Runtime/Data/Models/CharacterTable.cs b/Assets/Packages/com.studio23.ss2.dialoguesystem/Runtime/Data/Models/CharacterTable.cs deleted file mode 100644 index d7c650a..0000000 --- a/Assets/Packages/com.studio23.ss2.dialoguesystem/Runtime/Data/Models/CharacterTable.cs +++ /dev/null @@ -1,45 +0,0 @@ -using System.Collections.Generic; -using System.Linq; -using UnityEngine; - -namespace Studio23.SS2.DialogueSystem.Data -{ - [CreateAssetMenu(menuName = "Studio-23/Dialogue System/New Character Table")] - public class CharacterTable : ScriptableObject - { - public bool IsValid - { - get - { - if (characterList == null || characterList.Count == 0) - return false; - - // Create a set to keep track of unique Character IDs - HashSet uniqueCharacterIDs = new HashSet(); - - foreach (var characterData in characterList) - { - if (string.IsNullOrEmpty(characterData.CharacterID) || string.IsNullOrEmpty(characterData.CharacterName)) - return false; - - // Check if the Character ID is already in the set - if (uniqueCharacterIDs.Contains(characterData.CharacterID)) - return false; - - // Add the Character ID to the set - uniqueCharacterIDs.Add(characterData.CharacterID); - } - - return true; // All checks passed, the CharacterTable is valid - } - } - - public List characterList = new List(); - - public CharacterData GetCharacterData(string characterID) - { - return characterList.FirstOrDefault(r => r.CharacterID == characterID); - } - } - -} \ No newline at end of file diff --git a/Assets/Packages/com.studio23.ss2.dialoguesystem/Runtime/Data/Models/CharacterTable.cs.meta b/Assets/Packages/com.studio23.ss2.dialoguesystem/Runtime/Data/Models/CharacterTable.cs.meta deleted file mode 100644 index 9c89349..0000000 --- a/Assets/Packages/com.studio23.ss2.dialoguesystem/Runtime/Data/Models/CharacterTable.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 266137c0ba2af9d4aa901f763389f2dd -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Packages/com.studio23.ss2.dialoguesystem/Runtime/Data/Models/LineSpeakerData.cs b/Assets/Packages/com.studio23.ss2.dialoguesystem/Runtime/Data/Models/LineSpeakerData.cs new file mode 100644 index 0000000..89772bd --- /dev/null +++ b/Assets/Packages/com.studio23.ss2.dialoguesystem/Runtime/Data/Models/LineSpeakerData.cs @@ -0,0 +1,12 @@ +using System; +using UnityEngine.Serialization; + +namespace Studio23.SS2.DialogueSystem.Data +{ + [Serializable] + public class LineSpeakerData + { + public CharacterData Character; + public CharacterExpressionData Expression; + } +} \ No newline at end of file diff --git a/Assets/Packages/com.studio23.ss2.dialoguesystem/Runtime/Data/Models/LineSpeakerData.cs.meta b/Assets/Packages/com.studio23.ss2.dialoguesystem/Runtime/Data/Models/LineSpeakerData.cs.meta new file mode 100644 index 0000000..b06dd8d --- /dev/null +++ b/Assets/Packages/com.studio23.ss2.dialoguesystem/Runtime/Data/Models/LineSpeakerData.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: f4ad9ab5952541e590ec323ea5d77303 +timeCreated: 1710738039 \ No newline at end of file diff --git a/Assets/Packages/com.studio23.ss2.dialoguesystem/Runtime/Data/xNode/Node/DialogueLineNodeBase.cs b/Assets/Packages/com.studio23.ss2.dialoguesystem/Runtime/Data/xNode/Node/DialogueLineNodeBase.cs index f715e89..f60f3da 100644 --- a/Assets/Packages/com.studio23.ss2.dialoguesystem/Runtime/Data/xNode/Node/DialogueLineNodeBase.cs +++ b/Assets/Packages/com.studio23.ss2.dialoguesystem/Runtime/Data/xNode/Node/DialogueLineNodeBase.cs @@ -13,9 +13,7 @@ namespace Studio23.SS2.DialogueSystem.Data public abstract class DialogueLineNodeBase : DialogueNodeBase { public LocalizedString DialogueLocalizedString; - [Header("Character Data")] - public string ID; - public string Reaction; + [Header("Character Data")] public LineSpeakerData SpeakerData; [Header("Sound")] public string FMODEvent; diff --git a/Assets/Packages/com.studio23.ss2.dialoguesystem/Samples/DialogueChoiceDemo/Configuration/Localization/New Table Shared Data.asset b/Assets/Packages/com.studio23.ss2.dialoguesystem/Samples/DialogueChoiceDemo/Configuration/Localization/New Table Shared Data.asset index 56471c6..4cc80be 100644 --- a/Assets/Packages/com.studio23.ss2.dialoguesystem/Samples/DialogueChoiceDemo/Configuration/Localization/New Table Shared Data.asset +++ b/Assets/Packages/com.studio23.ss2.dialoguesystem/Samples/DialogueChoiceDemo/Configuration/Localization/New Table Shared Data.asset @@ -79,6 +79,10 @@ MonoBehaviour: m_Key: Start 2 m_Metadata: m_Items: [] + - m_Id: 21712402020478976 + m_Key: New Entry + m_Metadata: + m_Items: [] - m_Id: 23257417221206016 m_Key: aaaaa m_Metadata: diff --git a/Assets/Packages/com.studio23.ss2.dialoguesystem/Samples/DialogueChoiceDemo/DialogueBoxUI.cs b/Assets/Packages/com.studio23.ss2.dialoguesystem/Samples/DialogueChoiceDemo/DialogueBoxUI.cs index 84bf9e5..b5958e5 100644 --- a/Assets/Packages/com.studio23.ss2.dialoguesystem/Samples/DialogueChoiceDemo/DialogueBoxUI.cs +++ b/Assets/Packages/com.studio23.ss2.dialoguesystem/Samples/DialogueChoiceDemo/DialogueBoxUI.cs @@ -17,16 +17,12 @@ public class DialogueBoxUI : MonoBehaviour public Image BackgroundImage; public GameObject UIRoot; - public CharacterTable CharacterTable; - [Header("Configuration")] [SerializeField] private SubtitleSettings _config; void Start() { - //#TODO THE UI Shouldn't be responsible for loading the character table - CharacterTable = Resources.Load("DialogueSystem/CharacterTable"); ApplyConfiguration(); HideUI(); RegisterEvents(); @@ -78,21 +74,21 @@ private void handleDialogueLineStarted(DialogueLineNodeBase dialogueLineNodeBase private async UniTask ShowDialogueTextAsync(DialogueLineNodeBase nodeBase) { - CharacterData characterData = CharacterTable.GetCharacterData(nodeBase.ID); - string text = await TextLocalizer.LoadTextAndWait(nodeBase.DialogueLocalizedString); - if (characterData != null) - { - if (_config.EnableCharacterColor) - { - text = $"{characterData.CharacterName}:{DialogueTMP.text}"; - } - else - { - text = $"{characterData.CharacterName}:{DialogueTMP.text}"; - } - } + // CharacterData characterData = CharacterTable.GetCharacterData(nodeBase.ID); + // string text = await TextLocalizer.LoadTextAndWait(nodeBase.DialogueLocalizedString); + // if (characterData != null) + // { + // if (_config.EnableCharacterColor) + // { + // text = $"{characterData.CharacterName}:{DialogueTMP.text}"; + // } + // else + // { + // text = $"{characterData.CharacterName}:{DialogueTMP.text}"; + // } + // } - DialogueTMP.text = text; + // DialogueTMP.text = text; await UniTask.Delay(TimeSpan.FromSeconds(5), ignoreTimeScale: false);//TODO Dynamic Wait time according to text length } diff --git a/Assets/Packages/com.studio23.ss2.dialoguesystem/Samples/DialogueChoiceDemo/Resources/DialogueSystem/CharacterTable.asset b/Assets/Packages/com.studio23.ss2.dialoguesystem/Samples/DialogueChoiceDemo/Resources/DialogueSystem/CharacterTable.asset deleted file mode 100644 index 255bf37..0000000 --- a/Assets/Packages/com.studio23.ss2.dialoguesystem/Samples/DialogueChoiceDemo/Resources/DialogueSystem/CharacterTable.asset +++ /dev/null @@ -1,15 +0,0 @@ -%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: 266137c0ba2af9d4aa901f763389f2dd, type: 3} - m_Name: CharacterTable - m_EditorClassIdentifier: - characterList: [] diff --git a/Assets/Packages/com.studio23.ss2.dialoguesystem/Samples/DialogueChoiceDemo/Resources/DialogueSystem/CharacterTable.asset.meta b/Assets/Packages/com.studio23.ss2.dialoguesystem/Samples/DialogueChoiceDemo/Resources/DialogueSystem/CharacterTable.asset.meta deleted file mode 100644 index a8e7e08..0000000 --- a/Assets/Packages/com.studio23.ss2.dialoguesystem/Samples/DialogueChoiceDemo/Resources/DialogueSystem/CharacterTable.asset.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: d475c9e2546e17e4bb37441da01467e0 -NativeFormatImporter: - externalObjects: {} - mainObjectFileID: 11400000 - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Packages/com.studio23.ss2.dialoguesystem/Samples/DialogueChoiceDemo/Resources/DialogueSystem/Characters/Alan.asset b/Assets/Packages/com.studio23.ss2.dialoguesystem/Samples/DialogueChoiceDemo/Resources/DialogueSystem/Characters/Alan.asset index 80978b8..1e23a03 100644 --- a/Assets/Packages/com.studio23.ss2.dialoguesystem/Samples/DialogueChoiceDemo/Resources/DialogueSystem/Characters/Alan.asset +++ b/Assets/Packages/com.studio23.ss2.dialoguesystem/Samples/DialogueChoiceDemo/Resources/DialogueSystem/Characters/Alan.asset @@ -1,5 +1,35 @@ %YAML 1.1 %TAG !u! tag:unity3d.com,2011: +--- !u!114 &-4380900832573840736 +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: 2ea1a97ac8dd4be5aa1587a59f11d10d, type: 3} + m_Name: Alan_QUESTIONABLE EMOJI FACE + m_EditorClassIdentifier: + Character: {fileID: 11400000} + ExpressionName: QUESTIONABLE EMOJI FACE + Image: {fileID: 0} +--- !u!114 &-3622527576907991339 +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: 2ea1a97ac8dd4be5aa1587a59f11d10d, type: 3} + m_Name: Alan_NEED WAFFLES + m_EditorClassIdentifier: + Character: {fileID: 11400000} + ExpressionName: NEED WAFFLES + Image: {fileID: 0} --- !u!114 &11400000 MonoBehaviour: m_ObjectHideFlags: 0 @@ -12,7 +42,8 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 8c9b81d87e51f0f4197c65dca5fe6aec, type: 3} m_Name: Alan m_EditorClassIdentifier: - CharacterID: 1 CharacterName: Alan DialogueColor: {r: 1, g: 0, b: 0, a: 1} - ExpressionTable: [] + Expressions: + - {fileID: -4380900832573840736} + - {fileID: -3622527576907991339} diff --git a/Assets/Packages/com.studio23.ss2.dialoguesystem/Samples/DialogueChoiceDemo/Resources/DialogueSystem/Characters/Linda.asset b/Assets/Packages/com.studio23.ss2.dialoguesystem/Samples/DialogueChoiceDemo/Resources/DialogueSystem/Characters/Linda.asset index 3935efc..9cd153f 100644 --- a/Assets/Packages/com.studio23.ss2.dialoguesystem/Samples/DialogueChoiceDemo/Resources/DialogueSystem/Characters/Linda.asset +++ b/Assets/Packages/com.studio23.ss2.dialoguesystem/Samples/DialogueChoiceDemo/Resources/DialogueSystem/Characters/Linda.asset @@ -1,5 +1,35 @@ %YAML 1.1 %TAG !u! tag:unity3d.com,2011: +--- !u!114 &-4949462842663688464 +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: 2ea1a97ac8dd4be5aa1587a59f11d10d, type: 3} + m_Name: Linda_emotionless + m_EditorClassIdentifier: + Character: {fileID: 11400000} + ExpressionName: emotionless + Image: {fileID: 0} +--- !u!114 &-3062545444793565458 +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: 2ea1a97ac8dd4be5aa1587a59f11d10d, type: 3} + m_Name: Linda_Imma cut ya up + m_EditorClassIdentifier: + Character: {fileID: 11400000} + ExpressionName: Imma cut ya up + Image: {fileID: 0} --- !u!114 &11400000 MonoBehaviour: m_ObjectHideFlags: 0 @@ -12,7 +42,8 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 8c9b81d87e51f0f4197c65dca5fe6aec, type: 3} m_Name: Linda m_EditorClassIdentifier: - CharacterID: 2 CharacterName: Linda DialogueColor: {r: 0, g: 1, b: 0.089500666, a: 1} - ExpressionTable: [] + Expressions: + - {fileID: -3062545444793565458} + - {fileID: -4949462842663688464} diff --git a/Assets/Packages/com.studio23.ss2.dialoguesystem/Samples/DialogueChoiceDemo/Resources/DialogueSystem/Characters/Victor.asset b/Assets/Packages/com.studio23.ss2.dialoguesystem/Samples/DialogueChoiceDemo/Resources/DialogueSystem/Characters/Victor.asset index 7c508b2..718baaa 100644 --- a/Assets/Packages/com.studio23.ss2.dialoguesystem/Samples/DialogueChoiceDemo/Resources/DialogueSystem/Characters/Victor.asset +++ b/Assets/Packages/com.studio23.ss2.dialoguesystem/Samples/DialogueChoiceDemo/Resources/DialogueSystem/Characters/Victor.asset @@ -1,5 +1,20 @@ %YAML 1.1 %TAG !u! tag:unity3d.com,2011: +--- !u!114 &-6522073147610097109 +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: 2ea1a97ac8dd4be5aa1587a59f11d10d, type: 3} + m_Name: Victor_U DARE SHOOT ME + m_EditorClassIdentifier: + Character: {fileID: 11400000} + ExpressionName: U DARE SHOOT ME + Image: {fileID: 0} --- !u!114 &11400000 MonoBehaviour: m_ObjectHideFlags: 0 @@ -12,7 +27,7 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 8c9b81d87e51f0f4197c65dca5fe6aec, type: 3} m_Name: Victor m_EditorClassIdentifier: - CharacterID: 4 CharacterName: Victor DialogueColor: {r: 0, g: 0.4576635, b: 0.49056602, a: 1} - ExpressionTable: [] + Expressions: + - {fileID: -6522073147610097109} diff --git a/Assets/Packages/com.studio23.ss2.dialoguesystem/Samples/DialogueChoiceDemo/Resources/DialogueSystem/Graphs/Dialogue Graph 1.asset b/Assets/Packages/com.studio23.ss2.dialoguesystem/Samples/DialogueChoiceDemo/Resources/DialogueSystem/Graphs/Dialogue Graph 1.asset index e352402..6be825c 100644 --- a/Assets/Packages/com.studio23.ss2.dialoguesystem/Samples/DialogueChoiceDemo/Resources/DialogueSystem/Graphs/Dialogue Graph 1.asset +++ b/Assets/Packages/com.studio23.ss2.dialoguesystem/Samples/DialogueChoiceDemo/Resources/DialogueSystem/Graphs/Dialogue Graph 1.asset @@ -62,8 +62,9 @@ MonoBehaviour: m_FallbackState: 0 m_WaitForCompletion: 0 m_LocalVariables: [] - ID: - Reaction: + SpeakerData: + Character: {fileID: 0} + Expression: {fileID: 0} FMODEvent: Exit: {fileID: 0} Events: {fileID: 0} @@ -142,8 +143,9 @@ MonoBehaviour: m_FallbackState: 0 m_WaitForCompletion: 0 m_LocalVariables: [] - ID: - Reaction: + SpeakerData: + Character: {fileID: 0} + Expression: {fileID: 0} FMODEvent: Exit: {fileID: 0} Events: {fileID: 0} @@ -213,8 +215,9 @@ MonoBehaviour: m_FallbackState: 0 m_WaitForCompletion: 0 m_LocalVariables: [] - ID: - Reaction: + SpeakerData: + Character: {fileID: 11400000, guid: 13798c7c3f9c2f64fb676eec810993af, type: 2} + Expression: {fileID: -3062545444793565458, guid: 13798c7c3f9c2f64fb676eec810993af, type: 2} FMODEvent: Exit: {fileID: 0} Events: {fileID: 0} @@ -352,8 +355,9 @@ MonoBehaviour: m_FallbackState: 0 m_WaitForCompletion: 0 m_LocalVariables: [] - ID: - Reaction: + SpeakerData: + Character: {fileID: 0} + Expression: {fileID: 0} FMODEvent: Exit: {fileID: 0} Events: {fileID: 0} @@ -427,8 +431,9 @@ MonoBehaviour: m_FallbackState: 0 m_WaitForCompletion: 0 m_LocalVariables: [] - ID: - Reaction: + SpeakerData: + Character: {fileID: 11400000, guid: 0480fe1505a2908449d82e07dffcbca0, type: 2} + Expression: {fileID: -3622527576907991339, guid: 0480fe1505a2908449d82e07dffcbca0, type: 2} FMODEvent: Exit: {fileID: 0} Events: {fileID: 0} @@ -492,8 +497,9 @@ MonoBehaviour: m_FallbackState: 0 m_WaitForCompletion: 0 m_LocalVariables: [] - ID: - Reaction: + SpeakerData: + Character: {fileID: 0} + Expression: {fileID: 0} FMODEvent: Exit: {fileID: 0} Events: {fileID: 0} @@ -560,8 +566,9 @@ MonoBehaviour: m_FallbackState: 0 m_WaitForCompletion: 0 m_LocalVariables: [] - ID: - Reaction: + SpeakerData: + Character: {fileID: 0} + Expression: {fileID: 0} FMODEvent: Exit: {fileID: 0} Events: {fileID: 0} @@ -618,8 +625,9 @@ MonoBehaviour: m_FallbackState: 0 m_WaitForCompletion: 0 m_LocalVariables: [] - ID: - Reaction: + SpeakerData: + Character: {fileID: 0} + Expression: {fileID: 0} FMODEvent: Exit: {fileID: 0} Events: {fileID: 0} @@ -777,8 +785,9 @@ MonoBehaviour: m_FallbackState: 0 m_WaitForCompletion: 0 m_LocalVariables: [] - ID: - Reaction: + SpeakerData: + Character: {fileID: 0} + Expression: {fileID: 0} FMODEvent: Exit: {fileID: 0} Events: {fileID: 0} @@ -833,8 +842,9 @@ MonoBehaviour: m_FallbackState: 0 m_WaitForCompletion: 0 m_LocalVariables: [] - ID: - Reaction: + SpeakerData: + Character: {fileID: 0} + Expression: {fileID: 0} FMODEvent: Exit: {fileID: 0} Events: {fileID: 0} @@ -900,8 +910,9 @@ MonoBehaviour: m_FallbackState: 0 m_WaitForCompletion: 0 m_LocalVariables: [] - ID: - Reaction: + SpeakerData: + Character: {fileID: 11400000, guid: 3ecb18f9a8ab9554394b051ec2918aa1, type: 2} + Expression: {fileID: -6522073147610097109, guid: 3ecb18f9a8ab9554394b051ec2918aa1, type: 2} FMODEvent: Exit: {fileID: 0} Events: {fileID: 0} @@ -971,8 +982,9 @@ MonoBehaviour: m_FallbackState: 0 m_WaitForCompletion: 0 m_LocalVariables: [] - ID: - Reaction: + SpeakerData: + Character: {fileID: 0} + Expression: {fileID: 0} FMODEvent: Exit: {fileID: 0} Events: {fileID: 0} @@ -1037,13 +1049,14 @@ MonoBehaviour: m_TableReference: m_TableCollectionName: GUID:2fefaa175576a0e48bf5b28cb5260137 m_TableEntryReference: - m_KeyId: 819397570560 + m_KeyId: 21712402020478976 m_Key: m_FallbackState: 0 m_WaitForCompletion: 0 m_LocalVariables: [] - ID: - Reaction: + SpeakerData: + Character: {fileID: 0} + Expression: {fileID: 0} FMODEvent: Exit: {fileID: 0} Events: {fileID: 0} @@ -1114,8 +1127,9 @@ MonoBehaviour: m_FallbackState: 0 m_WaitForCompletion: 0 m_LocalVariables: [] - ID: - Reaction: + SpeakerData: + Character: {fileID: 0} + Expression: {fileID: 0} FMODEvent: Exit: {fileID: 0} Events: {fileID: 0} diff --git a/Assets/Packages/com.studio23.ss2.dialoguesystem/package.json b/Assets/Packages/com.studio23.ss2.dialoguesystem/package.json index 7b6f764..613e316 100644 --- a/Assets/Packages/com.studio23.ss2.dialoguesystem/package.json +++ b/Assets/Packages/com.studio23.ss2.dialoguesystem/package.json @@ -1,6 +1,6 @@ { "name": "com.studio23.ss2.dialoguesystem", - "version": "0.3.9", + "version": "0.3.10", "displayName": "Dialogue System", "description": "Dialogue system is an authoring tool for developers to integrate dialogue from scriptwriters inside unity.", "unity": "2022.3",