├── .all-contributorsrc ├── .editorconfig ├── .github ├── FUNDING.yml └── workflows │ ├── commitlint.yml │ ├── nightly-build.yml │ └── workflow.yml ├── .gitignore ├── .husky └── commit-msg ├── .nvmrc ├── .oyster.json ├── .releaserc ├── Assembly-CSharp.csproj.meta ├── Assets.meta ├── Assets ├── Examples.meta ├── Examples │ ├── BasicConversation.meta │ ├── BasicConversation │ │ ├── Actors.meta │ │ ├── Actors │ │ │ ├── ActorExample.asset │ │ │ ├── ActorExample.asset.meta │ │ │ ├── ActorPlayer.asset │ │ │ ├── ActorPlayer.asset.meta │ │ │ ├── FemalePortrait.png │ │ │ ├── FemalePortrait.png.meta │ │ │ ├── MalePortrait.png │ │ │ └── MalePortrait.png.meta │ │ ├── BasicConversation.unity │ │ ├── BasicConversation.unity.meta │ │ ├── BasicConversationSettings.lighting │ │ ├── BasicConversationSettings.lighting.meta │ │ ├── ExampleConversation.asset │ │ ├── ExampleConversation.asset.meta │ │ ├── ExampleNestedDialogue.asset │ │ ├── ExampleNestedDialogue.asset.meta │ │ ├── Prefabs.meta │ │ ├── Prefabs │ │ │ ├── Choice.prefab │ │ │ └── Choice.prefab.meta │ │ ├── Scripts.meta │ │ ├── Scripts │ │ │ ├── ChoiceButton.cs │ │ │ ├── ChoiceButton.cs.meta │ │ │ ├── ExampleDialoguePlayback.cs │ │ │ └── ExampleDialoguePlayback.cs.meta │ │ ├── Variables.meta │ │ ├── Variables │ │ │ ├── VariableHumansAsked.asset │ │ │ └── VariableHumansAsked.asset.meta │ │ ├── back_001.ogg │ │ └── back_001.ogg.meta │ ├── Editor.meta │ ├── Editor │ │ ├── Resources.meta │ │ └── Resources │ │ │ ├── SpellCheck.meta │ │ │ └── SpellCheck │ │ │ ├── SpellCheckSettings.asset │ │ │ └── SpellCheckSettings.asset.meta │ ├── ExampleAction.cs │ ├── ExampleAction.cs.meta │ ├── ExampleCondition.cs │ └── ExampleCondition.cs.meta ├── Resources.meta ├── Resources │ ├── BillingMode.json │ ├── BillingMode.json.meta │ ├── FluidDialogueSettings.asset │ └── FluidDialogueSettings.asset.meta ├── com.fluid.dialogue.meta └── com.fluid.dialogue │ ├── CHANGELOG.md │ ├── CHANGELOG.md.meta │ ├── Editor.meta │ ├── Editor │ ├── Attributes.meta │ ├── Attributes │ │ ├── NodeTypeAttribute.cs │ │ └── NodeTypeAttribute.cs.meta │ ├── CreateDialogueGraph.cs │ ├── CreateDialogueGraph.cs.meta │ ├── Inspectors.meta │ ├── Inspectors │ │ ├── DialogueGraphInspector.cs │ │ ├── DialogueGraphInspector.cs.meta │ │ ├── NodeDataBase.meta │ │ ├── NodeDataBase │ │ │ ├── NodeDataBaseEditor.cs │ │ │ ├── NodeDataBaseEditor.cs.meta │ │ │ ├── SortableLists.meta │ │ │ └── SortableLists │ │ │ │ ├── ActionsSortableList.cs │ │ │ │ ├── ActionsSortableList.cs.meta │ │ │ │ ├── ConditionSortableList.cs │ │ │ │ ├── ConditionSortableList.cs.meta │ │ │ │ ├── NestedDataCrud.cs │ │ │ │ ├── NestedDataCrud.cs.meta │ │ │ │ ├── ScriptableObjectListPrinter.cs │ │ │ │ ├── ScriptableObjectListPrinter.cs.meta │ │ │ │ ├── TypesToMenu.cs │ │ │ │ └── TypesToMenu.cs.meta │ │ ├── SortableListBase.cs │ │ └── SortableListBase.cs.meta │ ├── NodeEditors.meta │ ├── NodeEditors │ │ ├── Base.meta │ │ ├── Base │ │ │ ├── HeaderTextStyle.cs │ │ │ ├── HeaderTextStyle.cs.meta │ │ │ ├── NodeEditorBase.cs │ │ │ ├── NodeEditorBase.cs.meta │ │ │ ├── NodeEditorBaseConnections.cs │ │ │ ├── NodeEditorBaseConnections.cs.meta │ │ │ ├── NodeStyles.cs │ │ │ └── NodeStyles.cs.meta │ │ ├── ChoiceEditor.cs │ │ ├── ChoiceEditor.cs.meta │ │ ├── Connections.meta │ │ ├── Connections │ │ │ ├── Connection.cs │ │ │ ├── Connection.cs.meta │ │ │ ├── ConnectionCurves.cs │ │ │ ├── ConnectionCurves.cs.meta │ │ │ ├── ConnectionLinks.cs │ │ │ ├── ConnectionLinks.cs.meta │ │ │ ├── ConnectionParents.cs │ │ │ ├── ConnectionParents.cs.meta │ │ │ ├── ConnectionType.cs │ │ │ └── ConnectionType.cs.meta │ │ ├── Dialogue.meta │ │ ├── Dialogue │ │ │ ├── ChoiceCollection.cs │ │ │ ├── ChoiceCollection.cs.meta │ │ │ ├── DialogueEditor.cs │ │ │ └── DialogueEditor.cs.meta │ │ ├── HubEditor.cs │ │ ├── HubEditor.cs.meta │ │ ├── NoteEditor.cs │ │ ├── NoteEditor.cs.meta │ │ ├── PlayGraphEditor.cs │ │ ├── PlayGraphEditor.cs.meta │ │ ├── RootEditor.cs │ │ └── RootEditor.cs.meta │ ├── Resources.meta │ ├── Resources │ │ ├── dot.png │ │ └── dot.png.meta │ ├── Utilities.meta │ ├── Utilities │ │ ├── NodeAssemblies.cs │ │ ├── NodeAssemblies.cs.meta │ │ ├── NodeBoxStyle.cs │ │ ├── NodeBoxStyle.cs.meta │ │ ├── RectCleaner.cs │ │ ├── RectCleaner.cs.meta │ │ ├── ThemeUtility.cs │ │ └── ThemeUtility.cs.meta │ ├── Windows.meta │ ├── Windows │ │ ├── DialogueWindow.cs │ │ ├── DialogueWindow.cs.meta │ │ ├── DialogueWindowRestore.cs │ │ ├── DialogueWindowRestore.cs.meta │ │ ├── DialogueWindowUndoRedo.cs │ │ ├── DialogueWindowUndoRedo.cs.meta │ │ ├── FindReplaceWindow.meta │ │ ├── FindReplaceWindow │ │ │ ├── ChoiceSearchResult.cs │ │ │ ├── ChoiceSearchResult.cs.meta │ │ │ ├── DialogueSearchResult.cs │ │ │ ├── DialogueSearchResult.cs.meta │ │ │ ├── FindReplaceWindow.cs │ │ │ └── FindReplaceWindow.cs.meta │ │ ├── FluidDialogueSettings.cs │ │ ├── FluidDialogueSettings.cs.meta │ │ ├── GraphCrud.cs │ │ ├── GraphCrud.cs.meta │ │ ├── UserInput.meta │ │ └── UserInput │ │ │ ├── DelayedMenu.cs │ │ │ ├── DelayedMenu.cs.meta │ │ │ ├── InputController.cs │ │ │ ├── InputController.cs.meta │ │ │ ├── LeftClickHandler.cs │ │ │ ├── LeftClickHandler.cs.meta │ │ │ ├── NodeSelection.cs │ │ │ ├── NodeSelection.cs.meta │ │ │ ├── RightClickHandler.cs │ │ │ ├── RightClickHandler.cs.meta │ │ │ ├── ScrollManager.cs │ │ │ └── ScrollManager.cs.meta │ ├── com.fluid.dialogue.Editor.asmdef │ └── com.fluid.dialogue.Editor.asmdef.meta │ ├── LICENSE.md │ ├── LICENSE.md.meta │ ├── README.md │ ├── README.md.meta │ ├── Runtime.meta │ ├── Runtime │ ├── Actions.meta │ ├── Actions │ │ ├── ActionDataBase.cs │ │ ├── ActionDataBase.cs.meta │ │ ├── ActionRuntime.cs │ │ ├── ActionRuntime.cs.meta │ │ ├── ActionStatus.cs │ │ ├── ActionStatus.cs.meta │ │ ├── IAction.cs │ │ ├── IAction.cs.meta │ │ ├── Libraries.meta │ │ └── Libraries │ │ │ ├── Databases.meta │ │ │ ├── Databases │ │ │ ├── Globals.meta │ │ │ ├── Globals │ │ │ │ ├── Actions.meta │ │ │ │ ├── Actions │ │ │ │ │ ├── SetGlobalBool.cs │ │ │ │ │ ├── SetGlobalBool.cs.meta │ │ │ │ │ ├── SetGlobalFloat.cs │ │ │ │ │ ├── SetGlobalFloat.cs.meta │ │ │ │ │ ├── SetGlobalInt.cs │ │ │ │ │ ├── SetGlobalInt.cs.meta │ │ │ │ │ ├── SetGlobalString.cs │ │ │ │ │ └── SetGlobalString.cs.meta │ │ │ │ ├── Conditions.meta │ │ │ │ └── Conditions │ │ │ │ │ ├── IsGlobalBool.cs │ │ │ │ │ ├── IsGlobalBool.cs.meta │ │ │ │ │ ├── IsGlobalFloat.cs │ │ │ │ │ ├── IsGlobalFloat.cs.meta │ │ │ │ │ ├── IsGlobalInt.cs │ │ │ │ │ ├── IsGlobalInt.cs.meta │ │ │ │ │ ├── IsGlobalString.cs │ │ │ │ │ └── IsGlobalString.cs.meta │ │ │ ├── Locals.meta │ │ │ └── Locals │ │ │ │ ├── Actions.meta │ │ │ │ ├── Actions │ │ │ │ ├── SetLocalBool.cs │ │ │ │ ├── SetLocalBool.cs.meta │ │ │ │ ├── SetLocalFloat.cs │ │ │ │ ├── SetLocalFloat.cs.meta │ │ │ │ ├── SetLocalInt.cs │ │ │ │ ├── SetLocalInt.cs.meta │ │ │ │ ├── SetLocalString.cs │ │ │ │ ├── SetLocalString.cs.meta │ │ │ │ ├── SetLocalVariableBase.cs │ │ │ │ └── SetLocalVariableBase.cs.meta │ │ │ │ ├── Conditions.meta │ │ │ │ └── Conditions │ │ │ │ ├── IsLocalBool.meta │ │ │ │ ├── IsLocalBool │ │ │ │ ├── IsBoolBase.cs │ │ │ │ ├── IsBoolBase.cs.meta │ │ │ │ ├── IsLocalBool.cs │ │ │ │ └── IsLocalBool.cs.meta │ │ │ │ ├── IsLocalFloat.meta │ │ │ │ ├── IsLocalFloat │ │ │ │ ├── IsFloatBase.cs │ │ │ │ ├── IsFloatBase.cs.meta │ │ │ │ ├── IsLocalFloat.cs │ │ │ │ └── IsLocalFloat.cs.meta │ │ │ │ ├── IsLocalInt.meta │ │ │ │ ├── IsLocalInt │ │ │ │ ├── IsIntBase.cs │ │ │ │ ├── IsIntBase.cs.meta │ │ │ │ ├── IsLocalInt.cs │ │ │ │ └── IsLocalInt.cs.meta │ │ │ │ ├── IsLocalString.meta │ │ │ │ ├── IsLocalString │ │ │ │ ├── IsLocalString.cs │ │ │ │ ├── IsLocalString.cs.meta │ │ │ │ ├── IsStringBase.cs │ │ │ │ └── IsStringBase.cs.meta │ │ │ │ ├── NumberComparison.cs │ │ │ │ └── NumberComparison.cs.meta │ │ │ ├── GameObjects.meta │ │ │ └── GameObjects │ │ │ ├── Actions.meta │ │ │ └── Actions │ │ │ ├── ActionSetActive.cs │ │ │ ├── ActionSetActive.cs.meta │ │ │ ├── GameObjectUtilities.cs │ │ │ ├── GameObjectUtilities.cs.meta │ │ │ ├── SendMessage.meta │ │ │ └── SendMessage │ │ │ ├── ActionSendMessage.cs │ │ │ ├── ActionSendMessage.cs.meta │ │ │ ├── ActionSendMessageBool.cs │ │ │ ├── ActionSendMessageBool.cs.meta │ │ │ ├── ActionSendMessageFloat.cs │ │ │ ├── ActionSendMessageFloat.cs.meta │ │ │ ├── ActionSendMessageInt.cs │ │ │ ├── ActionSendMessageInt.cs.meta │ │ │ ├── ActionSendMessageString.cs │ │ │ └── ActionSendMessageString.cs.meta │ ├── Actors.meta │ ├── Actors │ │ ├── ActorDefinition.cs │ │ ├── ActorDefinition.cs.meta │ │ ├── IActor.cs │ │ └── IActor.cs.meta │ ├── Attributes.meta │ ├── Attributes │ │ ├── CreateMenuAttribute.cs │ │ └── CreateMenuAttribute.cs.meta │ ├── Choices.meta │ ├── Choices │ │ ├── ChoiceData.cs │ │ ├── ChoiceData.cs.meta │ │ ├── ChoiceRuntime.cs │ │ ├── ChoiceRuntime.cs.meta │ │ ├── IChoice.cs │ │ └── IChoice.cs.meta │ ├── Conditions.meta │ ├── Conditions │ │ ├── ConditionDataBase.cs │ │ ├── ConditionDataBase.cs.meta │ │ ├── ConditionRuntime.cs │ │ ├── ConditionRuntime.cs.meta │ │ ├── ICondition.cs │ │ └── ICondition.cs.meta │ ├── DialogueController.meta │ ├── DialogueController │ │ ├── DialogueController.cs │ │ └── DialogueController.cs.meta │ ├── DialoguePlayback.cs │ ├── DialoguePlayback.cs.meta │ ├── Graphs.meta │ ├── Graphs │ │ ├── DialogueGraph.cs │ │ ├── DialogueGraph.cs.meta │ │ ├── Events.meta │ │ ├── Events │ │ │ ├── DialogueEvents.cs │ │ │ ├── DialogueEvents.cs.meta │ │ │ ├── IDialogueEvents.cs │ │ │ └── IDialogueEvents.cs.meta │ │ ├── GraphRuntime.cs │ │ ├── GraphRuntime.cs.meta │ │ ├── IGraph.cs │ │ └── IGraph.cs.meta │ ├── IGetRuntime.cs │ ├── IGetRuntime.cs.meta │ ├── ISetup.cs │ ├── ISetup.cs.meta │ ├── IUniqueId.cs │ ├── IUniqueId.cs.meta │ ├── Nodes.meta │ ├── Nodes │ │ ├── ChoiceHub.meta │ │ ├── ChoiceHub │ │ │ ├── NodeChoiceHub.cs │ │ │ ├── NodeChoiceHub.cs.meta │ │ │ ├── NodeChoiceHubData.cs │ │ │ └── NodeChoiceHubData.cs.meta │ │ ├── Dialogue.meta │ │ ├── Dialogue │ │ │ ├── NodeDialogue.cs │ │ │ ├── NodeDialogue.cs.meta │ │ │ ├── NodeDialogueData.cs │ │ │ └── NodeDialogueData.cs.meta │ │ ├── Hub.meta │ │ ├── Hub │ │ │ ├── NodeHub.cs │ │ │ ├── NodeHub.cs.meta │ │ │ ├── NodeHubData.cs │ │ │ └── NodeHubData.cs.meta │ │ ├── INode.cs │ │ ├── INode.cs.meta │ │ ├── Links.meta │ │ ├── Links │ │ │ ├── NodeLink.cs │ │ │ ├── NodeLink.cs.meta │ │ │ ├── NodeLinkData.cs │ │ │ └── NodeLinkData.cs.meta │ │ ├── NodeBase.cs │ │ ├── NodeBase.cs.meta │ │ ├── NodeDataBase.cs │ │ ├── NodeDataBase.cs.meta │ │ ├── NodeDataChoiceBase.cs │ │ ├── NodeDataChoiceBase.cs.meta │ │ ├── NodeNestedDataBase.cs │ │ ├── NodeNestedDataBase.cs.meta │ │ ├── Note.meta │ │ ├── Note │ │ │ ├── NodeNoteData.cs │ │ │ └── NodeNoteData.cs.meta │ │ ├── PlayGraph.meta │ │ ├── PlayGraph │ │ │ ├── NodePlayGraph.cs │ │ │ ├── NodePlayGraph.cs.meta │ │ │ ├── NodePlayGraphData.cs │ │ │ └── NodePlayGraphData.cs.meta │ │ ├── Root.meta │ │ └── Root │ │ │ ├── NodeRoot.cs │ │ │ ├── NodeRoot.cs.meta │ │ │ ├── NodeRootData.cs │ │ │ └── NodeRootData.cs.meta │ ├── com.fluid.dialogue.asmdef │ └── com.fluid.dialogue.asmdef.meta │ ├── Tests.meta │ ├── Tests │ ├── Editor.meta │ └── Editor │ │ ├── Actions.meta │ │ ├── Actions │ │ ├── ActionRuntimeTest.cs │ │ ├── ActionRuntimeTest.cs.meta │ │ ├── Databases.meta │ │ └── Databases │ │ │ ├── ConditionLocalBoolTest.cs │ │ │ ├── ConditionLocalBoolTest.cs.meta │ │ │ ├── ConditionLocalFloatTest.cs │ │ │ ├── ConditionLocalFloatTest.cs.meta │ │ │ ├── ConditionLocalIntTest.cs │ │ │ ├── ConditionLocalIntTest.cs.meta │ │ │ ├── ConditionLocalStringTest.cs │ │ │ ├── ConditionLocalStringTest.cs.meta │ │ │ ├── SetLocalBoolTest.cs │ │ │ └── SetLocalBoolTest.cs.meta │ │ ├── Builders.meta │ │ ├── Builders │ │ ├── A.cs │ │ ├── A.cs.meta │ │ ├── ActionStubBuilder.cs │ │ ├── ActionStubBuilder.cs.meta │ │ ├── ChoiceStubBuilder.cs │ │ ├── ChoiceStubBuilder.cs.meta │ │ ├── DialogueGraphStubBuilder.cs │ │ ├── DialogueGraphStubBuilder.cs.meta │ │ ├── DialogueNodeStubBuilder.cs │ │ ├── DialogueNodeStubBuilder.cs.meta │ │ ├── NodeDataStubBuilder.cs │ │ └── NodeDataStubBuilder.cs.meta │ │ ├── ChoiceRuntimeTest.cs │ │ ├── ChoiceRuntimeTest.cs.meta │ │ ├── ConditionRuntimeTest.cs │ │ ├── ConditionRuntimeTest.cs.meta │ │ ├── DialogueControllerTest.cs │ │ ├── DialogueControllerTest.cs.meta │ │ ├── DialoguePlaybackTest.cs │ │ ├── DialoguePlaybackTest.cs.meta │ │ ├── GraphRuntimeTest.cs │ │ ├── GraphRuntimeTest.cs.meta │ │ ├── Nodes.meta │ │ ├── Nodes │ │ ├── NodeChoiceHubTest.cs │ │ ├── NodeChoiceHubTest.cs.meta │ │ ├── NodeDialogueTest.cs │ │ ├── NodeDialogueTest.cs.meta │ │ ├── NodeHubTest.cs │ │ ├── NodeHubTest.cs.meta │ │ ├── NodeLinkTest.cs │ │ ├── NodeLinkTest.cs.meta │ │ ├── NodePlayGraphTest.cs │ │ ├── NodePlayGraphTest.cs.meta │ │ ├── NodeRootTest.cs │ │ └── NodeRootTest.cs.meta │ │ ├── Utilities.meta │ │ ├── Utilities │ │ ├── RectCleanerTest.cs │ │ └── RectCleanerTest.cs.meta │ │ ├── com.fluid.dialogue.Editor.Tests.asmdef │ │ └── com.fluid.dialogue.Editor.Tests.asmdef.meta │ ├── package.json │ └── package.json.meta ├── LICENSE.md ├── Packages ├── manifest.json └── packages-lock.json ├── ProjectSettings ├── AudioManager.asset ├── ClusterInputManager.asset ├── DynamicsManager.asset ├── EditorBuildSettings.asset ├── EditorSettings.asset ├── GraphicsSettings.asset ├── InputManager.asset ├── MemorySettings.asset ├── MultiplayerManager.asset ├── NavMeshAreas.asset ├── PackageManagerSettings.asset ├── Packages │ └── com.unity.services.core │ │ └── Settings.json ├── Physics2DSettings.asset ├── PresetManager.asset ├── ProjectSettings.asset ├── ProjectVersion.txt ├── QualitySettings.asset ├── SceneTemplateSettings.json ├── TagManager.asset ├── TimeManager.asset ├── UnityConnectSettings.asset ├── VFXManager.asset ├── VersionControlSettings.asset └── XRSettings.asset ├── README.md ├── UserSettings └── EditorUserSettings.asset ├── build.js ├── com.fluid.dialogue.Editor.Tests.csproj.meta ├── com.fluid.dialogue.Editor.csproj.meta ├── com.fluid.dialogue.csproj.meta ├── commitlint.config.js ├── docs ├── example-dialogue.png └── send-message.png ├── package-lock.json ├── package.json └── publish-nightly.sh /.all-contributorsrc: -------------------------------------------------------------------------------- 1 | { 2 | "files": [ 3 | "README.md" 4 | ], 5 | "imageSize": 100, 6 | "commit": false, 7 | "commitConvention": "angular", 8 | "contributors": [ 9 | { 10 | "login": "bosaku", 11 | "name": "Richard Bryan Irwin", 12 | "avatar_url": "https://avatars.githubusercontent.com/u/2468343?v=4", 13 | "profile": "https://github.com/bosaku", 14 | "contributions": [ 15 | "doc" 16 | ] 17 | } 18 | ], 19 | "contributorsPerLine": 7, 20 | "skipCi": true, 21 | "repoType": "github", 22 | "repoHost": "https://github.com", 23 | "projectName": "fluid-dialogue", 24 | "projectOwner": "ashblue" 25 | } 26 | -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | # Editor configuration, see http://editorconfig.org 2 | root = true 3 | 4 | [*] 5 | charset = utf-8 6 | indent_style = space 7 | indent_size = 4 8 | insert_final_newline = true 9 | trim_trailing_whitespace = true 10 | 11 | [*.md] 12 | max_line_length = off 13 | trim_trailing_whitespace = false 14 | 15 | [manifest.json] 16 | indent_size = 2 17 | -------------------------------------------------------------------------------- /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | # These are supported funding model platforms 2 | 3 | github: ashblue 4 | patreon: # Replace with a single Patreon username 5 | open_collective: # Replace with a single Open Collective username 6 | ko_fi: ashblue 7 | tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel 8 | community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry 9 | liberapay: # Replace with a single Liberapay username 10 | issuehunt: # Replace with a single IssueHunt username 11 | otechie: # Replace with a single Otechie username 12 | custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2'] 13 | -------------------------------------------------------------------------------- /.github/workflows/commitlint.yml: -------------------------------------------------------------------------------- 1 | name: Lint Commit Messages 2 | on: [pull_request] 3 | 4 | jobs: 5 | commitlint: 6 | runs-on: ubuntu-latest 7 | steps: 8 | - uses: actions/checkout@v3 9 | with: 10 | fetch-depth: 0 11 | - uses: wagoid/commitlint-github-action@v5 12 | -------------------------------------------------------------------------------- /.github/workflows/nightly-build.yml: -------------------------------------------------------------------------------- 1 | name: Nightly Build 2 | permissions: 3 | contents: write 4 | on: 5 | push: 6 | branches: 7 | - develop 8 | jobs: 9 | deployNightly: 10 | runs-on: ubuntu-latest 11 | steps: 12 | - uses: actions/checkout@v3 13 | - uses: actions/setup-node@v3 14 | with: 15 | node-version: 16 16 | - run: HUSKY=0 npm ci 17 | - run: npm run build 18 | - name: Deploy nightly branch 19 | run: sh ./publish-nightly.sh 20 | env: 21 | GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} 22 | -------------------------------------------------------------------------------- /.github/workflows/workflow.yml: -------------------------------------------------------------------------------- 1 | name: Release 2 | 3 | on: 4 | push: 5 | branches: 6 | - main 7 | - master 8 | 9 | permissions: 10 | contents: read 11 | 12 | jobs: 13 | release: 14 | name: Release 15 | runs-on: ubuntu-latest 16 | permissions: 17 | contents: write 18 | issues: write 19 | pull-requests: write 20 | id-token: write 21 | steps: 22 | - name: Checkout 23 | uses: actions/checkout@v3 24 | with: 25 | fetch-depth: 0 26 | persist-credentials: false 27 | - name: Setup Node.js 28 | uses: actions/setup-node@v3 29 | with: 30 | node-version: 16 31 | - name: Install dependencies 32 | run: HUSKY=0 npm ci && npm run build 33 | - name: Verify the integrity of provenance attestations and registry signatures for installed dependencies 34 | run: npm audit signatures 35 | - name: Release 36 | env: 37 | GH_TOKEN: ${{ secrets.GH_TOKEN }} 38 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 39 | NPM_TOKEN: ${{ secrets.NPM_TOKEN }} 40 | run: npm run semantic-release -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /[Ll]ibrary/ 2 | /[Tt]emp/ 3 | /[Oo]bj/ 4 | /[Bb]uild/ 5 | /[Bb]uilds/ 6 | /[Ll]ogs/ 7 | /[Uu]ser[Ss]ettings/ 8 | CodeCoverage/ 9 | UIElementsSchema/ 10 | 11 | # MemoryCaptures can get excessive in size. 12 | # They also could contain extremely sensitive data 13 | /[Mm]emoryCaptures/ 14 | 15 | # Recordings can get excessive in size 16 | /[Rr]ecordings/ 17 | 18 | /[Aa]ssets/AssetStoreTools* 19 | 20 | # Autogenerated Jetbrains Rider plugin 21 | /[Aa]ssets/Plugins/Editor/JetBrains* 22 | 23 | # Visual Studio cache directory 24 | .vs/ 25 | 26 | # Gradle cache directory 27 | .gradle/ 28 | 29 | # Autogenerated VS/MD/Consulo solution and project files 30 | ExportedObj/ 31 | .consulo/ 32 | *.csproj 33 | *.unityproj 34 | *.sln 35 | *.suo 36 | *.tmp 37 | *.user 38 | *.userprefs 39 | *.pidb 40 | *.booproj 41 | *.svd 42 | *.pdb 43 | *.mdb 44 | *.opendb 45 | *.VC.db 46 | 47 | # Unity3D generated meta files 48 | *.pidb.meta 49 | *.pdb.meta 50 | *.mdb.meta 51 | 52 | # Unity3D Generated File On Crash Reports 53 | sysinfo.txt 54 | 55 | # Builds 56 | *.apk 57 | *.aab 58 | *.unitypackage 59 | *.app 60 | 61 | # Crashlytics generated file 62 | crashlytics-build.properties 63 | 64 | # Packed Addressables 65 | /[Aa]ssets/[Aa]ddressable[Aa]ssets[Dd]ata/*/*.bin* 66 | 67 | # Temporary auto-generated Android Assets 68 | /[Aa]ssets/[Ss]treamingAssets/aa.meta 69 | /[Aa]ssets/[Ss]treamingAssets/aa/* 70 | 71 | # Node.js 72 | node_modules 73 | dist 74 | dist.zip 75 | -------------------------------------------------------------------------------- /.husky/commit-msg: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | . "$(dirname -- "$0")/_/husky.sh" 3 | 4 | npx --no -- commitlint --edit ${1} 5 | -------------------------------------------------------------------------------- /.nvmrc: -------------------------------------------------------------------------------- 1 | 16.17.0 2 | -------------------------------------------------------------------------------- /.oyster.json: -------------------------------------------------------------------------------- 1 | { 2 | "description": "A Unity dialogue system that features an easy to use drag and drop graph. ScriptableObject driven with the ability to write custom actions and conditions to create complex dialogue workflows.", 3 | "displayName": "Fluid Dialogue", 4 | "keywords": [ 5 | "unity", 6 | "dialogue", 7 | "dialogue system" 8 | ], 9 | "oysterVersion": "3.0.2", 10 | "packageName": "com.fluid.dialogue", 11 | "packageScope": "com.fluid", 12 | "unityVersion": "2019.1", 13 | "author": { 14 | "name": "Ash Blue", 15 | "email": "ash@clevercrowgames.com", 16 | "url": "http://blueashes.com" 17 | }, 18 | "repo": { 19 | "gitUrl": "https://github.com/ashblue/fluid-dialogue", 20 | "gitUrlNoHttp": "github.com/ashblue/fluid-dialogue" 21 | } 22 | } -------------------------------------------------------------------------------- /.releaserc: -------------------------------------------------------------------------------- 1 | { 2 | "plugins": [ 3 | "@semantic-release/commit-analyzer", 4 | "@semantic-release/release-notes-generator", 5 | "@semantic-release/changelog", 6 | [ 7 | "@semantic-release/npm", 8 | { 9 | "npmPublish": false 10 | } 11 | ], 12 | [ 13 | "@semantic-release/exec", 14 | { 15 | "publishCmd": "npm run build" 16 | } 17 | ], 18 | [ 19 | "@semantic-release/npm", 20 | { 21 | "pkgRoot": "Assets/com.fluid.dialogue" 22 | } 23 | ], 24 | [ 25 | "@semantic-release/git", 26 | { 27 | "assets": [ 28 | "CHANGELOG.md", 29 | "package.json", 30 | "package-lock.json", 31 | "npm-shrinkwrap.json", 32 | "Assets/**/*" 33 | ] 34 | } 35 | ], 36 | "@semantic-release/github" 37 | ] 38 | } 39 | -------------------------------------------------------------------------------- /Assembly-CSharp.csproj.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 355be3fc20864e45a3d05a69bb20a18d 3 | timeCreated: 1580320885 -------------------------------------------------------------------------------- /Assets.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d924685ded1c4f75b95140d73bcc743f 3 | timeCreated: 1580320885 -------------------------------------------------------------------------------- /Assets/Examples.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a5ea41b806edb9046b87b18b2d7328ea 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Examples/BasicConversation.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c6758cb9132879b4fadb9003057a98a7 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Examples/BasicConversation/Actors.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 0a3bce2151ac3e5408274c0a943fa566 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Examples/BasicConversation/Actors/ActorExample.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!114 &11400000 4 | MonoBehaviour: 5 | m_ObjectHideFlags: 0 6 | m_CorrespondingSourceObject: {fileID: 0} 7 | m_PrefabInstance: {fileID: 0} 8 | m_PrefabAsset: {fileID: 0} 9 | m_GameObject: {fileID: 0} 10 | m_Enabled: 1 11 | m_EditorHideFlags: 0 12 | m_Script: {fileID: 11500000, guid: 604a6ace6b46473fa9efde504ee00623, type: 3} 13 | m_Name: ActorExample 14 | m_EditorClassIdentifier: 15 | _displayName: Mike 16 | _portrait: {fileID: 21300000, guid: 74e16bd49980e2f48b219758fbd2d462, type: 3} 17 | -------------------------------------------------------------------------------- /Assets/Examples/BasicConversation/Actors/ActorExample.asset.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: aebb863e25cae0a4495c09b6a617ecf6 3 | NativeFormatImporter: 4 | externalObjects: {} 5 | mainObjectFileID: 11400000 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Examples/BasicConversation/Actors/ActorPlayer.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!114 &11400000 4 | MonoBehaviour: 5 | m_ObjectHideFlags: 0 6 | m_CorrespondingSourceObject: {fileID: 0} 7 | m_PrefabInstance: {fileID: 0} 8 | m_PrefabAsset: {fileID: 0} 9 | m_GameObject: {fileID: 0} 10 | m_Enabled: 1 11 | m_EditorHideFlags: 0 12 | m_Script: {fileID: 11500000, guid: 604a6ace6b46473fa9efde504ee00623, type: 3} 13 | m_Name: ActorPlayer 14 | m_EditorClassIdentifier: 15 | _displayName: Player 16 | _portrait: {fileID: 21300000, guid: b70a0e76870eda6488865d4588137313, type: 3} 17 | -------------------------------------------------------------------------------- /Assets/Examples/BasicConversation/Actors/ActorPlayer.asset.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d6a8e0fd1eb801d4ca00320f6b2e9e8b 3 | NativeFormatImporter: 4 | externalObjects: {} 5 | mainObjectFileID: 11400000 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Examples/BasicConversation/Actors/FemalePortrait.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ashblue/fluid-dialogue/6b48530bb195996f15bb2702bd0765aa6f676d7c/Assets/Examples/BasicConversation/Actors/FemalePortrait.png -------------------------------------------------------------------------------- /Assets/Examples/BasicConversation/Actors/MalePortrait.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ashblue/fluid-dialogue/6b48530bb195996f15bb2702bd0765aa6f676d7c/Assets/Examples/BasicConversation/Actors/MalePortrait.png -------------------------------------------------------------------------------- /Assets/Examples/BasicConversation/BasicConversation.unity.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9fc0d4010bbf28b4594072e72b8655ab 3 | DefaultImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Assets/Examples/BasicConversation/BasicConversationSettings.lighting: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!850595691 &4890085278179872738 4 | LightingSettings: 5 | m_ObjectHideFlags: 0 6 | m_CorrespondingSourceObject: {fileID: 0} 7 | m_PrefabInstance: {fileID: 0} 8 | m_PrefabAsset: {fileID: 0} 9 | m_Name: BasicConversationSettings 10 | serializedVersion: 5 11 | m_GIWorkflowMode: 0 12 | m_EnableBakedLightmaps: 1 13 | m_EnableRealtimeLightmaps: 1 14 | m_RealtimeEnvironmentLighting: 1 15 | m_BounceScale: 1 16 | m_AlbedoBoost: 1 17 | m_IndirectOutputScale: 1 18 | m_UsingShadowmask: 1 19 | m_BakeBackend: 1 20 | m_LightmapMaxSize: 1024 21 | m_BakeResolution: 40 22 | m_Padding: 2 23 | m_LightmapCompression: 3 24 | m_AO: 0 25 | m_AOMaxDistance: 1 26 | m_CompAOExponent: 1 27 | m_CompAOExponentDirect: 0 28 | m_ExtractAO: 0 29 | m_MixedBakeMode: 2 30 | m_LightmapsBakeMode: 1 31 | m_FilterMode: 1 32 | m_LightmapParameters: {fileID: 15204, guid: 0000000000000000f000000000000000, type: 0} 33 | m_ExportTrainingData: 0 34 | m_TrainingDataDestination: TrainingData 35 | m_RealtimeResolution: 2 36 | m_ForceWhiteAlbedo: 0 37 | m_ForceUpdates: 0 38 | m_FinalGather: 0 39 | m_FinalGatherRayCount: 256 40 | m_FinalGatherFiltering: 1 41 | m_PVRCulling: 1 42 | m_PVRSampling: 1 43 | m_PVRDirectSampleCount: 32 44 | m_PVRSampleCount: 512 45 | m_PVREnvironmentSampleCount: 512 46 | m_PVREnvironmentReferencePointCount: 2048 47 | m_LightProbeSampleCountMultiplier: 4 48 | m_PVRBounces: 2 49 | m_PVRMinBounces: 2 50 | m_PVREnvironmentImportanceSampling: 0 51 | m_PVRFilteringMode: 2 52 | m_PVRDenoiserTypeDirect: 0 53 | m_PVRDenoiserTypeIndirect: 0 54 | m_PVRDenoiserTypeAO: 0 55 | m_PVRFilterTypeDirect: 0 56 | m_PVRFilterTypeIndirect: 0 57 | m_PVRFilterTypeAO: 0 58 | m_PVRFilteringGaussRadiusDirect: 1 59 | m_PVRFilteringGaussRadiusIndirect: 5 60 | m_PVRFilteringGaussRadiusAO: 2 61 | m_PVRFilteringAtrousPositionSigmaDirect: 0.5 62 | m_PVRFilteringAtrousPositionSigmaIndirect: 2 63 | m_PVRFilteringAtrousPositionSigmaAO: 1 64 | m_PVRTiledBaking: 0 65 | m_NumRaysToShootPerTexel: -1 66 | -------------------------------------------------------------------------------- /Assets/Examples/BasicConversation/BasicConversationSettings.lighting.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: fe7f6ff413dc6a24a8479d4cec01b94b 3 | NativeFormatImporter: 4 | externalObjects: {} 5 | mainObjectFileID: 4890085278179872738 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Examples/BasicConversation/ExampleConversation.asset.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9ee08f7122b445246ba6e627bb67b59a 3 | NativeFormatImporter: 4 | externalObjects: {} 5 | mainObjectFileID: 11400000 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Examples/BasicConversation/ExampleNestedDialogue.asset.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3bc587ffa3a101e4591aa09b8280183c 3 | NativeFormatImporter: 4 | externalObjects: {} 5 | mainObjectFileID: 11400000 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Examples/BasicConversation/Prefabs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 02935e0f305a86241960c1e2862630d0 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Examples/BasicConversation/Prefabs/Choice.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c852efefa68b94fccb5a2f140a3d458e 3 | PrefabImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Assets/Examples/BasicConversation/Scripts.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 7dac89d7569e81941affe6416733829e 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Examples/BasicConversation/Scripts/ChoiceButton.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using UnityEngine.Events; 3 | using UnityEngine.UI; 4 | 5 | namespace CleverCrow.Fluid.Dialogues.Examples { 6 | public class ChoiceButton : MonoBehaviour { 7 | public Text title; 8 | public Button button; 9 | public UnityEvent clickEvent = new ActivateChoiceIndexEvent(); 10 | 11 | private class ActivateChoiceIndexEvent : UnityEvent { 12 | } 13 | 14 | private void Awake () { 15 | button.onClick.AddListener(() => { 16 | clickEvent.Invoke(transform.GetSiblingIndex()); 17 | }); 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /Assets/Examples/BasicConversation/Scripts/ChoiceButton.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e7fdfc8d59fa41b5b8732d860ee16dd2 3 | timeCreated: 1565757319 -------------------------------------------------------------------------------- /Assets/Examples/BasicConversation/Scripts/ExampleDialoguePlayback.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 0b9c0e8c891570d448c0cbb669b4b8d1 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Examples/BasicConversation/Variables.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c616017930d24ef468a4c92bc8754e99 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Examples/BasicConversation/Variables/VariableHumansAsked.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!114 &11400000 4 | MonoBehaviour: 5 | m_ObjectHideFlags: 0 6 | m_CorrespondingSourceObject: {fileID: 0} 7 | m_PrefabInstance: {fileID: 0} 8 | m_PrefabAsset: {fileID: 0} 9 | m_GameObject: {fileID: 0} 10 | m_Enabled: 1 11 | m_EditorHideFlags: 0 12 | m_Script: {fileID: 11500000, guid: eac2c05eace174dfbbc0454793ac4e1b, type: 3} 13 | m_Name: VariableHumansAsked 14 | m_EditorClassIdentifier: 15 | key: humansAsked 16 | defaultValue: 0 17 | -------------------------------------------------------------------------------- /Assets/Examples/BasicConversation/Variables/VariableHumansAsked.asset.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 1906dabbacd5b15429089da6c10fd23d 3 | NativeFormatImporter: 4 | externalObjects: {} 5 | mainObjectFileID: 11400000 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Examples/BasicConversation/back_001.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ashblue/fluid-dialogue/6b48530bb195996f15bb2702bd0765aa6f676d7c/Assets/Examples/BasicConversation/back_001.ogg -------------------------------------------------------------------------------- /Assets/Examples/BasicConversation/back_001.ogg.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 68d5592cda1d5bd429da0481390f1a6a 3 | AudioImporter: 4 | externalObjects: {} 5 | serializedVersion: 6 6 | defaultSettings: 7 | loadType: 0 8 | sampleRateSetting: 0 9 | sampleRateOverride: 44100 10 | compressionFormat: 1 11 | quality: 1 12 | conversionMode: 0 13 | platformSettingOverrides: {} 14 | forceToMono: 0 15 | normalize: 1 16 | preloadAudioData: 1 17 | loadInBackground: 0 18 | ambisonic: 0 19 | 3D: 1 20 | userData: 21 | assetBundleName: 22 | assetBundleVariant: 23 | -------------------------------------------------------------------------------- /Assets/Examples/Editor.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: be9f12ff93eba414ea6cdc35f845deea 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Examples/Editor/Resources.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f4597a3e8f840d5428b3c0438e987ab8 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Examples/Editor/Resources/SpellCheck.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 1002ea78308279b40a0e4c2b1f2a1d1d 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Examples/Editor/Resources/SpellCheck/SpellCheckSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!114 &11400000 4 | MonoBehaviour: 5 | m_ObjectHideFlags: 0 6 | m_CorrespondingSourceObject: {fileID: 0} 7 | m_PrefabInstance: {fileID: 0} 8 | m_PrefabAsset: {fileID: 0} 9 | m_GameObject: {fileID: 0} 10 | m_Enabled: 1 11 | m_EditorHideFlags: 0 12 | m_Script: {fileID: 11500000, guid: 542cda9a3e7349ac9c415ba5fc5fdcc3, type: 3} 13 | m_Name: SpellCheckSettings 14 | m_EditorClassIdentifier: 15 | _extraWords: [] 16 | -------------------------------------------------------------------------------- /Assets/Examples/Editor/Resources/SpellCheck/SpellCheckSettings.asset.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3ba650572e50d5a44bf16d5a867738c1 3 | NativeFormatImporter: 4 | externalObjects: {} 5 | mainObjectFileID: 0 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Examples/ExampleAction.cs: -------------------------------------------------------------------------------- 1 | using CleverCrow.Fluid.Dialogues.Actions; 2 | using UnityEngine; 3 | 4 | namespace CleverCrow.Fluid.Dialogues.Examples { 5 | [CreateMenu("Example/Action")] 6 | public class ExampleAction : ActionDataBase { 7 | [SerializeField] 8 | private string _text = null; 9 | 10 | public override void OnStart () { 11 | Debug.Log(_text); 12 | } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /Assets/Examples/ExampleAction.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 949d12ec87ffe584496e1a35ca4c038f 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Examples/ExampleCondition.cs: -------------------------------------------------------------------------------- 1 | using CleverCrow.Fluid.Dialogues.Conditions; 2 | using CleverCrow.Fluid.Dialogues.Nodes; 3 | using UnityEngine; 4 | 5 | namespace CleverCrow.Fluid.Dialogues.Examples { 6 | [CreateMenu("Example/Condition")] 7 | public class ExampleCondition : ConditionDataBase { 8 | [SerializeField] 9 | private bool _isValid = false; 10 | 11 | public override bool OnGetIsValid (INode parent) { 12 | Debug.Log($"Example Condition: Returned {_isValid} for node {parent.UniqueId}"); 13 | return _isValid; 14 | } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /Assets/Examples/ExampleCondition.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 6a5190ddeaf44213841a394ed935ab6b 3 | timeCreated: 1577905000 -------------------------------------------------------------------------------- /Assets/Resources.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9e85984fafcd58445aae84b64d27e6e4 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Resources/BillingMode.json: -------------------------------------------------------------------------------- 1 | {"androidStore":"GooglePlay"} -------------------------------------------------------------------------------- /Assets/Resources/BillingMode.json.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 7a389415393360449994a6b730fdc516 3 | TextScriptImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Assets/Resources/FluidDialogueSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!114 &11400000 4 | MonoBehaviour: 5 | m_ObjectHideFlags: 0 6 | m_CorrespondingSourceObject: {fileID: 0} 7 | m_PrefabInstance: {fileID: 0} 8 | m_PrefabAsset: {fileID: 0} 9 | m_GameObject: {fileID: 0} 10 | m_Enabled: 1 11 | m_EditorHideFlags: 0 12 | m_Script: {fileID: 11500000, guid: 121992c1b53540e89de5d3c98729688d, type: 3} 13 | m_Name: FluidDialogueSettings 14 | m_EditorClassIdentifier: 15 | _hideNestedNodeData: 1 16 | -------------------------------------------------------------------------------- /Assets/Resources/FluidDialogueSettings.asset.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 15e1d56ba5e99024b84859da0eeb221c 3 | NativeFormatImporter: 4 | externalObjects: {} 5 | mainObjectFileID: 11400000 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/com.fluid.dialogue.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 34dab15d7b573e64db233890e584b749 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/com.fluid.dialogue/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | Replaced when project is built from commit logs via Semantic Release. 2 | -------------------------------------------------------------------------------- /Assets/com.fluid.dialogue/CHANGELOG.md.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 2be8f96e3c5f3ce468af0cb713b8670f 3 | TextScriptImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Assets/com.fluid.dialogue/Editor.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a5c293c0bd37dd747860a5065cf16604 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/com.fluid.dialogue/Editor/Attributes.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 74ec989aa1684dcc941fa8506688f9af 3 | timeCreated: 1563140889 -------------------------------------------------------------------------------- /Assets/com.fluid.dialogue/Editor/Attributes/NodeTypeAttribute.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace CleverCrow.Fluid.Dialogues.Editors { 4 | public class NodeTypeAttribute : Attribute { 5 | public Type Type { get; } 6 | 7 | public NodeTypeAttribute (Type type) { 8 | Type = type; 9 | } 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /Assets/com.fluid.dialogue/Editor/Attributes/NodeTypeAttribute.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a2ec9dd0c81340f591d47b55ab8bb33a 3 | timeCreated: 1563140911 -------------------------------------------------------------------------------- /Assets/com.fluid.dialogue/Editor/CreateDialogueGraph.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 96604ad06ddfa3b4bb0b2895017959b0 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/com.fluid.dialogue/Editor/Inspectors.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 8762dbb8595a43d3a76d7b85ca85d743 3 | timeCreated: 1563139571 -------------------------------------------------------------------------------- /Assets/com.fluid.dialogue/Editor/Inspectors/DialogueGraphInspector.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 85289aea42df4ca7abab7037af86352e 3 | timeCreated: 1563139583 -------------------------------------------------------------------------------- /Assets/com.fluid.dialogue/Editor/Inspectors/NodeDataBase.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3045c912a16b4adab33c18daae5a55cf 3 | timeCreated: 1564456282 -------------------------------------------------------------------------------- /Assets/com.fluid.dialogue/Editor/Inspectors/NodeDataBase/NodeDataBaseEditor.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 1121105b04294b839ec9ae7f562d00fe 3 | timeCreated: 1564456302 -------------------------------------------------------------------------------- /Assets/com.fluid.dialogue/Editor/Inspectors/NodeDataBase/SortableLists.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 112cba4c829b4c169054e9f979f979b6 3 | timeCreated: 1564888045 -------------------------------------------------------------------------------- /Assets/com.fluid.dialogue/Editor/Inspectors/NodeDataBase/SortableLists/ActionsSortableList.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using CleverCrow.Fluid.Dialogues.Actions; 3 | using CleverCrow.Fluid.Dialogues.Nodes; 4 | using UnityEditor; 5 | 6 | namespace CleverCrow.Fluid.Dialogues.Editors.Inspectors { 7 | public class ActionsSortableList : SortableListBase { 8 | private static TypesToMenu _actionTypes; 9 | 10 | private readonly ScriptableObjectListPrinter _soPrinter; 11 | private readonly NestedDataCrud _actionCrud; 12 | 13 | private static TypesToMenu ActionTypes => 14 | _actionTypes ??= new TypesToMenu(); 15 | 16 | public ActionsSortableList (Editor editor, string property, NodeDataBase node, List actions) 17 | : base(editor, property) { 18 | _soPrinter = new ScriptableObjectListPrinter(editor.serializedObject.FindProperty(property)); 19 | _actionCrud = new NestedDataCrud(node, actions, ActionTypes); 20 | 21 | _list.drawElementCallback = _soPrinter.DrawScriptableObject; 22 | _list.elementHeightCallback = _soPrinter.GetHeight; 23 | 24 | _list.onAddDropdownCallback = _actionCrud.ShowMenu; 25 | _list.onRemoveCallback = _actionCrud.DeleteItem; 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /Assets/com.fluid.dialogue/Editor/Inspectors/NodeDataBase/SortableLists/ActionsSortableList.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 6c2c72e02a61402d94ebc17e0a9a6dd8 3 | timeCreated: 1564533764 -------------------------------------------------------------------------------- /Assets/com.fluid.dialogue/Editor/Inspectors/NodeDataBase/SortableLists/ConditionSortableList.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using CleverCrow.Fluid.Dialogues.Conditions; 3 | using CleverCrow.Fluid.Dialogues.Nodes; 4 | using UnityEditor; 5 | 6 | namespace CleverCrow.Fluid.Dialogues.Editors.Inspectors { 7 | public class ConditionSortableList : SortableListBase { 8 | private static TypesToMenu _conditionTypes; 9 | 10 | private ScriptableObjectListPrinter _soPrinter; 11 | private readonly NestedDataCrud _conditionCrud; 12 | 13 | private static TypesToMenu ConditionTypes => 14 | _conditionTypes ??= new TypesToMenu(); 15 | 16 | public ConditionSortableList (Editor editor, string property, NodeDataBase node, List conditions) 17 | : base(editor, property) { 18 | _soPrinter = new ScriptableObjectListPrinter(editor.serializedObject.FindProperty(property)); 19 | _conditionCrud = new NestedDataCrud(node, conditions, ConditionTypes); 20 | 21 | _list.drawElementCallback = _soPrinter.DrawScriptableObject; 22 | _list.elementHeightCallback = _soPrinter.GetHeight; 23 | 24 | _list.onAddDropdownCallback = _conditionCrud.ShowMenu; 25 | _list.onRemoveCallback = _conditionCrud.DeleteItem; 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /Assets/com.fluid.dialogue/Editor/Inspectors/NodeDataBase/SortableLists/ConditionSortableList.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a71b7d60f7bc467ba86208acd17151d9 3 | timeCreated: 1564949793 -------------------------------------------------------------------------------- /Assets/com.fluid.dialogue/Editor/Inspectors/NodeDataBase/SortableLists/NestedDataCrud.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 8e3efb27d8ad46ee84af7f48467af07d 3 | timeCreated: 1564888129 -------------------------------------------------------------------------------- /Assets/com.fluid.dialogue/Editor/Inspectors/NodeDataBase/SortableLists/ScriptableObjectListPrinter.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f0a891cdfbfa446b9facbe074d13ff24 3 | timeCreated: 1564876585 -------------------------------------------------------------------------------- /Assets/com.fluid.dialogue/Editor/Inspectors/NodeDataBase/SortableLists/TypesToMenu.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Reflection; 5 | using UnityEngine; 6 | 7 | namespace CleverCrow.Fluid.Dialogues.Editors.Inspectors { 8 | public class TypesToMenu { 9 | public class TypeEntry { 10 | public Type type; 11 | public string path; 12 | public int priority; 13 | } 14 | 15 | public List Lines { get; } 16 | 17 | public TypesToMenu () { 18 | Lines = GetTypeEntries(); 19 | } 20 | 21 | private static List GetTypeEntries () { 22 | var list = new List(); 23 | foreach (var assembly in AppDomain.CurrentDomain.GetAssemblies()) { 24 | foreach (var type in assembly.GetTypes()) { 25 | if (!type.IsSubclassOf(typeof(T)) || type.IsAbstract) continue; 26 | var attr = type.GetCustomAttribute(); 27 | 28 | list.Add(new TypeEntry { 29 | type = type, 30 | path = attr?.Path ?? type.FullName, 31 | priority = attr?.Priority ?? 0, 32 | }); 33 | } 34 | } 35 | 36 | return list 37 | .OrderByDescending(t => t.priority) 38 | .ToList(); 39 | } 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /Assets/com.fluid.dialogue/Editor/Inspectors/NodeDataBase/SortableLists/TypesToMenu.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 99afed6d549246e79207f811fd7c8b18 3 | timeCreated: 1564949929 -------------------------------------------------------------------------------- /Assets/com.fluid.dialogue/Editor/Inspectors/SortableListBase.cs: -------------------------------------------------------------------------------- 1 | using UnityEditor; 2 | using UnityEditorInternal; 3 | using UnityEngine; 4 | 5 | namespace CleverCrow.Fluid.Dialogues.Editors.Inspectors { 6 | public class SortableListBase { 7 | protected ReorderableList _list; 8 | bool _skipFrame; 9 | 10 | public SortableListBase (Editor editor, string property) { 11 | if (editor == null) { 12 | Debug.LogError("Editor cannot be null"); 13 | return; 14 | } 15 | 16 | var prop = editor.serializedObject.FindProperty(property); 17 | if (prop == null) { 18 | Debug.LogErrorFormat("Could not find property {0}", property); 19 | return; 20 | } 21 | 22 | _list = new ReorderableList( 23 | editor.serializedObject, 24 | prop, 25 | true, true, true, true); 26 | 27 | var title = prop.displayName; 28 | _list.drawHeaderCallback = rect => { 29 | EditorGUI.LabelField(rect, title); 30 | }; 31 | } 32 | 33 | public void Update () { 34 | if (_list != null) _list.DoLayoutList(); 35 | } 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /Assets/com.fluid.dialogue/Editor/Inspectors/SortableListBase.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 23320fdf699a4338a6e0855458753dbb 3 | timeCreated: 1564455524 -------------------------------------------------------------------------------- /Assets/com.fluid.dialogue/Editor/NodeEditors.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d6ac8d70d26b4f02916887d315e5867b 3 | timeCreated: 1563140724 -------------------------------------------------------------------------------- /Assets/com.fluid.dialogue/Editor/NodeEditors/Base.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b14c477a269346e386c010bde42e4948 3 | timeCreated: 1564081784 -------------------------------------------------------------------------------- /Assets/com.fluid.dialogue/Editor/NodeEditors/Base/HeaderTextStyle.cs: -------------------------------------------------------------------------------- 1 | using UnityEditor; 2 | using UnityEngine; 3 | 4 | namespace CleverCrow.Fluid.Dialogues.Editors { 5 | public class HeaderTextStyle { 6 | private GUIStyle _style; 7 | private bool _init; 8 | 9 | public GUIStyle Style { 10 | get { 11 | if (!_init && EditorStyles.centeredGreyMiniLabel != null) { 12 | _init = true; 13 | _style = EditorStyles.centeredGreyMiniLabel; 14 | _style.normal.textColor = ThemeUtility.IsDarkTheme ? Color.white : Color.black; 15 | } else if (_style == null) { 16 | _style = new GUIStyle(); 17 | } 18 | 19 | return _style; 20 | } 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /Assets/com.fluid.dialogue/Editor/NodeEditors/Base/HeaderTextStyle.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b9615de9e263481c8101a67deb4cce6e 3 | timeCreated: 1563396429 -------------------------------------------------------------------------------- /Assets/com.fluid.dialogue/Editor/NodeEditors/Base/NodeEditorBase.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 6ef41c03dce84871ad66a4ed229a9272 3 | timeCreated: 1563148759 -------------------------------------------------------------------------------- /Assets/com.fluid.dialogue/Editor/NodeEditors/Base/NodeEditorBaseConnections.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 7612f7736e0646fc8c77f80704c1a8e4 3 | timeCreated: 1564082574 -------------------------------------------------------------------------------- /Assets/com.fluid.dialogue/Editor/NodeEditors/Base/NodeStyles.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | 3 | namespace CleverCrow.Fluid.Dialogues.Editors.NodeDisplays { 4 | public class NodeStyles { 5 | public NodeBoxStyle ContentStyle { get; } 6 | public NodeBoxStyle HeaderStyle { get; } 7 | public NodeBoxStyle ContainerHighlightStyle { get; } 8 | public HeaderTextStyle HeaderTextStyle { get; } 9 | public Color BodyColor { get; } 10 | 11 | public NodeStyles (Color bodyColor) { 12 | BodyColor = bodyColor; 13 | 14 | ContentStyle = new NodeBoxStyle(BodyColor, BodyColor); 15 | var brightBodyColor = BodyColor * 1.3f; 16 | ContainerHighlightStyle = new NodeBoxStyle(Color.black, brightBodyColor); 17 | HeaderTextStyle = new HeaderTextStyle(); 18 | 19 | var headerColor = BodyColor * 1.3f; 20 | headerColor.a = 1f; 21 | HeaderStyle = new NodeBoxStyle(headerColor, headerColor); 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /Assets/com.fluid.dialogue/Editor/NodeEditors/Base/NodeStyles.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: fe933ffda0f24412bfa2f3be3ba6d611 3 | timeCreated: 1564081860 -------------------------------------------------------------------------------- /Assets/com.fluid.dialogue/Editor/NodeEditors/ChoiceEditor.cs: -------------------------------------------------------------------------------- 1 | using CleverCrow.Fluid.Dialogues.Nodes; 2 | using UnityEditor; 3 | using UnityEngine; 4 | 5 | namespace CleverCrow.Fluid.Dialogues.Editors.NodeDisplays { 6 | [NodeType(typeof(NodeChoiceHubData))] 7 | public class ChoiceEditor : NodeEditorBase { 8 | private ChoiceCollection _choices; 9 | 10 | protected override Color NodeColor { get; } = new Color(0.33f, 0.75f, 0.73f); 11 | protected override float NodeWidth { get; } = 200; 12 | 13 | protected override void OnSetup () { 14 | _choices = new ChoiceCollection(this, Data as NodeChoiceHubData, Window); 15 | In[0].IsValidLinkTargetCallback = (i) => i.IsFirst && i.Data is NodeDialogueData; 16 | } 17 | 18 | protected override void OnPrintBody (Event e) { 19 | serializedObject.Update(); 20 | 21 | _choices.Print(e); 22 | CreateChoice(); 23 | 24 | serializedObject.ApplyModifiedProperties(); 25 | } 26 | 27 | private void CreateChoice () { 28 | if (GUILayout.Button("Add Choice", EditorStyles.miniButton, GUILayout.Width(80))) { 29 | GUI.FocusControl(null); 30 | _choices.Add(); 31 | } 32 | } 33 | 34 | protected override NodeDataBase OnCreateDataCopy (NodeDataBase copy) { 35 | return _choices.GetParentDataCopy(copy as NodeDataChoiceBase); 36 | } 37 | 38 | protected override void OnDeleteCleanup () { 39 | _choices.DeleteAll(); 40 | } 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /Assets/com.fluid.dialogue/Editor/NodeEditors/ChoiceEditor.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 11c1738a686a48ae9d7b08663d621d83 3 | timeCreated: 1564348565 -------------------------------------------------------------------------------- /Assets/com.fluid.dialogue/Editor/NodeEditors/Connections.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 8a9784d49f3549d5b3f5cec4e979c270 3 | timeCreated: 1563666054 -------------------------------------------------------------------------------- /Assets/com.fluid.dialogue/Editor/NodeEditors/Connections/Connection.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d6cf4596609141088fab54d90aad4edb 3 | timeCreated: 1563662713 -------------------------------------------------------------------------------- /Assets/com.fluid.dialogue/Editor/NodeEditors/Connections/ConnectionCurves.cs: -------------------------------------------------------------------------------- 1 | using UnityEditor; 2 | using UnityEngine; 3 | 4 | namespace CleverCrow.Fluid.Dialogues.Editors.NodeDisplays { 5 | public partial class Connection { 6 | private bool _exampleCurveActive; 7 | private Vector2 _exampleCurveTarget; 8 | 9 | public void SetExampleCurve (Vector2 position) { 10 | _exampleCurveActive = true; 11 | _exampleCurveTarget = position; 12 | } 13 | 14 | public void ClearCurveExample () { 15 | _exampleCurveActive = false; 16 | } 17 | 18 | private void PaintCurve (Vector2 destination) { 19 | var curveMaxDistance = Vector2.Distance(_rect.center, destination) / 200; 20 | var curveWeight = Mathf.Lerp(0, 50, curveMaxDistance); 21 | 22 | Handles.DrawBezier( 23 | _rect.center, 24 | destination, 25 | _rect.center + Vector2.right * curveWeight, 26 | destination + Vector2.left * curveWeight, 27 | Color.cyan, 28 | null, 29 | 2f 30 | ); 31 | GUI.changed = true; 32 | } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /Assets/com.fluid.dialogue/Editor/NodeEditors/Connections/ConnectionCurves.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 840d77ce845f472abe37335f93b339ea 3 | timeCreated: 1564082914 -------------------------------------------------------------------------------- /Assets/com.fluid.dialogue/Editor/NodeEditors/Connections/ConnectionLinks.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 82ba925e84324b809672b17c79051bd3 3 | timeCreated: 1563940811 -------------------------------------------------------------------------------- /Assets/com.fluid.dialogue/Editor/NodeEditors/Connections/ConnectionParents.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | namespace CleverCrow.Fluid.Dialogues.Editors.NodeDisplays { 4 | public partial interface IConnection { 5 | void AddParent (IConnection parent); 6 | void RemoveParent (IConnection parent); 7 | } 8 | 9 | public partial class Connection { 10 | private readonly List _parents = new List(); 11 | 12 | public IReadOnlyList Parents => _parents; 13 | 14 | public void AddParent (IConnection parent) { 15 | _parents.Add(parent); 16 | } 17 | 18 | public void RemoveParent (IConnection parent) { 19 | _parents.Remove(parent); 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /Assets/com.fluid.dialogue/Editor/NodeEditors/Connections/ConnectionParents.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 8df34f07102c4a1582ff48b91c3e59e3 3 | timeCreated: 1563931560 -------------------------------------------------------------------------------- /Assets/com.fluid.dialogue/Editor/NodeEditors/Connections/ConnectionType.cs: -------------------------------------------------------------------------------- 1 | namespace CleverCrow.Fluid.Dialogues.Editors.NodeDisplays { 2 | public enum ConnectionType { 3 | In, 4 | Out, 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /Assets/com.fluid.dialogue/Editor/NodeEditors/Connections/ConnectionType.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ebce98c1aa954cfe9da799aa85c83666 3 | timeCreated: 1563734482 -------------------------------------------------------------------------------- /Assets/com.fluid.dialogue/Editor/NodeEditors/Dialogue.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d9fccf96dfb84d3581d12de9aa63345d 3 | timeCreated: 1564336506 -------------------------------------------------------------------------------- /Assets/com.fluid.dialogue/Editor/NodeEditors/Dialogue/ChoiceCollection.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 020d318af0bb4c5780138da65e71c76d 3 | timeCreated: 1564260611 -------------------------------------------------------------------------------- /Assets/com.fluid.dialogue/Editor/NodeEditors/Dialogue/DialogueEditor.cs: -------------------------------------------------------------------------------- 1 | using CleverCrow.Fluid.Dialogues.Nodes; 2 | using UnityEditor; 3 | using UnityEngine; 4 | 5 | namespace CleverCrow.Fluid.Dialogues.Editors.NodeDisplays { 6 | [NodeType(typeof(NodeDialogueData))] 7 | public class DialogueEditor : NodeEditorBase { 8 | private ChoiceCollection _choices; 9 | 10 | protected override Color NodeColor { get; } = new Color(0.28f, 0.75f, 0.34f); 11 | protected override float NodeWidth { get; } = 200; 12 | 13 | protected override void OnSetup () { 14 | _choices = new ChoiceCollection(this, Data as NodeDataChoiceBase, Window); 15 | } 16 | 17 | protected override void OnPrintBody (Event e) { 18 | serializedObject.Update(); 19 | 20 | EditorGUILayout.PropertyField(serializedObject.FindProperty("actor"), GUIContent.none); 21 | EditorGUILayout.PropertyField(serializedObject.FindProperty("dialogue"), GUIContent.none); 22 | 23 | _choices.Print(e); 24 | CreateChoice(); 25 | 26 | serializedObject.ApplyModifiedProperties(); 27 | } 28 | 29 | private void CreateChoice () { 30 | if (GUILayout.Button("Add Choice", EditorStyles.miniButton, GUILayout.Width(80))) { 31 | GUI.FocusControl(null); 32 | _choices.Add(); 33 | } 34 | } 35 | 36 | protected override NodeDataBase OnCreateDataCopy (NodeDataBase copy) { 37 | return _choices.GetParentDataCopy(copy as NodeDataChoiceBase); 38 | } 39 | 40 | protected override void OnDeleteCleanup () { 41 | _choices.DeleteAll(); 42 | } 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /Assets/com.fluid.dialogue/Editor/NodeEditors/Dialogue/DialogueEditor.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c3ca57f1b0134c7f8d6042385d23bbea 3 | timeCreated: 1563409064 -------------------------------------------------------------------------------- /Assets/com.fluid.dialogue/Editor/NodeEditors/HubEditor.cs: -------------------------------------------------------------------------------- 1 | using CleverCrow.Fluid.Dialogues.Nodes; 2 | using UnityEngine; 3 | 4 | namespace CleverCrow.Fluid.Dialogues.Editors.NodeDisplays { 5 | [NodeType(typeof(NodeHubData))] 6 | public class HubEditor : NodeEditorBase { 7 | protected override Color NodeColor { get; } = new Color(0.7f, 0.7f, 0.7f); 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /Assets/com.fluid.dialogue/Editor/NodeEditors/HubEditor.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 30027bb6c563437d9d4f24872199aa31 3 | timeCreated: 1564346231 -------------------------------------------------------------------------------- /Assets/com.fluid.dialogue/Editor/NodeEditors/NoteEditor.cs: -------------------------------------------------------------------------------- 1 | using CleverCrow.Fluid.Dialogues.Nodes; 2 | using UnityEditor; 3 | using UnityEngine; 4 | 5 | namespace CleverCrow.Fluid.Dialogues.Editors.NodeDisplays { 6 | [NodeType(typeof(NodeNoteData))] 7 | public class NoteEditor : NodeEditorBase { 8 | protected override Color NodeColor { get; } = Color.yellow; 9 | protected override float NodeWidth { get; } = 200; 10 | 11 | protected override void OnPrintBody (Event e) { 12 | serializedObject.Update(); 13 | EditorGUILayout.PropertyField(serializedObject.FindProperty("note"), GUIContent.none); 14 | serializedObject.ApplyModifiedProperties(); 15 | } 16 | 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /Assets/com.fluid.dialogue/Editor/NodeEditors/NoteEditor.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 791aabda2583449390ea07cfba17cf88 3 | timeCreated: 1713805041 -------------------------------------------------------------------------------- /Assets/com.fluid.dialogue/Editor/NodeEditors/PlayGraphEditor.cs: -------------------------------------------------------------------------------- 1 | using CleverCrow.Fluid.Dialogues.Nodes; 2 | using UnityEditor; 3 | using UnityEngine; 4 | 5 | namespace CleverCrow.Fluid.Dialogues.Editors.NodeDisplays { 6 | [NodeType(typeof(NodePlayGraphData))] 7 | public class PlayGraphEditor : NodeEditorBase { 8 | protected override Color NodeColor { get; } = new Color(0.75f, 0.52f, 0f); 9 | protected override float NodeWidth { get; } = 200; 10 | 11 | protected override void OnPrintBody (Event e) { 12 | serializedObject.Update(); 13 | EditorGUILayout.PropertyField(serializedObject.FindProperty("dialogueGraph"), GUIContent.none); 14 | serializedObject.ApplyModifiedProperties(); 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /Assets/com.fluid.dialogue/Editor/NodeEditors/PlayGraphEditor.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e0adb2e523ba4086b6e5ce244b1fc6e5 3 | timeCreated: 1580321152 -------------------------------------------------------------------------------- /Assets/com.fluid.dialogue/Editor/NodeEditors/RootEditor.cs: -------------------------------------------------------------------------------- 1 | using CleverCrow.Fluid.Dialogues.Nodes; 2 | 3 | namespace CleverCrow.Fluid.Dialogues.Editors.NodeDisplays { 4 | [NodeType(typeof(NodeRootData))] 5 | public class RootEditor : NodeEditorBase { 6 | public override bool Protected => true; 7 | protected override bool HasInConnection => false; 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /Assets/com.fluid.dialogue/Editor/NodeEditors/RootEditor.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f26d4da6d67446879a0d778cfdb1cec3 3 | timeCreated: 1563140738 -------------------------------------------------------------------------------- /Assets/com.fluid.dialogue/Editor/Resources.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 2dfa7f257974486ba4e9324ae1c3b843 3 | timeCreated: 1563666273 -------------------------------------------------------------------------------- /Assets/com.fluid.dialogue/Editor/Resources/dot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ashblue/fluid-dialogue/6b48530bb195996f15bb2702bd0765aa6f676d7c/Assets/com.fluid.dialogue/Editor/Resources/dot.png -------------------------------------------------------------------------------- /Assets/com.fluid.dialogue/Editor/Utilities.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: becf0f944ae04f689ffd75817e20131d 3 | timeCreated: 1563150449 -------------------------------------------------------------------------------- /Assets/com.fluid.dialogue/Editor/Utilities/NodeAssemblies.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 407417853fc0423185b1f94fb150beed 3 | timeCreated: 1563467022 -------------------------------------------------------------------------------- /Assets/com.fluid.dialogue/Editor/Utilities/NodeBoxStyle.cs: -------------------------------------------------------------------------------- 1 | using System.Linq; 2 | using UnityEngine; 3 | 4 | namespace CleverCrow.Fluid.Dialogues.Editors { 5 | public class NodeBoxStyle { 6 | private GUIStyle _style; 7 | private readonly Color _borderColor; 8 | private readonly Color _backgroundColor; 9 | 10 | private Texture2D _texture; 11 | 12 | public GUIStyle Style { 13 | get { 14 | // Unity hammers the texture on play then stop, rebuild if it vanishes 15 | if (_texture == null) { 16 | CreateTexture(); 17 | } 18 | 19 | if (_style == null) { 20 | _style = new GUIStyle(GUI.skin.box) { 21 | border = new RectOffset(3, 3, 2, 2), 22 | }; 23 | } 24 | 25 | if (_style.normal.background == GUI.skin.box.normal.background 26 | || _style.normal.background == null) { 27 | _style.normal.background = _texture; 28 | } 29 | 30 | return _style; 31 | } 32 | } 33 | 34 | public NodeBoxStyle (Color32 border, Color background) { 35 | _borderColor = border; 36 | _backgroundColor = background; 37 | 38 | CreateTexture(); 39 | } 40 | 41 | private void CreateTexture () { 42 | _texture = new Texture2D(19, 19, TextureFormat.ARGB32, false); 43 | _texture.filterMode = FilterMode.Point; 44 | 45 | // Create an array for border colors with semi-transparency 46 | Color[] borderColors = Enumerable.Repeat(new Color(_borderColor.r, _borderColor.g, _borderColor.b, 128), 19 * 19).ToArray(); 47 | _texture.SetPixels(borderColors); 48 | 49 | // Set the internal area to a transparent background color 50 | Color[] backgroundColors = Enumerable.Repeat(new Color(_backgroundColor.r, _backgroundColor.g, _backgroundColor.b, 0.5f), 17 * 17).ToArray(); 51 | _texture.SetPixels(1, 1, 17, 17, backgroundColors); 52 | 53 | _texture.Apply(); 54 | } 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /Assets/com.fluid.dialogue/Editor/Utilities/NodeBoxStyle.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 174fa15f88784a80adae8ec71d3b8b92 3 | timeCreated: 1563150466 -------------------------------------------------------------------------------- /Assets/com.fluid.dialogue/Editor/Utilities/RectCleaner.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | 3 | namespace CleverCrow.Fluid.Dialogues.Editors { 4 | public static class RectCleaner { 5 | public static Rect FixNegativeSize (this Rect rectOld) { 6 | var rect = new Rect(rectOld); 7 | 8 | if (rect.width < 0) { 9 | rect.x += rect.width; 10 | rect.width = Mathf.Abs(rect.width); 11 | } 12 | 13 | if (rect.height < 0) { 14 | rect.y += rect.height; 15 | rect.height = Mathf.Abs(rect.height); 16 | } 17 | 18 | return rect; 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /Assets/com.fluid.dialogue/Editor/Utilities/RectCleaner.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ed1bd38a267e44eeaac65729c75cfe81 3 | timeCreated: 1563655588 -------------------------------------------------------------------------------- /Assets/com.fluid.dialogue/Editor/Utilities/ThemeUtility.cs: -------------------------------------------------------------------------------- 1 | using UnityEditor; 2 | 3 | namespace CleverCrow.Fluid.Dialogues.Editors { 4 | public static class ThemeUtility { 5 | public static bool IsDarkTheme => EditorGUIUtility.isProSkin; 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /Assets/com.fluid.dialogue/Editor/Utilities/ThemeUtility.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 6046c9915ae2480aac0ed254866ec23f 3 | timeCreated: 1713807421 -------------------------------------------------------------------------------- /Assets/com.fluid.dialogue/Editor/Windows.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 1f75f9c15b5e4b54b01e5a8d9fd9bf84 3 | timeCreated: 1563160575 -------------------------------------------------------------------------------- /Assets/com.fluid.dialogue/Editor/Windows/DialogueWindow.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f2eeab2a823d431a9e0b8f5c1d519b93 3 | timeCreated: 1563139774 -------------------------------------------------------------------------------- /Assets/com.fluid.dialogue/Editor/Windows/DialogueWindowRestore.cs: -------------------------------------------------------------------------------- 1 | using CleverCrow.Fluid.Dialogues.Graphs; 2 | using UnityEditor; 3 | using UnityEngine; 4 | 5 | namespace CleverCrow.Fluid.Dialogues.Editors { 6 | public partial class DialogueWindow { 7 | private const string PREF_ASSET_GUID = "FluidDialogue_CurrentAsset"; 8 | 9 | private static bool HasSavedGraphId => EditorPrefs.HasKey(PREF_ASSET_GUID); 10 | 11 | private static void SaveGraphToEditor (DialogueGraph graph) { 12 | var path = AssetDatabase.GetAssetPath(graph); 13 | var guid = AssetDatabase.AssetPathToGUID(path); 14 | 15 | EditorPrefs.SetString(PREF_ASSET_GUID, guid); 16 | } 17 | 18 | private static DialogueGraph GetGraphFromEditor () { 19 | var guid = EditorPrefs.GetString(PREF_ASSET_GUID); 20 | var graphPath = AssetDatabase.GUIDToAssetPath(guid); 21 | if (graphPath == null) { 22 | EditorPrefs.DeleteKey(PREF_ASSET_GUID); 23 | return null; 24 | } 25 | 26 | return AssetDatabase.LoadAssetAtPath(graphPath); 27 | } 28 | 29 | // @NOTE Save and restore must be done outside of the Window's OnGui loop to prevent crashing layout groups 30 | [UnityEditor.Callbacks.DidReloadScripts] 31 | public static void RestoreSavedGraph () { 32 | if (!EditorPrefs.GetBool(PREF_OPEN, false)) return; 33 | if (!HasSavedGraphId) return; 34 | var saveGraph = GetGraphFromEditor(); 35 | if (saveGraph == null) return; 36 | ShowGraph(saveGraph, false); 37 | } 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /Assets/com.fluid.dialogue/Editor/Windows/DialogueWindowRestore.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b1f09aabf04242c286691bbdfd276711 3 | timeCreated: 1565563865 -------------------------------------------------------------------------------- /Assets/com.fluid.dialogue/Editor/Windows/DialogueWindowUndoRedo.cs: -------------------------------------------------------------------------------- 1 | using UnityEditor; 2 | 3 | namespace CleverCrow.Fluid.Dialogues.Editors { 4 | public partial class DialogueWindow { 5 | private const string PREF_OPEN = "FluidDialogue_WindowOpen"; 6 | 7 | private void Awake () { 8 | BindUndoRedoCallback(); 9 | EditorPrefs.SetBool(PREF_OPEN, true); 10 | RestoreSavedGraph(); 11 | } 12 | 13 | private void OnEnable () { 14 | BindUndoRedoCallback(); 15 | EditorPrefs.SetBool(PREF_OPEN, true); 16 | } 17 | 18 | private void OnDestroy () { 19 | Undo.undoRedoPerformed -= UndoDetected; 20 | EditorPrefs.SetBool(PREF_OPEN, false); 21 | } 22 | 23 | private void BindUndoRedoCallback () { 24 | Undo.undoRedoPerformed -= UndoDetected; 25 | Undo.undoRedoPerformed += UndoDetected; 26 | } 27 | 28 | private void UndoDetected () { 29 | Repaint(); 30 | } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /Assets/com.fluid.dialogue/Editor/Windows/DialogueWindowUndoRedo.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 19ea8cea0c854f7a97b2b0775892e845 3 | timeCreated: 1563466051 -------------------------------------------------------------------------------- /Assets/com.fluid.dialogue/Editor/Windows/FindReplaceWindow.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ddae811b66604919862ef0bea11a4216 3 | timeCreated: 1589337050 -------------------------------------------------------------------------------- /Assets/com.fluid.dialogue/Editor/Windows/FindReplaceWindow/ChoiceSearchResult.cs: -------------------------------------------------------------------------------- 1 | using CleverCrow.Fluid.FindAndReplace.Editors; 2 | using UnityEditor; 3 | using UnityEngine; 4 | 5 | namespace CleverCrow.Fluid.Dialogues.Editors { 6 | public class ChoiceSearchResult : IFindResult { 7 | private readonly Object _target; 8 | public string Text { get; } 9 | 10 | public ChoiceSearchResult (string text, Object target) { 11 | _target = target; 12 | Text = text; 13 | } 14 | 15 | public void Show () { 16 | Selection.activeObject = _target;; 17 | } 18 | 19 | public void Replace (int startIndex, int charactersToReplace, string replaceText) { 20 | var beginning = Text.Substring(0, startIndex); 21 | var end = Text.Substring(startIndex + charactersToReplace); 22 | var text = $"{beginning}{replaceText}{end}"; 23 | 24 | // @NOTE Mixed feels on this, seems risky targeting the prop directly 25 | var obj = new SerializedObject(_target); 26 | obj.FindProperty("text").stringValue = text; 27 | obj.ApplyModifiedProperties(); 28 | AssetDatabase.SaveAssets(); 29 | } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /Assets/com.fluid.dialogue/Editor/Windows/FindReplaceWindow/ChoiceSearchResult.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a3bc25ee8dab47d48ca2e04f90ba5a95 3 | timeCreated: 1589337932 -------------------------------------------------------------------------------- /Assets/com.fluid.dialogue/Editor/Windows/FindReplaceWindow/DialogueSearchResult.cs: -------------------------------------------------------------------------------- 1 | using CleverCrow.Fluid.FindAndReplace.Editors; 2 | using UnityEditor; 3 | using UnityEngine; 4 | 5 | namespace CleverCrow.Fluid.Dialogues.Editors { 6 | public class DialogueSearchResult : IFindResult { 7 | private readonly Object _target; 8 | public string Text { get; } 9 | 10 | public DialogueSearchResult (string text, Object target) { 11 | _target = target; 12 | Text = text; 13 | } 14 | 15 | public void Show () { 16 | Selection.activeObject = _target;; 17 | } 18 | 19 | public void Replace (int startIndex, int charactersToReplace, string replaceText) { 20 | var beginning = Text.Substring(0, startIndex); 21 | var end = Text.Substring(startIndex + charactersToReplace); 22 | var text = $"{beginning}{replaceText}{end}"; 23 | 24 | // @NOTE Mixed feels on this, seems risky targeting the dialogue prop directly 25 | var obj = new SerializedObject(_target); 26 | obj.FindProperty("dialogue").stringValue = text; 27 | obj.ApplyModifiedProperties(); 28 | AssetDatabase.SaveAssets(); 29 | } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /Assets/com.fluid.dialogue/Editor/Windows/FindReplaceWindow/DialogueSearchResult.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 999dd9864e144e5ba37ac7a0bf9b8544 3 | timeCreated: 1589337146 -------------------------------------------------------------------------------- /Assets/com.fluid.dialogue/Editor/Windows/FindReplaceWindow/FindReplaceWindow.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using CleverCrow.Fluid.Dialogues.Graphs; 4 | using CleverCrow.Fluid.FindAndReplace.Editors; 5 | using UnityEditor; 6 | 7 | namespace CleverCrow.Fluid.Dialogues.Editors { 8 | public class FindReplaceWindow : FindReplaceWindowBase { 9 | [MenuItem("Window/Fluid Dialogue/Find Replace")] 10 | public static void ShowFindReplace () { 11 | ShowWindow(); 12 | } 13 | 14 | protected override IFindResult[] GetFindResults (Func IsValid) { 15 | var results = new List(); 16 | 17 | var graphIDs = AssetDatabase.FindAssets("t:DialogueGraph"); 18 | foreach (var graphID in graphIDs) { 19 | var path = AssetDatabase.GUIDToAssetPath(graphID); 20 | var graph = AssetDatabase.LoadAssetAtPath(path); 21 | if (graph == null) continue; 22 | 23 | foreach (var node in graph.Nodes) { 24 | if (IsValid(node.Text ?? "")) { 25 | var result = new DialogueSearchResult(node.Text, node as UnityEngine.Object); 26 | results.Add(result); 27 | } 28 | 29 | foreach (var choice in node.Choices) { 30 | var result = new ChoiceSearchResult(choice.text, choice); 31 | results.Add(result); 32 | } 33 | } 34 | } 35 | 36 | return results.ToArray(); 37 | } 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /Assets/com.fluid.dialogue/Editor/Windows/FindReplaceWindow/FindReplaceWindow.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9b8209640131438399a95b5df55b9af2 3 | timeCreated: 1589253863 -------------------------------------------------------------------------------- /Assets/com.fluid.dialogue/Editor/Windows/FluidDialogueSettings.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 121992c1b53540e89de5d3c98729688d 3 | timeCreated: 1565556849 -------------------------------------------------------------------------------- /Assets/com.fluid.dialogue/Editor/Windows/GraphCrud.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e341ba6bbbe94d1f86ba083fb23ae97e 3 | timeCreated: 1564066071 -------------------------------------------------------------------------------- /Assets/com.fluid.dialogue/Editor/Windows/UserInput.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 5a56a51a6fe54a50a788f7306e9870a8 3 | timeCreated: 1563590352 -------------------------------------------------------------------------------- /Assets/com.fluid.dialogue/Editor/Windows/UserInput/DelayedMenu.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using UnityEngine; 3 | 4 | namespace CleverCrow.Fluid.Dialogues.Editors { 5 | public class DelayedMenu { 6 | public Action Display { private get; set; } 7 | 8 | public bool ShowDelayedMenu (Event e) { 9 | if (Display == null || e.type != EventType.Repaint) return false; 10 | 11 | Display.Invoke(); 12 | Display = null; 13 | return true; 14 | } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /Assets/com.fluid.dialogue/Editor/Windows/UserInput/DelayedMenu.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: fead1bb4c0444071bf0e6a94a7bc6f1d 3 | timeCreated: 1563591701 -------------------------------------------------------------------------------- /Assets/com.fluid.dialogue/Editor/Windows/UserInput/InputController.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | 3 | namespace CleverCrow.Fluid.Dialogues.Editors { 4 | public class InputController { 5 | private readonly NodeSelection _selection; 6 | private readonly LeftClickHandler _leftClick; 7 | private readonly RightClickHandler _rightClick; 8 | private readonly DelayedMenu _delayedMenu = new DelayedMenu(); 9 | 10 | public ScrollManager Scroll { get; } 11 | 12 | public InputController (DialogueWindow window) { 13 | Scroll = new ScrollManager(window, window.Graph); 14 | if (Vector2.Distance(window.Graph.scrollPosition, Vector2.one) < 2) { 15 | Scroll.SetViewToRect(window.Graph.root.rect); 16 | } 17 | 18 | 19 | _selection = new NodeSelection(window); 20 | _leftClick = new LeftClickHandler(window, _selection); 21 | _rightClick = new RightClickHandler(window, _selection, Scroll, _delayedMenu); 22 | } 23 | 24 | public void ProcessCanvasEvent (Event e) { 25 | if (_delayedMenu.ShowDelayedMenu(e)) { 26 | return; 27 | } 28 | 29 | _leftClick.Update(e); 30 | _rightClick.Update(e); 31 | } 32 | 33 | public void PaintSelection () { 34 | _selection.PaintSelection(); 35 | } 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /Assets/com.fluid.dialogue/Editor/Windows/UserInput/InputController.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 5edce5eec0914c4a8b68fac50b2b4485 3 | timeCreated: 1563160601 -------------------------------------------------------------------------------- /Assets/com.fluid.dialogue/Editor/Windows/UserInput/LeftClickHandler.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 305e746c44aa4231807b23f414310c3a 3 | timeCreated: 1563590388 -------------------------------------------------------------------------------- /Assets/com.fluid.dialogue/Editor/Windows/UserInput/NodeSelection.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Linq; 3 | using CleverCrow.Fluid.Dialogues.Editors.NodeDisplays; 4 | using UnityEditor; 5 | using UnityEngine; 6 | 7 | namespace CleverCrow.Fluid.Dialogues.Editors { 8 | public class NodeSelection { 9 | private readonly EditorWindow _window; 10 | private readonly NodeBoxStyle _selectBoxStyle = new NodeBoxStyle(Color.black, new Color(0, 0, 0, 0.5f)); 11 | 12 | public Rect area; 13 | 14 | public List Selected { get; } = new List(); 15 | 16 | public NodeSelection (EditorWindow window) { 17 | _window = window; 18 | } 19 | 20 | public void Add (NodeEditorBase node) { 21 | Selected.Add(node); 22 | node.Select(); 23 | Selection.activeObject = node.Data; 24 | } 25 | 26 | public void Add (IEnumerable selected) { 27 | foreach (var node in selected) { 28 | Selected.Add(node); 29 | node.Select(); 30 | } 31 | 32 | Selection.objects = selected.Select(n => n.Data).ToArray(); 33 | } 34 | 35 | public void Remove (NodeEditorBase node) { 36 | Selected.Remove(node); 37 | node.Deselect(); 38 | } 39 | 40 | public void PaintSelection () { 41 | if (!(area.size.magnitude > 1)) return; 42 | 43 | GUI.Box(area, GUIContent.none, _selectBoxStyle.Style); 44 | _window.Repaint(); 45 | } 46 | 47 | public void RemoveAll () { 48 | foreach (var node in Selected.ToList()) { 49 | Remove(node); 50 | } 51 | } 52 | 53 | public bool Contains (NodeEditorBase node) { 54 | return Selected.Contains(node); 55 | } 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /Assets/com.fluid.dialogue/Editor/Windows/UserInput/NodeSelection.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 1cc0c290007b49a3b85af94ef8feb30c 3 | timeCreated: 1563573526 -------------------------------------------------------------------------------- /Assets/com.fluid.dialogue/Editor/Windows/UserInput/RightClickHandler.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: cc2205c7334440729abeab9783723364 3 | timeCreated: 1563590854 -------------------------------------------------------------------------------- /Assets/com.fluid.dialogue/Editor/Windows/UserInput/ScrollManager.cs: -------------------------------------------------------------------------------- 1 | using CleverCrow.Fluid.Dialogues.Graphs; 2 | using UnityEditor; 3 | using UnityEngine; 4 | 5 | namespace CleverCrow.Fluid.Dialogues.Editors { 6 | public class ScrollManager { 7 | public const float WINDOW_SIZE = 100000; 8 | 9 | private readonly EditorWindow _window; 10 | private readonly DialogueGraph _graph; 11 | 12 | public Vector2 ScrollPos { 13 | get => _graph.scrollPosition; 14 | set => _graph.scrollPosition = value; 15 | } 16 | 17 | public Rect ScrollRect { get; private set; } 18 | 19 | public ScrollManager (EditorWindow window, DialogueGraph graph) { 20 | _graph = graph; 21 | _window = window; 22 | } 23 | 24 | public void UpdateScrollView (Rect position) { 25 | ScrollPos = GUI.BeginScrollView( 26 | new Rect(0, 0, position.width, position.height), 27 | ScrollPos, 28 | new Rect(0, 0, WINDOW_SIZE, WINDOW_SIZE)); 29 | 30 | ScrollRect = new Rect(ScrollPos, position.size); 31 | } 32 | 33 | public void SetViewToRect (Rect rect) { 34 | var offsetPosition = rect.position; 35 | offsetPosition.x += rect.width / 2 - _window.position.width / 2; 36 | offsetPosition.y += rect.height / 2 - _window.position.height / 2; 37 | 38 | ScrollPos = offsetPosition; 39 | } 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /Assets/com.fluid.dialogue/Editor/Windows/UserInput/ScrollManager.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 52fd4dc4f14144809c45966cf9db40e4 3 | timeCreated: 1563591337 -------------------------------------------------------------------------------- /Assets/com.fluid.dialogue/Editor/com.fluid.dialogue.Editor.asmdef: -------------------------------------------------------------------------------- 1 | { 2 | "name": "com.fluid.dialogue.Editor", 3 | "references": [ 4 | "com.fluid.dialogue", 5 | "com.fluid.simple-spellcheck.Editor", 6 | "com.fluid.find-and-replace.Editor" 7 | ], 8 | "includePlatforms": [ 9 | "Editor" 10 | ], 11 | "excludePlatforms": [], 12 | "allowUnsafeCode": false, 13 | "overrideReferences": false, 14 | "precompiledReferences": [], 15 | "autoReferenced": true, 16 | "defineConstraints": [], 17 | "versionDefines": [], 18 | "noEngineReferences": false 19 | } -------------------------------------------------------------------------------- /Assets/com.fluid.dialogue/Editor/com.fluid.dialogue.Editor.asmdef.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 28120fcf46ba03248910da6e1bdfbcd3 3 | AssemblyDefinitionImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Assets/com.fluid.dialogue/LICENSE.md: -------------------------------------------------------------------------------- 1 | Edit LICENSE.md in root, contents will be replaced. 2 | -------------------------------------------------------------------------------- /Assets/com.fluid.dialogue/LICENSE.md.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 6ce8dcabd2fefda4e95a72d35ddd2782 3 | TextScriptImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Assets/com.fluid.dialogue/README.md: -------------------------------------------------------------------------------- 1 | Edit README.md in root, contents will be replaced. 2 | -------------------------------------------------------------------------------- /Assets/com.fluid.dialogue/README.md.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b899e3e4a30441741b6fd6703ca2e5d7 3 | TextScriptImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Assets/com.fluid.dialogue/Runtime.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 07f395f5f5de51c4792d3e0818c221ca 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/com.fluid.dialogue/Runtime/Actions.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 4d8da7f11a4a4a1f9e0c24adfa973148 3 | timeCreated: 1560803066 -------------------------------------------------------------------------------- /Assets/com.fluid.dialogue/Runtime/Actions/ActionDataBase.cs: -------------------------------------------------------------------------------- 1 | using CleverCrow.Fluid.Dialogues.Graphs; 2 | using CleverCrow.Fluid.Dialogues.Nodes; 3 | 4 | namespace CleverCrow.Fluid.Dialogues.Actions { 5 | public abstract class ActionDataBase : NodeNestedDataBase, IActionData { 6 | public virtual void OnInit (IDialogueController dialogue) {} 7 | 8 | public virtual void OnStart () {} 9 | 10 | public virtual ActionStatus OnUpdate () { 11 | return ActionStatus.Success; 12 | } 13 | 14 | public virtual void OnExit () {} 15 | 16 | public virtual void OnReset () {} 17 | 18 | public override IAction GetRuntime (IGraph graphRuntime, IDialogueController dialogue) { 19 | return new ActionRuntime(dialogue, _uniqueId, Instantiate(this)); 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /Assets/com.fluid.dialogue/Runtime/Actions/ActionDataBase.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b3048aeb103642c988d7b75038bdfc42 3 | timeCreated: 1561053773 -------------------------------------------------------------------------------- /Assets/com.fluid.dialogue/Runtime/Actions/ActionRuntime.cs: -------------------------------------------------------------------------------- 1 | namespace CleverCrow.Fluid.Dialogues.Actions { 2 | public interface IActionData { 3 | void OnInit (IDialogueController dialogue); 4 | void OnStart (); 5 | ActionStatus OnUpdate (); 6 | void OnExit (); 7 | void OnReset (); 8 | } 9 | 10 | public class ActionRuntime : IAction { 11 | private readonly IDialogueController _dialogueController; 12 | private readonly IActionData _data; 13 | 14 | private bool _initUsed; 15 | private bool _startUsed; 16 | private bool _resetReady; 17 | private bool _active; 18 | 19 | public string UniqueId { get; } 20 | 21 | public ActionRuntime (IDialogueController dialogue, string uniqueId, IActionData data) { 22 | _data = data; 23 | _dialogueController = dialogue; 24 | UniqueId = uniqueId; 25 | } 26 | 27 | public ActionStatus Tick () { 28 | Reset(); 29 | Init(); 30 | Start(); 31 | 32 | var status = Update(); 33 | if (status == ActionStatus.Success) { 34 | Exit(); 35 | } 36 | 37 | return status; 38 | } 39 | 40 | public void End () { 41 | if (_active) Exit(); 42 | } 43 | 44 | private void Init () { 45 | if (_initUsed) return; 46 | _initUsed = true; 47 | 48 | _data.OnInit(_dialogueController); 49 | } 50 | 51 | private void Start () { 52 | if (_startUsed) return; 53 | _startUsed = true; 54 | _active = true; 55 | 56 | _data.OnStart(); 57 | } 58 | 59 | private void Exit () { 60 | _startUsed = false; 61 | _resetReady = true; 62 | _active = false; 63 | 64 | _data.OnExit(); 65 | } 66 | 67 | private ActionStatus Update () { 68 | return _data.OnUpdate(); 69 | } 70 | 71 | private void Reset () { 72 | if (!_resetReady) return; 73 | _resetReady = false; 74 | _data.OnReset(); 75 | } 76 | } 77 | } 78 | -------------------------------------------------------------------------------- /Assets/com.fluid.dialogue/Runtime/Actions/ActionRuntime.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3c4c25841aa24239b837a5fde8c2907b 3 | timeCreated: 1560977954 -------------------------------------------------------------------------------- /Assets/com.fluid.dialogue/Runtime/Actions/ActionStatus.cs: -------------------------------------------------------------------------------- 1 | namespace CleverCrow.Fluid.Dialogues.Actions { 2 | public enum ActionStatus { 3 | Success, 4 | Continue 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /Assets/com.fluid.dialogue/Runtime/Actions/ActionStatus.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 1bf680d4dea94149ad920feee4aba08a 3 | timeCreated: 1560803078 -------------------------------------------------------------------------------- /Assets/com.fluid.dialogue/Runtime/Actions/IAction.cs: -------------------------------------------------------------------------------- 1 | namespace CleverCrow.Fluid.Dialogues.Actions { 2 | public interface IAction : IUniqueId { 3 | ActionStatus Tick (); 4 | void End (); 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /Assets/com.fluid.dialogue/Runtime/Actions/IAction.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f272b570cb2c4eecb1b931969429304a 3 | timeCreated: 1560709972 -------------------------------------------------------------------------------- /Assets/com.fluid.dialogue/Runtime/Actions/Libraries.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a27cda50014f446a0a50030c73c14ee1 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/com.fluid.dialogue/Runtime/Actions/Libraries/Databases.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9d746a9419703445c89031ea3ebaeea9 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/com.fluid.dialogue/Runtime/Actions/Libraries/Databases/Globals.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: fb2b3174251248ad8844bb3b822d222b 3 | timeCreated: 1609262703 -------------------------------------------------------------------------------- /Assets/com.fluid.dialogue/Runtime/Actions/Libraries/Databases/Globals/Actions.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 35d0c1ff12134c9e9480caa16d3b893e 3 | timeCreated: 1609262790 -------------------------------------------------------------------------------- /Assets/com.fluid.dialogue/Runtime/Actions/Libraries/Databases/Globals/Actions/SetGlobalBool.cs: -------------------------------------------------------------------------------- 1 | using CleverCrow.Fluid.Databases; 2 | using UnityEngine; 3 | 4 | namespace CleverCrow.Fluid.Dialogues.Actions.Databases { 5 | [CreateMenu("Database/Globals/Set Bool")] 6 | public class SetGlobalBool : SetLocalVariableBase { 7 | [SerializeField] 8 | public KeyValueDefinitionBool _variable; 9 | 10 | protected override KeyValueDefinitionBase Variable => _variable; 11 | 12 | protected override IKeyValueData GetDatabase (IDialogueController dialogue) { 13 | return GlobalDatabaseManager.Instance.Database.Bools; 14 | } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /Assets/com.fluid.dialogue/Runtime/Actions/Libraries/Databases/Globals/Actions/SetGlobalBool.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: dc39c8b552b94c01a6ae86d4b8cce494 3 | timeCreated: 1609262759 -------------------------------------------------------------------------------- /Assets/com.fluid.dialogue/Runtime/Actions/Libraries/Databases/Globals/Actions/SetGlobalFloat.cs: -------------------------------------------------------------------------------- 1 | using CleverCrow.Fluid.Databases; 2 | using UnityEngine; 3 | 4 | namespace CleverCrow.Fluid.Dialogues.Actions.Databases { 5 | [CreateMenu("Database/Globals/Set Float")] 6 | public class SetGlobalFloat : SetLocalVariableBase { 7 | [SerializeField] 8 | public KeyValueDefinitionFloat _variable; 9 | 10 | protected override KeyValueDefinitionBase Variable => _variable; 11 | 12 | protected override IKeyValueData GetDatabase (IDialogueController dialogue) { 13 | return GlobalDatabaseManager.Instance.Database.Floats; 14 | } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /Assets/com.fluid.dialogue/Runtime/Actions/Libraries/Databases/Globals/Actions/SetGlobalFloat.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a69455b17de54650a8635283e7eaf328 3 | timeCreated: 1609262759 -------------------------------------------------------------------------------- /Assets/com.fluid.dialogue/Runtime/Actions/Libraries/Databases/Globals/Actions/SetGlobalInt.cs: -------------------------------------------------------------------------------- 1 | using CleverCrow.Fluid.Databases; 2 | using UnityEngine; 3 | 4 | namespace CleverCrow.Fluid.Dialogues.Actions.Databases { 5 | [CreateMenu("Database/Globals/Set Int")] 6 | public class SetGlobalInt : SetLocalVariableBase { 7 | [SerializeField] 8 | public KeyValueDefinitionInt _variable; 9 | 10 | protected override KeyValueDefinitionBase Variable => _variable; 11 | 12 | protected override IKeyValueData GetDatabase (IDialogueController dialogue) { 13 | return GlobalDatabaseManager.Instance.Database.Ints; 14 | } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /Assets/com.fluid.dialogue/Runtime/Actions/Libraries/Databases/Globals/Actions/SetGlobalInt.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ddc85cb2034d4fbb87ac9531677c4ce4 3 | timeCreated: 1609262759 -------------------------------------------------------------------------------- /Assets/com.fluid.dialogue/Runtime/Actions/Libraries/Databases/Globals/Actions/SetGlobalString.cs: -------------------------------------------------------------------------------- 1 | using CleverCrow.Fluid.Databases; 2 | using UnityEngine; 3 | 4 | namespace CleverCrow.Fluid.Dialogues.Actions.Databases { 5 | [CreateMenu("Database/Globals/Set String")] 6 | public class SetGlobalString : SetLocalVariableBase { 7 | [SerializeField] 8 | public KeyValueDefinitionString _variable; 9 | 10 | protected override KeyValueDefinitionBase Variable => _variable; 11 | 12 | protected override IKeyValueData GetDatabase (IDialogueController dialogue) { 13 | return GlobalDatabaseManager.Instance.Database.Strings; 14 | } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /Assets/com.fluid.dialogue/Runtime/Actions/Libraries/Databases/Globals/Actions/SetGlobalString.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 41def35ef7ec4ad7ab95a8df4a3ca85a 3 | timeCreated: 1609262759 -------------------------------------------------------------------------------- /Assets/com.fluid.dialogue/Runtime/Actions/Libraries/Databases/Globals/Conditions.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b7b6e150066c4d4b808c7b40a1ca125d 3 | timeCreated: 1609263063 -------------------------------------------------------------------------------- /Assets/com.fluid.dialogue/Runtime/Actions/Libraries/Databases/Globals/Conditions/IsGlobalBool.cs: -------------------------------------------------------------------------------- 1 | using CleverCrow.Fluid.Databases; 2 | using CleverCrow.Fluid.Dialogues.Actions.Databases; 3 | 4 | namespace CleverCrow.Fluid.Dialogues.Conditions.Databases { 5 | [CreateMenu("Database/Globals/Is Bool")] 6 | public class IsGlobalBool : IsBoolBase { 7 | protected override IKeyValueData GetBoolInstance (IDialogueController dialogue) { 8 | return GlobalDatabaseManager.Instance.Database.Bools; 9 | } 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /Assets/com.fluid.dialogue/Runtime/Actions/Libraries/Databases/Globals/Conditions/IsGlobalBool.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a21642593dc640d08d902334f670b149 3 | timeCreated: 1609263100 -------------------------------------------------------------------------------- /Assets/com.fluid.dialogue/Runtime/Actions/Libraries/Databases/Globals/Conditions/IsGlobalFloat.cs: -------------------------------------------------------------------------------- 1 | using CleverCrow.Fluid.Databases; 2 | using CleverCrow.Fluid.Dialogues.Actions.Databases; 3 | 4 | namespace CleverCrow.Fluid.Dialogues.Conditions.Databases { 5 | [CreateMenu("Database/Globals/Is Float")] 6 | public class IsGlobalFloat : IsFloatBase { 7 | protected override IKeyValueData GetFloatInstance (IDialogueController dialogue) { 8 | return GlobalDatabaseManager.Instance.Database.Floats; 9 | } 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /Assets/com.fluid.dialogue/Runtime/Actions/Libraries/Databases/Globals/Conditions/IsGlobalFloat.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 1a61e32b19da4eafab4cd1bf3f00b1d0 3 | timeCreated: 1609265273 -------------------------------------------------------------------------------- /Assets/com.fluid.dialogue/Runtime/Actions/Libraries/Databases/Globals/Conditions/IsGlobalInt.cs: -------------------------------------------------------------------------------- 1 | using CleverCrow.Fluid.Databases; 2 | using CleverCrow.Fluid.Dialogues.Actions.Databases; 3 | 4 | namespace CleverCrow.Fluid.Dialogues.Conditions.Databases { 5 | [CreateMenu("Database/Globals/Is Int")] 6 | public class IsGlobalInt : IsIntBase { 7 | protected override IKeyValueData GetIntInstance (IDialogueController dialogue) { 8 | return GlobalDatabaseManager.Instance.Database.Ints; 9 | } 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /Assets/com.fluid.dialogue/Runtime/Actions/Libraries/Databases/Globals/Conditions/IsGlobalInt.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c3b8de77378d4aab95e9a13438e66689 3 | timeCreated: 1609265223 -------------------------------------------------------------------------------- /Assets/com.fluid.dialogue/Runtime/Actions/Libraries/Databases/Globals/Conditions/IsGlobalString.cs: -------------------------------------------------------------------------------- 1 | using CleverCrow.Fluid.Databases; 2 | using CleverCrow.Fluid.Dialogues.Actions.Databases; 3 | 4 | namespace CleverCrow.Fluid.Dialogues.Conditions.Databases { 5 | [CreateMenu("Database/Globals/Is String")] 6 | public class IsGlobalString : IsStringBase { 7 | protected override IKeyValueData GetStringInstance (IDialogueController dialogue) { 8 | return GlobalDatabaseManager.Instance.Database.Strings; 9 | } 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /Assets/com.fluid.dialogue/Runtime/Actions/Libraries/Databases/Globals/Conditions/IsGlobalString.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 59c15c982b88481780c0df4b164b2119 3 | timeCreated: 1609265394 -------------------------------------------------------------------------------- /Assets/com.fluid.dialogue/Runtime/Actions/Libraries/Databases/Locals.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 1d1bf8dc036924b5bb43f2f1faafeb4f 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/com.fluid.dialogue/Runtime/Actions/Libraries/Databases/Locals/Actions.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 7b89cc8e67724869a13172db8645a12e 3 | timeCreated: 1561943496 -------------------------------------------------------------------------------- /Assets/com.fluid.dialogue/Runtime/Actions/Libraries/Databases/Locals/Actions/SetLocalBool.cs: -------------------------------------------------------------------------------- 1 | using CleverCrow.Fluid.Databases; 2 | using UnityEngine; 3 | 4 | namespace CleverCrow.Fluid.Dialogues.Actions.Databases { 5 | [CreateMenu("Database/Locals/Set Bool")] 6 | public class SetLocalBool : SetLocalVariableBase { 7 | [SerializeField] 8 | public KeyValueDefinitionBool _variable; 9 | 10 | protected override KeyValueDefinitionBase Variable => _variable; 11 | 12 | protected override IKeyValueData GetDatabase (IDialogueController dialogue) { 13 | return dialogue.LocalDatabase.Bools; 14 | } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /Assets/com.fluid.dialogue/Runtime/Actions/Libraries/Databases/Locals/Actions/SetLocalBool.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 1a708f890ba314c06a22a6ea611b7447 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/com.fluid.dialogue/Runtime/Actions/Libraries/Databases/Locals/Actions/SetLocalFloat.cs: -------------------------------------------------------------------------------- 1 | using CleverCrow.Fluid.Databases; 2 | using UnityEngine; 3 | 4 | namespace CleverCrow.Fluid.Dialogues.Actions.Databases { 5 | [CreateMenu("Database/Locals/Set Float")] 6 | public class SetLocalFloat : SetLocalVariableBase { 7 | [SerializeField] 8 | public KeyValueDefinitionFloat _variable; 9 | 10 | protected override KeyValueDefinitionBase Variable => _variable; 11 | 12 | protected override IKeyValueData GetDatabase (IDialogueController dialogue) { 13 | return dialogue.LocalDatabase.Floats; 14 | } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /Assets/com.fluid.dialogue/Runtime/Actions/Libraries/Databases/Locals/Actions/SetLocalFloat.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d546e570e5814a63b21d5b8dc536991d 3 | timeCreated: 1561943043 -------------------------------------------------------------------------------- /Assets/com.fluid.dialogue/Runtime/Actions/Libraries/Databases/Locals/Actions/SetLocalInt.cs: -------------------------------------------------------------------------------- 1 | using CleverCrow.Fluid.Databases; 2 | using UnityEngine; 3 | 4 | namespace CleverCrow.Fluid.Dialogues.Actions.Databases { 5 | [CreateMenu("Database/Locals/Set Int")] 6 | public class SetLocalInt : SetLocalVariableBase { 7 | [SerializeField] 8 | public KeyValueDefinitionInt _variable; 9 | 10 | protected override KeyValueDefinitionBase Variable => _variable; 11 | 12 | protected override IKeyValueData GetDatabase (IDialogueController dialogue) { 13 | return dialogue.LocalDatabase.Ints; 14 | } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /Assets/com.fluid.dialogue/Runtime/Actions/Libraries/Databases/Locals/Actions/SetLocalInt.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a372e8103ec14605908dc5f5d892b795 3 | timeCreated: 1561943000 -------------------------------------------------------------------------------- /Assets/com.fluid.dialogue/Runtime/Actions/Libraries/Databases/Locals/Actions/SetLocalString.cs: -------------------------------------------------------------------------------- 1 | using CleverCrow.Fluid.Databases; 2 | using UnityEngine; 3 | 4 | namespace CleverCrow.Fluid.Dialogues.Actions.Databases { 5 | [CreateMenu("Database/Locals/Set String")] 6 | public class SetLocalString : SetLocalVariableBase { 7 | [SerializeField] 8 | public KeyValueDefinitionString _variable; 9 | 10 | protected override KeyValueDefinitionBase Variable => _variable; 11 | 12 | protected override IKeyValueData GetDatabase (IDialogueController dialogue) { 13 | return dialogue.LocalDatabase.Strings; 14 | } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /Assets/com.fluid.dialogue/Runtime/Actions/Libraries/Databases/Locals/Actions/SetLocalString.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 353a61f903c6489d8a0c80aa34771bef 3 | timeCreated: 1561942453 -------------------------------------------------------------------------------- /Assets/com.fluid.dialogue/Runtime/Actions/Libraries/Databases/Locals/Actions/SetLocalVariableBase.cs: -------------------------------------------------------------------------------- 1 | using CleverCrow.Fluid.Databases; 2 | using UnityEngine; 3 | 4 | namespace CleverCrow.Fluid.Dialogues.Actions.Databases { 5 | public abstract class SetLocalVariableBase : ActionDataBase { 6 | private SetKeyValueInternal _setKeyValue; 7 | 8 | [SerializeField] 9 | public T _value; 10 | 11 | protected abstract KeyValueDefinitionBase Variable { get; } 12 | 13 | public override void OnInit (IDialogueController controller) { 14 | _setKeyValue = new SetKeyValueInternal(GetDatabase(controller)); 15 | } 16 | 17 | public override ActionStatus OnUpdate () { 18 | _setKeyValue.WriteValue(Variable.key, _value); 19 | 20 | return base.OnUpdate(); 21 | } 22 | 23 | protected abstract IKeyValueData GetDatabase (IDialogueController dialogue); 24 | } 25 | 26 | public class SetKeyValueInternal { 27 | private readonly IKeyValueData _database; 28 | 29 | public SetKeyValueInternal (IKeyValueData database) { 30 | _database = database; 31 | } 32 | 33 | public void WriteValue (string key, T value) { 34 | _database.Set(key, value); 35 | } 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /Assets/com.fluid.dialogue/Runtime/Actions/Libraries/Databases/Locals/Actions/SetLocalVariableBase.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 1d9bf3fb61224d959c0ea8e290553d64 3 | timeCreated: 1561942577 -------------------------------------------------------------------------------- /Assets/com.fluid.dialogue/Runtime/Actions/Libraries/Databases/Locals/Conditions.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 8b9d1af096494740b01e4b4c15d6c3c2 3 | timeCreated: 1561943512 -------------------------------------------------------------------------------- /Assets/com.fluid.dialogue/Runtime/Actions/Libraries/Databases/Locals/Conditions/IsLocalBool.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9ad7324121844d6191fe34899e5dc332 3 | timeCreated: 1609263218 -------------------------------------------------------------------------------- /Assets/com.fluid.dialogue/Runtime/Actions/Libraries/Databases/Locals/Conditions/IsLocalBool/IsBoolBase.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 61a8ec699cc043048888b83ea1fa8a76 3 | timeCreated: 1609263240 -------------------------------------------------------------------------------- /Assets/com.fluid.dialogue/Runtime/Actions/Libraries/Databases/Locals/Conditions/IsLocalBool/IsLocalBool.cs: -------------------------------------------------------------------------------- 1 | using CleverCrow.Fluid.Databases; 2 | 3 | namespace CleverCrow.Fluid.Dialogues.Actions.Databases { 4 | [CreateMenu("Database/Locals/Is Bool")] 5 | public class IsLocalBool : IsBoolBase { 6 | protected override IKeyValueData GetBoolInstance (IDialogueController dialogue) { 7 | return dialogue.LocalDatabase.Bools; 8 | } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /Assets/com.fluid.dialogue/Runtime/Actions/Libraries/Databases/Locals/Conditions/IsLocalBool/IsLocalBool.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 4cca882da5bb4218bd3a1b8f82560fd9 3 | timeCreated: 1561943534 -------------------------------------------------------------------------------- /Assets/com.fluid.dialogue/Runtime/Actions/Libraries/Databases/Locals/Conditions/IsLocalFloat.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c6458136a4df46e2b5f13866dfb98d96 3 | timeCreated: 1609264213 -------------------------------------------------------------------------------- /Assets/com.fluid.dialogue/Runtime/Actions/Libraries/Databases/Locals/Conditions/IsLocalFloat/IsFloatBase.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 5bb41044534a4922a63918dbdd85c24e 3 | timeCreated: 1609264264 -------------------------------------------------------------------------------- /Assets/com.fluid.dialogue/Runtime/Actions/Libraries/Databases/Locals/Conditions/IsLocalFloat/IsLocalFloat.cs: -------------------------------------------------------------------------------- 1 | using CleverCrow.Fluid.Databases; 2 | 3 | namespace CleverCrow.Fluid.Dialogues.Actions.Databases { 4 | [CreateMenu("Database/Locals/Is Float")] 5 | public class ConditionLocalFloat : IsFloatBase { 6 | protected override IKeyValueData GetFloatInstance (IDialogueController dialogue) { 7 | return dialogue.LocalDatabase.Floats; 8 | } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /Assets/com.fluid.dialogue/Runtime/Actions/Libraries/Databases/Locals/Conditions/IsLocalFloat/IsLocalFloat.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 61438de567d04bcf9aeeb56323cd6e57 3 | timeCreated: 1562039305 -------------------------------------------------------------------------------- /Assets/com.fluid.dialogue/Runtime/Actions/Libraries/Databases/Locals/Conditions/IsLocalInt.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3c4306dea8d74be3ba28a126666bf9ba 3 | timeCreated: 1609264598 -------------------------------------------------------------------------------- /Assets/com.fluid.dialogue/Runtime/Actions/Libraries/Databases/Locals/Conditions/IsLocalInt/IsIntBase.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e889ebfec1f64a338f57cd21f1858583 3 | timeCreated: 1609264645 -------------------------------------------------------------------------------- /Assets/com.fluid.dialogue/Runtime/Actions/Libraries/Databases/Locals/Conditions/IsLocalInt/IsLocalInt.cs: -------------------------------------------------------------------------------- 1 | using CleverCrow.Fluid.Databases; 2 | 3 | namespace CleverCrow.Fluid.Dialogues.Actions.Databases { 4 | [CreateMenu("Database/Locals/Is Int")] 5 | public class IsLocalInt : IsIntBase { 6 | protected override IKeyValueData GetIntInstance (IDialogueController dialogue) { 7 | return dialogue.LocalDatabase.Ints; 8 | } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /Assets/com.fluid.dialogue/Runtime/Actions/Libraries/Databases/Locals/Conditions/IsLocalInt/IsLocalInt.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 05d3e40f2c4a46ae9df2e1810d976d43 3 | timeCreated: 1562008210 -------------------------------------------------------------------------------- /Assets/com.fluid.dialogue/Runtime/Actions/Libraries/Databases/Locals/Conditions/IsLocalString.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 140d7cdb799e46509046cc08c65ae702 3 | timeCreated: 1609264944 -------------------------------------------------------------------------------- /Assets/com.fluid.dialogue/Runtime/Actions/Libraries/Databases/Locals/Conditions/IsLocalString/IsLocalString.cs: -------------------------------------------------------------------------------- 1 | using CleverCrow.Fluid.Databases; 2 | 3 | namespace CleverCrow.Fluid.Dialogues.Actions.Databases { 4 | [CreateMenu("Database/Locals/Is String")] 5 | public class IsLocalString : IsStringBase { 6 | protected override IKeyValueData GetStringInstance (IDialogueController dialogue) { 7 | return dialogue.LocalDatabase.Strings; 8 | } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /Assets/com.fluid.dialogue/Runtime/Actions/Libraries/Databases/Locals/Conditions/IsLocalString/IsLocalString.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 8a3e535472bc45ca9a406f30a8fd597c 3 | timeCreated: 1562004831 -------------------------------------------------------------------------------- /Assets/com.fluid.dialogue/Runtime/Actions/Libraries/Databases/Locals/Conditions/IsLocalString/IsStringBase.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 05b9854c79cb4a709cc82573f2fc46be 3 | timeCreated: 1609264965 -------------------------------------------------------------------------------- /Assets/com.fluid.dialogue/Runtime/Actions/Libraries/Databases/Locals/Conditions/NumberComparison.cs: -------------------------------------------------------------------------------- 1 | namespace CleverCrow.Fluid.Dialogues.Actions.Databases { 2 | public enum NumberComparison { 3 | Equal, 4 | NotEqual, 5 | GreaterThan, 6 | GreaterThanOrEqual, 7 | LessThan, 8 | LessThanOrEqual, 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /Assets/com.fluid.dialogue/Runtime/Actions/Libraries/Databases/Locals/Conditions/NumberComparison.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 59282c3df7e44108acc96fa8cc18a13b 3 | timeCreated: 1562008370 -------------------------------------------------------------------------------- /Assets/com.fluid.dialogue/Runtime/Actions/Libraries/GameObjects.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: aca6645304124d5f93183b0f41f4d32d 3 | timeCreated: 1585279213 -------------------------------------------------------------------------------- /Assets/com.fluid.dialogue/Runtime/Actions/Libraries/GameObjects/Actions.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d01904d62a344ea6aeb8f3f23c4f2e5e 3 | timeCreated: 1585279373 -------------------------------------------------------------------------------- /Assets/com.fluid.dialogue/Runtime/Actions/Libraries/GameObjects/Actions/ActionSetActive.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | 3 | namespace CleverCrow.Fluid.Dialogues.Actions.GameObjects { 4 | [CreateMenu("GameObject/Set Active")] 5 | public class ActionSetActive : ActionDataBase { 6 | [SerializeField] 7 | private string _gameObjectName; 8 | 9 | [SerializeField] 10 | private bool _setActive; 11 | 12 | public override void OnStart () { 13 | var target = GameObjectUtilities.FindGameObject(_gameObjectName); 14 | if (target == null) return; 15 | 16 | target.SetActive(_setActive); 17 | } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /Assets/com.fluid.dialogue/Runtime/Actions/Libraries/GameObjects/Actions/ActionSetActive.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: df570d683f114d44abe229f3daba4dbb 3 | timeCreated: 1585279230 -------------------------------------------------------------------------------- /Assets/com.fluid.dialogue/Runtime/Actions/Libraries/GameObjects/Actions/GameObjectUtilities.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 6e8b757d08544840bad085c69282358e 3 | timeCreated: 1713987162 -------------------------------------------------------------------------------- /Assets/com.fluid.dialogue/Runtime/Actions/Libraries/GameObjects/Actions/SendMessage.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c00b7a5f10f347e4b239b3c2c9a3fe26 3 | timeCreated: 1713986894 -------------------------------------------------------------------------------- /Assets/com.fluid.dialogue/Runtime/Actions/Libraries/GameObjects/Actions/SendMessage/ActionSendMessage.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | 3 | namespace CleverCrow.Fluid.Dialogues.Actions.GameObjects { 4 | [CreateMenu("GameObject/Send Message/Default")] 5 | public class ActionSendMessage : ActionDataBase { 6 | [SerializeField] 7 | private string _gameObjectName; 8 | 9 | [SerializeField] 10 | private string _methodName; 11 | 12 | [SerializeField] 13 | SendMessageOptions _options; 14 | 15 | public override void OnStart () { 16 | var target = GameObjectUtilities.FindGameObject(_gameObjectName); 17 | if (target == null) return; 18 | 19 | target.SendMessage(_methodName, _options); 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /Assets/com.fluid.dialogue/Runtime/Actions/Libraries/GameObjects/Actions/SendMessage/ActionSendMessage.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 6a4a5f32d02a4826a57d4ca1997744f8 3 | timeCreated: 1713986914 -------------------------------------------------------------------------------- /Assets/com.fluid.dialogue/Runtime/Actions/Libraries/GameObjects/Actions/SendMessage/ActionSendMessageBool.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | 3 | namespace CleverCrow.Fluid.Dialogues.Actions.GameObjects { 4 | [CreateMenu("GameObject/Send Message/Bool")] 5 | public class ActionSendMessageBool : ActionDataBase { 6 | [SerializeField] 7 | private string _gameObjectName; 8 | 9 | [SerializeField] 10 | private string _methodName; 11 | 12 | [SerializeField] 13 | private bool _value; 14 | 15 | [SerializeField] 16 | SendMessageOptions _options; 17 | 18 | public override void OnStart () { 19 | var target = GameObjectUtilities.FindGameObject(_gameObjectName); 20 | if (target == null) return; 21 | 22 | target.SendMessage(_methodName, _value, _options); 23 | } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /Assets/com.fluid.dialogue/Runtime/Actions/Libraries/GameObjects/Actions/SendMessage/ActionSendMessageBool.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 90924811a5ed4e2e996a1975ca0d2d5a 3 | timeCreated: 1713987645 -------------------------------------------------------------------------------- /Assets/com.fluid.dialogue/Runtime/Actions/Libraries/GameObjects/Actions/SendMessage/ActionSendMessageFloat.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | 3 | namespace CleverCrow.Fluid.Dialogues.Actions.GameObjects { 4 | [CreateMenu("GameObject/Send Message/Float")] 5 | public class ActionSendMessageFloat : ActionDataBase { 6 | [SerializeField] 7 | private string _gameObjectName; 8 | 9 | [SerializeField] 10 | private string _methodName; 11 | 12 | [SerializeField] 13 | private float _value; 14 | 15 | [SerializeField] 16 | SendMessageOptions _options; 17 | 18 | public override void OnStart () { 19 | var target = GameObjectUtilities.FindGameObject(_gameObjectName); 20 | if (target == null) return; 21 | 22 | target.SendMessage(_methodName, _value, _options); 23 | } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /Assets/com.fluid.dialogue/Runtime/Actions/Libraries/GameObjects/Actions/SendMessage/ActionSendMessageFloat.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d4a70d9e108c496095c540b29ba0e1b2 3 | timeCreated: 1713987659 -------------------------------------------------------------------------------- /Assets/com.fluid.dialogue/Runtime/Actions/Libraries/GameObjects/Actions/SendMessage/ActionSendMessageInt.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | 3 | namespace CleverCrow.Fluid.Dialogues.Actions.GameObjects { 4 | [CreateMenu("GameObject/Send Message/Int")] 5 | public class ActionSendMessageInt : ActionDataBase { 6 | [SerializeField] 7 | private string _gameObjectName; 8 | 9 | [SerializeField] 10 | private string _methodName; 11 | 12 | [SerializeField] 13 | private int _value; 14 | 15 | [SerializeField] 16 | SendMessageOptions _options; 17 | 18 | public override void OnStart () { 19 | var target = GameObjectUtilities.FindGameObject(_gameObjectName); 20 | if (target == null) return; 21 | 22 | target.SendMessage(_methodName, _value, _options); 23 | } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /Assets/com.fluid.dialogue/Runtime/Actions/Libraries/GameObjects/Actions/SendMessage/ActionSendMessageInt.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 946e9b68658d4b7ebcee2d476837a535 3 | timeCreated: 1713987458 -------------------------------------------------------------------------------- /Assets/com.fluid.dialogue/Runtime/Actions/Libraries/GameObjects/Actions/SendMessage/ActionSendMessageString.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | 3 | namespace CleverCrow.Fluid.Dialogues.Actions.GameObjects { 4 | [CreateMenu("GameObject/Send Message/String")] 5 | public class ActionSendMessageString : ActionDataBase { 6 | [SerializeField] 7 | private string _gameObjectName; 8 | 9 | [SerializeField] 10 | private string _methodName; 11 | 12 | [SerializeField] 13 | private string _value; 14 | 15 | [SerializeField] 16 | SendMessageOptions _options; 17 | 18 | public override void OnStart () { 19 | var target = GameObjectUtilities.FindGameObject(_gameObjectName); 20 | if (target == null) return; 21 | 22 | target.SendMessage(_methodName, _value, _options); 23 | } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /Assets/com.fluid.dialogue/Runtime/Actions/Libraries/GameObjects/Actions/SendMessage/ActionSendMessageString.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 41da87cb052d42618b329e4c4acb77dd 3 | timeCreated: 1713987389 -------------------------------------------------------------------------------- /Assets/com.fluid.dialogue/Runtime/Actors.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: da45f581fb4c43d2b4a32fc35af586ce 3 | timeCreated: 1561069584 -------------------------------------------------------------------------------- /Assets/com.fluid.dialogue/Runtime/Actors/ActorDefinition.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | 3 | namespace CleverCrow.Fluid.Dialogues { 4 | [CreateAssetMenu(fileName = "Actor", menuName = "Fluid/Dialogue/Actor")] 5 | public class ActorDefinition : ScriptableObject, IActor { 6 | [SerializeField] 7 | private string _displayName = null; 8 | 9 | [SerializeField] 10 | private Sprite _portrait = null; 11 | 12 | public string DisplayName => _displayName; 13 | public Sprite Portrait => _portrait; 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /Assets/com.fluid.dialogue/Runtime/Actors/ActorDefinition.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 604a6ace6b46473fa9efde504ee00623 3 | timeCreated: 1561069638 -------------------------------------------------------------------------------- /Assets/com.fluid.dialogue/Runtime/Actors/IActor.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | 3 | namespace CleverCrow.Fluid.Dialogues { 4 | public interface IActor { 5 | string DisplayName { get; } 6 | Sprite Portrait { get; } 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /Assets/com.fluid.dialogue/Runtime/Actors/IActor.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ea346bde8738471eb99c7b250071adc2 3 | timeCreated: 1560536031 -------------------------------------------------------------------------------- /Assets/com.fluid.dialogue/Runtime/Attributes.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 5b304ba21c6043ceb0b47645e4f21fdf 3 | timeCreated: 1564950285 -------------------------------------------------------------------------------- /Assets/com.fluid.dialogue/Runtime/Attributes/CreateMenuAttribute.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace CleverCrow.Fluid.Dialogues { 4 | public class CreateMenuAttribute : Attribute { 5 | public string Path { get; } 6 | public int Priority { get; } 7 | 8 | public CreateMenuAttribute (string path, int priority = 0) { 9 | Path = path; 10 | Priority = priority; 11 | } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /Assets/com.fluid.dialogue/Runtime/Attributes/CreateMenuAttribute.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 715d11b0571e4734bc61a90cc6951961 3 | timeCreated: 1564536320 -------------------------------------------------------------------------------- /Assets/com.fluid.dialogue/Runtime/Choices.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 0d54de3a27fb465bb6902c202f2277c4 3 | timeCreated: 1560975720 -------------------------------------------------------------------------------- /Assets/com.fluid.dialogue/Runtime/Choices/ChoiceData.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using CleverCrow.Fluid.Dialogues.Graphs; 5 | using CleverCrow.Fluid.Dialogues.Nodes; 6 | using UnityEngine; 7 | 8 | namespace CleverCrow.Fluid.Dialogues.Choices { 9 | public class ChoiceData : ScriptableObject, IGetRuntime, IConnectionChildCollection { 10 | public string text; 11 | 12 | [HideInInspector] 13 | public List children = new List(); 14 | 15 | [HideInInspector] 16 | [SerializeField] 17 | private string _uniqueId; 18 | 19 | public string UniqueId => _uniqueId; 20 | 21 | public IReadOnlyList Children => children; 22 | 23 | public void Setup () { 24 | name = "Choice"; 25 | _uniqueId = Guid.NewGuid().ToString(); 26 | } 27 | 28 | public IChoice GetRuntime (IGraph graphRuntime, IDialogueController dialogue) { 29 | return new ChoiceRuntime( 30 | graphRuntime, 31 | text, 32 | _uniqueId, 33 | children.ToList()); 34 | } 35 | 36 | public void AddConnectionChild (NodeDataBase child) { 37 | children.Add(child); 38 | } 39 | 40 | public void RemoveConnectionChild (NodeDataBase child) { 41 | children.Remove(child); 42 | } 43 | 44 | public void SortConnectionsByPosition () { 45 | children = children.OrderBy(i => i.rect.yMin).ToList(); 46 | } 47 | 48 | public void ClearConnectionChildren () { 49 | children.Clear(); 50 | } 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /Assets/com.fluid.dialogue/Runtime/Choices/ChoiceData.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: fbb407621a43446dac370b409a9ddc29 3 | timeCreated: 1561065282 -------------------------------------------------------------------------------- /Assets/com.fluid.dialogue/Runtime/Choices/ChoiceRuntime.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Linq; 3 | using CleverCrow.Fluid.Dialogues.Graphs; 4 | using CleverCrow.Fluid.Dialogues.Nodes; 5 | 6 | namespace CleverCrow.Fluid.Dialogues.Choices { 7 | public class ChoiceRuntime : IChoice { 8 | private readonly IGraph _runtime; 9 | private readonly List _children; 10 | private List _childrenRuntimeCache; 11 | 12 | public string UniqueId { get; } 13 | public string Text { get; } 14 | public bool IsValid => Children.Count == 0 || Children.Find(c => c.IsValid) != null; 15 | 16 | private List Children => 17 | _childrenRuntimeCache ?? 18 | (_childrenRuntimeCache = _children.Select(_runtime.GetCopy).ToList()); 19 | 20 | public ChoiceRuntime (IGraph runtime, string text, string uniqueId, List children) { 21 | _runtime = runtime; 22 | Text = text; 23 | UniqueId = uniqueId; 24 | _children = children; 25 | } 26 | 27 | public INode GetValidChildNode () { 28 | return Children.Find(c => c.IsValid); 29 | } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /Assets/com.fluid.dialogue/Runtime/Choices/ChoiceRuntime.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 0ab3b0fcbe0a46f28c0b74db72333b51 3 | timeCreated: 1560807034 -------------------------------------------------------------------------------- /Assets/com.fluid.dialogue/Runtime/Choices/IChoice.cs: -------------------------------------------------------------------------------- 1 | using CleverCrow.Fluid.Dialogues.Nodes; 2 | 3 | namespace CleverCrow.Fluid.Dialogues.Choices { 4 | public interface IChoice : IUniqueId { 5 | string Text { get; } 6 | bool IsValid { get; } 7 | 8 | INode GetValidChildNode (); 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /Assets/com.fluid.dialogue/Runtime/Choices/IChoice.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 7a777c344eba4511963d5ef718daf2b1 3 | timeCreated: 1561063905 -------------------------------------------------------------------------------- /Assets/com.fluid.dialogue/Runtime/Conditions.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 6855acc6e39449208d274a2c16449dc7 3 | timeCreated: 1560964854 -------------------------------------------------------------------------------- /Assets/com.fluid.dialogue/Runtime/Conditions/ConditionDataBase.cs: -------------------------------------------------------------------------------- 1 | using CleverCrow.Fluid.Dialogues.Graphs; 2 | using CleverCrow.Fluid.Dialogues.Nodes; 3 | 4 | namespace CleverCrow.Fluid.Dialogues.Conditions { 5 | public abstract class ConditionDataBase : NodeNestedDataBase, IConditionData { 6 | public virtual void OnInit (IDialogueController dialogue) {} 7 | public abstract bool OnGetIsValid (INode parent); 8 | 9 | public override ICondition GetRuntime (IGraph graphRuntime, IDialogueController dialogue) { 10 | return new ConditionRuntime(dialogue, _uniqueId, Instantiate(this)); 11 | } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /Assets/com.fluid.dialogue/Runtime/Conditions/ConditionDataBase.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a04df09377384f649f09c6dd5f204709 3 | timeCreated: 1561068074 -------------------------------------------------------------------------------- /Assets/com.fluid.dialogue/Runtime/Conditions/ConditionRuntime.cs: -------------------------------------------------------------------------------- 1 | using CleverCrow.Fluid.Dialogues.Nodes; 2 | 3 | namespace CleverCrow.Fluid.Dialogues.Conditions { 4 | public interface IConditionData { 5 | void OnInit (IDialogueController dialogue); 6 | bool OnGetIsValid (INode parent); 7 | } 8 | 9 | public class ConditionRuntime : ICondition { 10 | private readonly IDialogueController _dialogueController; 11 | private readonly IConditionData _data; 12 | 13 | private bool _initTriggered; 14 | 15 | public string UniqueId { get; } 16 | public IConditionData Data => _data; 17 | 18 | public ConditionRuntime (IDialogueController dialogueController, string uniqueId, IConditionData data) { 19 | _data = data; 20 | _dialogueController = dialogueController; 21 | UniqueId = uniqueId; 22 | } 23 | 24 | public bool GetIsValid (INode parent) { 25 | if (!_initTriggered) { 26 | _data.OnInit(_dialogueController); 27 | _initTriggered = true; 28 | } 29 | 30 | return _data.OnGetIsValid(parent); 31 | } 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /Assets/com.fluid.dialogue/Runtime/Conditions/ConditionRuntime.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 2169ee23649040909badba5ba469f4d2 3 | timeCreated: 1561066972 -------------------------------------------------------------------------------- /Assets/com.fluid.dialogue/Runtime/Conditions/ICondition.cs: -------------------------------------------------------------------------------- 1 | using CleverCrow.Fluid.Dialogues.Nodes; 2 | 3 | namespace CleverCrow.Fluid.Dialogues.Conditions { 4 | public interface ICondition : IUniqueId { 5 | IConditionData Data { get; } 6 | 7 | bool GetIsValid (INode parent); 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /Assets/com.fluid.dialogue/Runtime/Conditions/ICondition.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 54ca5577fd3d4768beebe893ac953cfe 3 | timeCreated: 1560964872 -------------------------------------------------------------------------------- /Assets/com.fluid.dialogue/Runtime/DialogueController.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 496a3d005020407a887495eb6eaa6ac6 3 | timeCreated: 1585362066 -------------------------------------------------------------------------------- /Assets/com.fluid.dialogue/Runtime/DialogueController/DialogueController.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f2e4f8db06c7482c9765293663debefd 3 | timeCreated: 1561159800 -------------------------------------------------------------------------------- /Assets/com.fluid.dialogue/Runtime/DialoguePlayback.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c36732fd241148b4a8a91bd95be0cbf2 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/com.fluid.dialogue/Runtime/Graphs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b51410a60630450a97dbdefc46d16a38 3 | timeCreated: 1560534455 -------------------------------------------------------------------------------- /Assets/com.fluid.dialogue/Runtime/Graphs/DialogueGraph.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using CleverCrow.Fluid.Dialogues.Nodes; 3 | using UnityEngine; 4 | 5 | namespace CleverCrow.Fluid.Dialogues.Graphs { 6 | public interface IGraphData { 7 | INodeData Root { get; } 8 | IReadOnlyList Nodes { get; } 9 | } 10 | 11 | public class DialogueGraph : ScriptableObject, IGraphData { 12 | [HideInInspector] 13 | [SerializeField] 14 | private List _nodes = new List(); 15 | 16 | [HideInInspector] 17 | public NodeRootData root; 18 | 19 | [HideInInspector] 20 | public Vector2 scrollPosition; 21 | 22 | public INodeData Root => root; 23 | public IReadOnlyList Nodes => _nodes; 24 | 25 | public void AddNode (NodeDataBase node) { 26 | node.Setup(); 27 | _nodes.Add(node); 28 | } 29 | 30 | public void DeleteNode (NodeDataBase node) { 31 | _nodes.Remove(node); 32 | } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /Assets/com.fluid.dialogue/Runtime/Graphs/DialogueGraph.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b35851dfd8754a74b333944d50d05bbd 3 | timeCreated: 1560881144 -------------------------------------------------------------------------------- /Assets/com.fluid.dialogue/Runtime/Graphs/Events.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 2883ad29ae14454288cdc24ec4ab1c88 3 | timeCreated: 1560535201 -------------------------------------------------------------------------------- /Assets/com.fluid.dialogue/Runtime/Graphs/Events/DialogueEvents.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using CleverCrow.Fluid.Dialogues.Choices; 3 | using CleverCrow.Fluid.Dialogues.Nodes; 4 | using CleverCrow.Fluid.Utilities.UnityEvents; 5 | using UnityEngine; 6 | 7 | namespace CleverCrow.Fluid.Dialogues { 8 | public class DialogueEvents : IDialogueEvents { 9 | public IUnityEvent Begin { get; } = new UnityEventPlus(); 10 | public IUnityEvent End { get; } = new UnityEventPlus(); 11 | public IUnityEvent Speak { get; } = new UnityEventPlus(); 12 | public IUnityEvent SpeakWithAudio { get; } = new UnityEventPlus(); 13 | public IUnityEvent> Choice { get; } = new UnityEventPlus>(); 14 | public IUnityEvent NodeEnter { get; } = new UnityEventPlus(); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /Assets/com.fluid.dialogue/Runtime/Graphs/Events/DialogueEvents.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 349b47944cfa4003ac13b8623a1b026e 3 | timeCreated: 1561161196 -------------------------------------------------------------------------------- /Assets/com.fluid.dialogue/Runtime/Graphs/Events/IDialogueEvents.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using CleverCrow.Fluid.Dialogues.Choices; 3 | using CleverCrow.Fluid.Dialogues.Nodes; 4 | using CleverCrow.Fluid.Utilities.UnityEvents; 5 | using UnityEngine; 6 | 7 | namespace CleverCrow.Fluid.Dialogues { 8 | public interface IDialogueEvents { 9 | IUnityEvent Begin { get; } 10 | IUnityEvent End { get; } 11 | 12 | /// 13 | /// Old Speak event, use SpeakWithAudio to get audio sound files 14 | /// 15 | IUnityEvent Speak { get; } 16 | IUnityEvent SpeakWithAudio { get; } 17 | 18 | IUnityEvent> Choice { get; } 19 | IUnityEvent NodeEnter { get; } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /Assets/com.fluid.dialogue/Runtime/Graphs/Events/IDialogueEvents.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 01b0202fb9fc434ba792ddfb9ec97b28 3 | timeCreated: 1560535300 -------------------------------------------------------------------------------- /Assets/com.fluid.dialogue/Runtime/Graphs/GraphRuntime.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Linq; 3 | using CleverCrow.Fluid.Dialogues.Nodes; 4 | 5 | namespace CleverCrow.Fluid.Dialogues.Graphs { 6 | public class GraphRuntime : IGraph { 7 | private readonly Dictionary _dataToRuntime; 8 | 9 | public INode Root { get; } 10 | public IGraphData Data { get; } 11 | 12 | public GraphRuntime (IDialogueController dialogue, IGraphData data) { 13 | _dataToRuntime = data.Nodes.ToDictionary( 14 | k => k, 15 | v => v.GetRuntime(this, dialogue)); 16 | 17 | Root = GetCopy(data.Root); 18 | Data = data; 19 | } 20 | 21 | public INode GetCopy (INodeData original) { 22 | return _dataToRuntime[original]; 23 | } 24 | 25 | public INode GetNodeByDataId (string id) { 26 | return _dataToRuntime.FirstOrDefault(n => n.Key.UniqueId == id).Value; 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /Assets/com.fluid.dialogue/Runtime/Graphs/GraphRuntime.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ed1ddfb43db6408583940ff344fe37a1 3 | timeCreated: 1560874957 -------------------------------------------------------------------------------- /Assets/com.fluid.dialogue/Runtime/Graphs/IGraph.cs: -------------------------------------------------------------------------------- 1 | using CleverCrow.Fluid.Dialogues.Nodes; 2 | 3 | namespace CleverCrow.Fluid.Dialogues.Graphs { 4 | public interface IGraph { 5 | INode Root { get; } 6 | IGraphData Data { get; } 7 | 8 | INode GetCopy (INodeData nodeData); 9 | INode GetNodeByDataId (string id); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /Assets/com.fluid.dialogue/Runtime/Graphs/IGraph.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f27a8e2703e346ceac04293e764dfd40 3 | timeCreated: 1561064260 -------------------------------------------------------------------------------- /Assets/com.fluid.dialogue/Runtime/IGetRuntime.cs: -------------------------------------------------------------------------------- 1 | using CleverCrow.Fluid.Dialogues.Graphs; 2 | 3 | namespace CleverCrow.Fluid.Dialogues { 4 | public interface IGetRuntime : ISetup { 5 | T GetRuntime (IGraph graphRuntime, IDialogueController dialogue); 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /Assets/com.fluid.dialogue/Runtime/IGetRuntime.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a42a6ce31a8044b9909e03ff3799b35a 3 | timeCreated: 1561065494 -------------------------------------------------------------------------------- /Assets/com.fluid.dialogue/Runtime/ISetup.cs: -------------------------------------------------------------------------------- 1 | namespace CleverCrow.Fluid.Dialogues { 2 | public interface ISetup : IUniqueId { 3 | void Setup (); 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /Assets/com.fluid.dialogue/Runtime/ISetup.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 733c970e901945ceb7bb8ffc2f986755 3 | timeCreated: 1561395082 -------------------------------------------------------------------------------- /Assets/com.fluid.dialogue/Runtime/IUniqueId.cs: -------------------------------------------------------------------------------- 1 | namespace CleverCrow.Fluid.Dialogues { 2 | public interface IUniqueId { 3 | string UniqueId { get; } 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /Assets/com.fluid.dialogue/Runtime/IUniqueId.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3efe90ba4e3a4bdbace083862475f87e 3 | timeCreated: 1561395642 -------------------------------------------------------------------------------- /Assets/com.fluid.dialogue/Runtime/Nodes.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d3b3c102a3944eaf8639a1b0e88f51a2 3 | timeCreated: 1560804784 -------------------------------------------------------------------------------- /Assets/com.fluid.dialogue/Runtime/Nodes/ChoiceHub.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 807c809a304b4df987e66b261a349fdf 3 | timeCreated: 1561143174 -------------------------------------------------------------------------------- /Assets/com.fluid.dialogue/Runtime/Nodes/ChoiceHub/NodeChoiceHub.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Linq; 3 | using CleverCrow.Fluid.Dialogues.Actions; 4 | using CleverCrow.Fluid.Dialogues.Choices; 5 | using CleverCrow.Fluid.Dialogues.Conditions; 6 | 7 | namespace CleverCrow.Fluid.Dialogues.Nodes { 8 | public class NodeChoiceHub : INode { 9 | private readonly List _choiceList; 10 | private List _conditions; 11 | 12 | public string UniqueId { get; } 13 | public List EnterActions { get; } 14 | public List ExitActions { get; } 15 | public IReadOnlyList Conditions => _conditions; 16 | 17 | public virtual bool IsValid => 18 | _conditions.Find(c => !c.GetIsValid(this)) == null; 19 | 20 | public List HubChoices => 21 | _choiceList.Where(c => c.IsValid).ToList(); 22 | 23 | public NodeChoiceHub (string uniqueId, List choiceList, List conditions) { 24 | UniqueId = uniqueId; 25 | _choiceList = choiceList; 26 | _conditions = conditions; 27 | } 28 | 29 | public INode Next () { 30 | throw new System.NotImplementedException(); 31 | } 32 | 33 | public void Play (IDialoguePlayback playback) { 34 | throw new System.NotImplementedException(); 35 | } 36 | 37 | public IChoice GetChoice (int index) { 38 | throw new System.NotImplementedException(); 39 | } 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /Assets/com.fluid.dialogue/Runtime/Nodes/ChoiceHub/NodeChoiceHub.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 0d7c638af79e40cbac660ad8821c8c1f 3 | timeCreated: 1561143186 -------------------------------------------------------------------------------- /Assets/com.fluid.dialogue/Runtime/Nodes/ChoiceHub/NodeChoiceHubData.cs: -------------------------------------------------------------------------------- 1 | using System.Linq; 2 | using CleverCrow.Fluid.Dialogues.Graphs; 3 | 4 | namespace CleverCrow.Fluid.Dialogues.Nodes { 5 | [CreateMenu("Hub/Choice")] 6 | public class NodeChoiceHubData : NodeDataChoiceBase { 7 | protected override string DefaultName => "Choice Hub"; 8 | public override bool HideInspectorActions => true; 9 | 10 | public override INode GetRuntime (IGraph graphRuntime, IDialogueController dialogue) { 11 | var runtimeChoices = choices.Select(c => c.GetRuntime(graphRuntime, dialogue)).ToList(); 12 | return new NodeChoiceHub( 13 | UniqueId, 14 | runtimeChoices, 15 | conditions.Select(c => c.GetRuntime(graphRuntime, dialogue)).ToList()); 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /Assets/com.fluid.dialogue/Runtime/Nodes/ChoiceHub/NodeChoiceHubData.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9ee683620015454489ed039e9cb805da 3 | timeCreated: 1561258615 -------------------------------------------------------------------------------- /Assets/com.fluid.dialogue/Runtime/Nodes/Dialogue.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b6f9ec99337b48b4af08d6cb84d69479 3 | timeCreated: 1561064359 -------------------------------------------------------------------------------- /Assets/com.fluid.dialogue/Runtime/Nodes/Dialogue/NodeDialogue.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ba494c8ab3ba4950b8e6e8c2a6dc7183 3 | timeCreated: 1560805092 -------------------------------------------------------------------------------- /Assets/com.fluid.dialogue/Runtime/Nodes/Dialogue/NodeDialogueData.cs: -------------------------------------------------------------------------------- 1 | using System.Linq; 2 | using CleverCrow.Fluid.Dialogues.Graphs; 3 | using UnityEngine; 4 | 5 | namespace CleverCrow.Fluid.Dialogues.Nodes { 6 | [CreateMenu("Dialogue", 1)] 7 | public class NodeDialogueData : NodeDataChoiceBase { 8 | public ActorDefinition actor; 9 | public AudioClip audio; 10 | 11 | [TextArea] 12 | public string dialogue; 13 | 14 | protected override string DefaultName => "Dialogue"; 15 | public override string Text => dialogue; 16 | 17 | public override INode GetRuntime (IGraph graphRuntime, IDialogueController controller) { 18 | return new NodeDialogue( 19 | graphRuntime, 20 | UniqueId, 21 | actor, 22 | dialogue, 23 | audio, 24 | children.ToList(), 25 | choices.Select(c => c.GetRuntime(graphRuntime, controller)).ToList(), 26 | conditions.Select(c => c.GetRuntime(graphRuntime, controller)).ToList(), 27 | enterActions.Select(a => a.GetRuntime(graphRuntime, controller)).ToList(), 28 | exitActions.Select(a => a.GetRuntime(graphRuntime, controller)).ToList() 29 | ); 30 | } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /Assets/com.fluid.dialogue/Runtime/Nodes/Dialogue/NodeDialogueData.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9f157564dbc846468ec0ac2b6f7d545e 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: 7 | - actor: {fileID: 11400000, guid: aebb863e25cae0a4495c09b6a617ecf6, type: 2} 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/com.fluid.dialogue/Runtime/Nodes/Hub.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 885ddf2a5c6b44878d8c80859c042ffa 3 | timeCreated: 1561139669 -------------------------------------------------------------------------------- /Assets/com.fluid.dialogue/Runtime/Nodes/Hub/NodeHub.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using CleverCrow.Fluid.Dialogues.Actions; 3 | using CleverCrow.Fluid.Dialogues.Conditions; 4 | using CleverCrow.Fluid.Dialogues.Graphs; 5 | 6 | namespace CleverCrow.Fluid.Dialogues.Nodes { 7 | public class NodeHub : NodeBase { 8 | public NodeHub ( 9 | IGraph graph, 10 | string uniqueId, 11 | List children, 12 | List conditions, 13 | List enterActions, 14 | List exitActions) : 15 | base(graph, uniqueId, children, conditions, enterActions, exitActions) { 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /Assets/com.fluid.dialogue/Runtime/Nodes/Hub/NodeHub.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: de6b5fe462b8431c92526ef417895a94 3 | timeCreated: 1561139688 -------------------------------------------------------------------------------- /Assets/com.fluid.dialogue/Runtime/Nodes/Hub/NodeHubData.cs: -------------------------------------------------------------------------------- 1 | using System.Linq; 2 | using CleverCrow.Fluid.Dialogues.Graphs; 3 | 4 | namespace CleverCrow.Fluid.Dialogues.Nodes { 5 | [CreateMenu("Hub/Default")] 6 | public class NodeHubData : NodeDataBase { 7 | protected override string DefaultName => "Hub"; 8 | public override INode GetRuntime (IGraph graphRuntime, IDialogueController dialogue) { 9 | return new NodeHub( 10 | graphRuntime, 11 | UniqueId, 12 | children.ToList(), 13 | conditions.Select(c => c.GetRuntime(graphRuntime, dialogue)).ToList(), 14 | enterActions.Select(c => c.GetRuntime(graphRuntime, dialogue)).ToList(), 15 | exitActions.Select(c => c.GetRuntime(graphRuntime, dialogue)).ToList() 16 | ); 17 | } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /Assets/com.fluid.dialogue/Runtime/Nodes/Hub/NodeHubData.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 1a5bb286b3994795a7780dbfc28d37fd 3 | timeCreated: 1561258453 -------------------------------------------------------------------------------- /Assets/com.fluid.dialogue/Runtime/Nodes/INode.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using CleverCrow.Fluid.Dialogues.Actions; 3 | using CleverCrow.Fluid.Dialogues.Choices; 4 | using CleverCrow.Fluid.Dialogues.Conditions; 5 | 6 | namespace CleverCrow.Fluid.Dialogues.Nodes { 7 | public interface INode : IUniqueId { 8 | List EnterActions { get; } 9 | List ExitActions { get; } 10 | bool IsValid { get; } 11 | List HubChoices { get; } 12 | IReadOnlyList Conditions { get; } 13 | 14 | /// 15 | /// Returns the first valid child node 16 | /// 17 | INode Next (); 18 | void Play (IDialoguePlayback playback); 19 | IChoice GetChoice (int index); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /Assets/com.fluid.dialogue/Runtime/Nodes/INode.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b2a992e4f5d94c83a9964ab37c38c95c 3 | timeCreated: 1560534567 -------------------------------------------------------------------------------- /Assets/com.fluid.dialogue/Runtime/Nodes/Links.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a819704fd5d34c88a782f57f3c7557e1 3 | timeCreated: 1561135140 -------------------------------------------------------------------------------- /Assets/com.fluid.dialogue/Runtime/Nodes/Links/NodeLink.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using CleverCrow.Fluid.Dialogues.Actions; 3 | using CleverCrow.Fluid.Dialogues.Conditions; 4 | using CleverCrow.Fluid.Dialogues.Graphs; 5 | 6 | namespace CleverCrow.Fluid.Dialogues.Nodes { 7 | public class NodeLink : NodeBase { 8 | public override bool IsValid => Children[0]?.IsValid ?? false; 9 | 10 | public NodeLink ( 11 | IGraph graph, 12 | string UniqueId, 13 | INodeData child, 14 | List conditions, 15 | List enterActions, 16 | List exitActions) : 17 | base(graph, UniqueId, new List{child}, conditions, enterActions, exitActions) { 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /Assets/com.fluid.dialogue/Runtime/Nodes/Links/NodeLink.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 7939d551d49b4c608f8a4a579d51235d 3 | timeCreated: 1561135150 -------------------------------------------------------------------------------- /Assets/com.fluid.dialogue/Runtime/Nodes/Links/NodeLinkData.cs: -------------------------------------------------------------------------------- 1 | using System.Linq; 2 | using CleverCrow.Fluid.Dialogues.Graphs; 3 | 4 | namespace CleverCrow.Fluid.Dialogues.Nodes { 5 | public class NodeLinkData : NodeDataBase { 6 | public override INode GetRuntime (IGraph graphRuntime, IDialogueController dialogue) { 7 | return new NodeLink( 8 | graphRuntime, 9 | UniqueId, 10 | children.Count > 0 ? children[0] : null, 11 | conditions.Select(c => c.GetRuntime(graphRuntime, dialogue)).ToList(), 12 | enterActions.Select(c => c.GetRuntime(graphRuntime, dialogue)).ToList(), 13 | exitActions.Select(c => c.GetRuntime(graphRuntime, dialogue)).ToList() 14 | ); 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /Assets/com.fluid.dialogue/Runtime/Nodes/Links/NodeLinkData.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d766ad0e6f2f48cbaa50eb4a799b4ec8 3 | timeCreated: 1561258275 -------------------------------------------------------------------------------- /Assets/com.fluid.dialogue/Runtime/Nodes/NodeBase.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: bb0856c7842343ee9d29fa0a71e39739 3 | timeCreated: 1561248711 -------------------------------------------------------------------------------- /Assets/com.fluid.dialogue/Runtime/Nodes/NodeDataBase.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 769ed8c876434b2bb94f56d2b6f00e3c 3 | timeCreated: 1560889351 -------------------------------------------------------------------------------- /Assets/com.fluid.dialogue/Runtime/Nodes/NodeDataChoiceBase.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Linq; 3 | using CleverCrow.Fluid.Dialogues.Choices; 4 | using UnityEngine; 5 | 6 | namespace CleverCrow.Fluid.Dialogues.Nodes { 7 | public abstract class NodeDataChoiceBase : NodeDataBase { 8 | [HideInInspector] 9 | public List choices = new List(); 10 | 11 | public override List Choices => choices; 12 | 13 | public override void ClearConnectionChildren () { 14 | base.ClearConnectionChildren(); 15 | foreach (var choice in choices) { 16 | choice.ClearConnectionChildren(); 17 | } 18 | } 19 | 20 | public override void SortConnectionsByPosition () { 21 | base.SortConnectionsByPosition(); 22 | foreach (var choice in choices) { 23 | choice.SortConnectionsByPosition(); 24 | } 25 | } 26 | 27 | public override NodeDataBase GetDataCopy () { 28 | var copy = base.GetDataCopy() as NodeDataChoiceBase; 29 | copy.choices = choices.Select(Instantiate).ToList(); 30 | 31 | return copy; 32 | } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /Assets/com.fluid.dialogue/Runtime/Nodes/NodeDataChoiceBase.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 1c703fee9e214b539f1087da592d7ac7 3 | timeCreated: 1564348864 -------------------------------------------------------------------------------- /Assets/com.fluid.dialogue/Runtime/Nodes/NodeNestedDataBase.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using CleverCrow.Fluid.Dialogues.Graphs; 3 | using UnityEngine; 4 | 5 | namespace CleverCrow.Fluid.Dialogues.Nodes { 6 | public abstract class NodeNestedDataBase : ScriptableObject, IGetRuntime { 7 | [SerializeField] 8 | private string _title; 9 | 10 | [SerializeField] 11 | protected string _uniqueId; 12 | 13 | public string UniqueId => _uniqueId; 14 | 15 | public void Setup () { 16 | if (string.IsNullOrEmpty(_title)) { 17 | _title = GetType().Name; 18 | } 19 | 20 | name = GetType().Name; 21 | _uniqueId = Guid.NewGuid().ToString(); 22 | } 23 | 24 | public abstract T GetRuntime (IGraph graphRuntime, IDialogueController dialogue); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /Assets/com.fluid.dialogue/Runtime/Nodes/NodeNestedDataBase.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 8fd5ee15c0fa444791f7610fa98df38c 3 | timeCreated: 1564947544 -------------------------------------------------------------------------------- /Assets/com.fluid.dialogue/Runtime/Nodes/Note.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 8f9d607bf1aa4cdaa79a340358db94ea 3 | timeCreated: 1713803227 -------------------------------------------------------------------------------- /Assets/com.fluid.dialogue/Runtime/Nodes/Note/NodeNoteData.cs: -------------------------------------------------------------------------------- 1 | using CleverCrow.Fluid.Dialogues.Graphs; 2 | using UnityEngine; 3 | 4 | namespace CleverCrow.Fluid.Dialogues.Nodes { 5 | // @TODO This should inherit a simpler NodeDataBase that doesn't have children, conditions, enterActions, exitActions, ect. 6 | // This can be done by breaking down the base NodeDataBase into a separate NodeDataHierarchyBase class that inherits from a minimal NodeDataBase 7 | // The editor display will also need to be adjusted accordingly 8 | [CreateMenu("Note")] 9 | public class NodeNoteData : NodeDataBase { 10 | [TextArea] 11 | public string note; 12 | 13 | protected override string DefaultName => "Note"; 14 | public override string Text => note; 15 | 16 | public override bool HideConnections => true; 17 | public override bool HideInspectorActions => true; 18 | public override bool HideInspectorConditions => true; 19 | 20 | public override INode GetRuntime (IGraph graphRuntime, IDialogueController controller) { 21 | // There is no runtime, this is an editor only note 22 | return null; 23 | } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /Assets/com.fluid.dialogue/Runtime/Nodes/Note/NodeNoteData.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9bde9a25e35e47d5bc8e840897ea28e6 3 | timeCreated: 1713803266 -------------------------------------------------------------------------------- /Assets/com.fluid.dialogue/Runtime/Nodes/PlayGraph.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 1f09af5ebfb14b94ad0938bd4ec11a62 3 | timeCreated: 1561152988 -------------------------------------------------------------------------------- /Assets/com.fluid.dialogue/Runtime/Nodes/PlayGraph/NodePlayGraph.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using CleverCrow.Fluid.Dialogues.Actions; 3 | using CleverCrow.Fluid.Dialogues.Conditions; 4 | using CleverCrow.Fluid.Dialogues.Graphs; 5 | 6 | namespace CleverCrow.Fluid.Dialogues.Nodes.PlayGraph { 7 | public class NodePlayGraph : NodeBase { 8 | private readonly IGraphData _graph; 9 | 10 | public IGraphData Graph => _graph; 11 | 12 | public NodePlayGraph ( 13 | IGraph runtime, 14 | string uniqueId, 15 | IGraphData graph, 16 | List children, 17 | List conditions, 18 | List enterActions, 19 | List exitActions) 20 | : base(runtime, uniqueId, children, conditions, enterActions, exitActions) { 21 | _graph = graph; 22 | } 23 | 24 | protected override void OnPlay (IDialoguePlayback playback) { 25 | playback.ParentCtrl.PlayChild(_graph); 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /Assets/com.fluid.dialogue/Runtime/Nodes/PlayGraph/NodePlayGraph.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 7ef82cdad9ac4874a4a45881ae599aa5 3 | timeCreated: 1561153303 -------------------------------------------------------------------------------- /Assets/com.fluid.dialogue/Runtime/Nodes/PlayGraph/NodePlayGraphData.cs: -------------------------------------------------------------------------------- 1 | using System.Linq; 2 | using CleverCrow.Fluid.Dialogues.Graphs; 3 | using CleverCrow.Fluid.Dialogues.Nodes.PlayGraph; 4 | 5 | namespace CleverCrow.Fluid.Dialogues.Nodes { 6 | [CreateMenu("Play Graph")] 7 | public class NodePlayGraphData : NodeDataBase { 8 | public DialogueGraph dialogueGraph; 9 | 10 | protected override string DefaultName => "Play Graph"; 11 | 12 | public override INode GetRuntime (IGraph graphRuntime, IDialogueController dialogue) { 13 | return new NodePlayGraph( 14 | graphRuntime, 15 | UniqueId, 16 | dialogueGraph, 17 | children.ToList(), 18 | conditions.Select(c => c.GetRuntime(graphRuntime, dialogue)).ToList(), 19 | enterActions.Select(c => c.GetRuntime(graphRuntime, dialogue)).ToList(), 20 | exitActions.Select(c => c.GetRuntime(graphRuntime, dialogue)).ToList() 21 | ); 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /Assets/com.fluid.dialogue/Runtime/Nodes/PlayGraph/NodePlayGraphData.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e67818104cf34e2693b49316191c2be0 3 | timeCreated: 1561258043 -------------------------------------------------------------------------------- /Assets/com.fluid.dialogue/Runtime/Nodes/Root.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 041a6738f3974a9fb81febaf66ebfc16 3 | timeCreated: 1561069920 -------------------------------------------------------------------------------- /Assets/com.fluid.dialogue/Runtime/Nodes/Root/NodeRoot.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using CleverCrow.Fluid.Dialogues.Actions; 3 | using CleverCrow.Fluid.Dialogues.Conditions; 4 | using CleverCrow.Fluid.Dialogues.Graphs; 5 | 6 | namespace CleverCrow.Fluid.Dialogues.Nodes { 7 | public class NodeRoot : NodeBase { 8 | public NodeRoot ( 9 | IGraph runtime, 10 | string uniqueId, 11 | List children, 12 | List conditions, 13 | List enterActions, 14 | List exitActions) : 15 | base(runtime, uniqueId, children, conditions, enterActions, exitActions) { 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /Assets/com.fluid.dialogue/Runtime/Nodes/Root/NodeRoot.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 0360d9bb2c7e445897fc5b204c0ca973 3 | timeCreated: 1561069936 -------------------------------------------------------------------------------- /Assets/com.fluid.dialogue/Runtime/Nodes/Root/NodeRootData.cs: -------------------------------------------------------------------------------- 1 | using System.Linq; 2 | using CleverCrow.Fluid.Dialogues.Graphs; 3 | 4 | namespace CleverCrow.Fluid.Dialogues.Nodes { 5 | public class NodeRootData : NodeDataBase { 6 | protected override string DefaultName => "Root"; 7 | 8 | public override INode GetRuntime (IGraph graphRuntime, IDialogueController dialogue) { 9 | return new NodeRoot( 10 | graphRuntime, 11 | UniqueId, 12 | children.ToList(), 13 | conditions.Select(c => c.GetRuntime(graphRuntime, dialogue)).ToList(), 14 | enterActions.Select(c => c.GetRuntime(graphRuntime, dialogue)).ToList(), 15 | exitActions.Select(c => c.GetRuntime(graphRuntime, dialogue)).ToList() 16 | ); 17 | } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /Assets/com.fluid.dialogue/Runtime/Nodes/Root/NodeRootData.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b2d8d0566afe4d5fa9596c80df966df6 3 | timeCreated: 1561071172 -------------------------------------------------------------------------------- /Assets/com.fluid.dialogue/Runtime/com.fluid.dialogue.asmdef: -------------------------------------------------------------------------------- 1 | { 2 | "name": "com.fluid.dialogue", 3 | "references": [ 4 | "com.fluid.database", 5 | "com.fluid.unity-event-plus", 6 | "com.fluid.simple-singleton" 7 | ], 8 | "includePlatforms": [], 9 | "excludePlatforms": [], 10 | "allowUnsafeCode": false, 11 | "overrideReferences": false, 12 | "precompiledReferences": [], 13 | "autoReferenced": true, 14 | "defineConstraints": [], 15 | "versionDefines": [], 16 | "noEngineReferences": false 17 | } -------------------------------------------------------------------------------- /Assets/com.fluid.dialogue/Runtime/com.fluid.dialogue.asmdef.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b7c9b06e8d6046f41a510e4c2bf60be0 3 | AssemblyDefinitionImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Assets/com.fluid.dialogue/Tests.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b02ce844932fd3d43bcb98acc3ff5ded 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/com.fluid.dialogue/Tests/Editor.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 72cec465862da10488812ac6737a6d44 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/com.fluid.dialogue/Tests/Editor/Actions.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: cfc8b05cf46442a0838cfcc34286e893 3 | timeCreated: 1561928216 -------------------------------------------------------------------------------- /Assets/com.fluid.dialogue/Tests/Editor/Actions/ActionRuntimeTest.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 14857be8115941db8a6c1d94a3172dfe 3 | timeCreated: 1560977894 -------------------------------------------------------------------------------- /Assets/com.fluid.dialogue/Tests/Editor/Actions/Databases.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 50918ab842e8401c8a2bc1920c65a829 3 | timeCreated: 1562004554 -------------------------------------------------------------------------------- /Assets/com.fluid.dialogue/Tests/Editor/Actions/Databases/ConditionLocalBoolTest.cs: -------------------------------------------------------------------------------- 1 | using CleverCrow.Fluid.Databases; 2 | using NSubstitute; 3 | using NUnit.Framework; 4 | 5 | namespace CleverCrow.Fluid.Dialogues.Actions.Databases { 6 | public class ConditionLocalBoolTest { 7 | private ConditionBoolInternal _boolCondition; 8 | private IKeyValueDefinition _definition; 9 | private IKeyValueData _database; 10 | 11 | [SetUp] 12 | public void BeforeEach () { 13 | _definition = Substitute.For>(); 14 | _database = Substitute.For>(); 15 | _boolCondition = new ConditionBoolInternal(_database); 16 | 17 | _database.Get(null).ReturnsForAnyArgs(true); 18 | } 19 | 20 | public class AreValuesEqualMethod : ConditionLocalBoolTest { 21 | [Test] 22 | public void It_should_return_true_if_variable_and_value_are_equal () { 23 | var result = _boolCondition.AreValuesEqual(_definition, true); 24 | 25 | Assert.IsTrue(result); 26 | } 27 | 28 | [Test] 29 | public void It_should_return_false_if_variable_and_value_are_not_equal () { 30 | var result = _boolCondition.AreValuesEqual(_definition, false); 31 | 32 | Assert.IsFalse(result); 33 | } 34 | } 35 | 36 | public class AreValuesNotEqualMethod : ConditionLocalBoolTest { 37 | [Test] 38 | public void It_should_return_true_if_variable_and_value_are_not_equal () { 39 | var result = _boolCondition.AreValuesNotEqual(_definition, false); 40 | 41 | Assert.IsTrue(result); 42 | } 43 | 44 | [Test] 45 | public void It_should_return_false_if_variable_and_value_are_equal () { 46 | var result = _boolCondition.AreValuesNotEqual(_definition, true); 47 | 48 | Assert.IsFalse(result); 49 | } 50 | } 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /Assets/com.fluid.dialogue/Tests/Editor/Actions/Databases/ConditionLocalBoolTest.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 1d908d1eff814d6080335e774b6602e3 3 | timeCreated: 1561943627 -------------------------------------------------------------------------------- /Assets/com.fluid.dialogue/Tests/Editor/Actions/Databases/ConditionLocalFloatTest.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e975aabd920b442fa1f52bc6dab0ec01 3 | timeCreated: 1562039346 -------------------------------------------------------------------------------- /Assets/com.fluid.dialogue/Tests/Editor/Actions/Databases/ConditionLocalIntTest.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 857431eb23474ed79e99d3e6006d2840 3 | timeCreated: 1562008472 -------------------------------------------------------------------------------- /Assets/com.fluid.dialogue/Tests/Editor/Actions/Databases/ConditionLocalStringTest.cs: -------------------------------------------------------------------------------- 1 | using CleverCrow.Fluid.Databases; 2 | using NSubstitute; 3 | using NUnit.Framework; 4 | 5 | namespace CleverCrow.Fluid.Dialogues.Actions.Databases { 6 | public class ConditionLocalStringTest { 7 | private const string VALUE = "a"; 8 | 9 | private ConditionStringInternal _condition; 10 | private IKeyValueDefinition _definition; 11 | private IKeyValueData _database; 12 | 13 | [SetUp] 14 | public void BeforeEach () { 15 | _definition = Substitute.For>(); 16 | _database = Substitute.For>(); 17 | _condition = new ConditionStringInternal(_database); 18 | 19 | _database.Get(null).ReturnsForAnyArgs(VALUE); 20 | } 21 | 22 | public class AreValuesEqualMethod : ConditionLocalStringTest { 23 | [Test] 24 | public void It_should_return_true_if_variable_and_value_are_equal () { 25 | var result = _condition.AreValuesEqual(_definition, VALUE); 26 | 27 | Assert.IsTrue(result); 28 | } 29 | 30 | [Test] 31 | public void It_should_return_false_if_variable_and_value_are_not_equal () { 32 | var result = _condition.AreValuesEqual(_definition, "b"); 33 | 34 | Assert.IsFalse(result); 35 | } 36 | } 37 | 38 | public class AreValuesNotEqualMethod : ConditionLocalStringTest { 39 | [Test] 40 | public void It_should_return_true_if_variable_and_value_are_not_equal () { 41 | var result = _condition.AreValuesNotEqual(_definition, "b"); 42 | 43 | Assert.IsTrue(result); 44 | } 45 | 46 | [Test] 47 | public void It_should_return_false_if_variable_and_value_are_equal () { 48 | var result = _condition.AreValuesNotEqual(_definition, VALUE); 49 | 50 | Assert.IsFalse(result); 51 | } 52 | } 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /Assets/com.fluid.dialogue/Tests/Editor/Actions/Databases/ConditionLocalStringTest.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 98c52dccda954763828dc24330831375 3 | timeCreated: 1562004605 -------------------------------------------------------------------------------- /Assets/com.fluid.dialogue/Tests/Editor/Actions/Databases/SetLocalBoolTest.cs: -------------------------------------------------------------------------------- 1 | using CleverCrow.Fluid.Databases; 2 | using NSubstitute; 3 | using NUnit.Framework; 4 | 5 | namespace CleverCrow.Fluid.Dialogues.Actions.Databases { 6 | public class SetLocalBoolTest { 7 | public class WriteValueMethod { 8 | [Test] 9 | public void It_should_set_the_local_database_value () { 10 | const string KEY = "key"; 11 | const bool VALUE = true; 12 | 13 | var database = Substitute.For>(); 14 | var setter = new SetKeyValueInternal(database); 15 | 16 | setter.WriteValue(KEY, VALUE); 17 | 18 | database.Received(1).Set(KEY, VALUE); 19 | } 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /Assets/com.fluid.dialogue/Tests/Editor/Actions/Databases/SetLocalBoolTest.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: de278d5198ae4d2abdadb3389c3a0c90 3 | timeCreated: 1561928232 -------------------------------------------------------------------------------- /Assets/com.fluid.dialogue/Tests/Editor/Builders.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d707c001372a44e5bfb90dd27b11f99c 3 | timeCreated: 1560545993 -------------------------------------------------------------------------------- /Assets/com.fluid.dialogue/Tests/Editor/Builders/A.cs: -------------------------------------------------------------------------------- 1 | namespace CleverCrow.Fluid.Dialogues.Builders { 2 | public static class A { 3 | public static DialogueGraphStubBuilder Graph => new DialogueGraphStubBuilder(); 4 | public static DialogueNodeStubBuilder Node => new DialogueNodeStubBuilder(); 5 | public static NodeDataStubBuilder NodeData => new NodeDataStubBuilder(); 6 | public static ActionStubBuilder Action => new ActionStubBuilder(); 7 | public static ChoiceStubBuilder Choice => new ChoiceStubBuilder(); 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /Assets/com.fluid.dialogue/Tests/Editor/Builders/A.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 2552ff253ee742429f5b0904ba81f599 3 | timeCreated: 1560545981 -------------------------------------------------------------------------------- /Assets/com.fluid.dialogue/Tests/Editor/Builders/ActionStubBuilder.cs: -------------------------------------------------------------------------------- 1 | using CleverCrow.Fluid.Dialogues.Actions; 2 | using NSubstitute; 3 | 4 | namespace CleverCrow.Fluid.Dialogues.Builders { 5 | public class ActionStubBuilder { 6 | private ActionStatus _tickStatus = ActionStatus.Success; 7 | 8 | public ActionStubBuilder WithTickStatus (ActionStatus status) { 9 | _tickStatus = status; 10 | return this; 11 | } 12 | 13 | public IAction Build () { 14 | var action = Substitute.For(); 15 | action.Tick().Returns(_tickStatus); 16 | 17 | return action; 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /Assets/com.fluid.dialogue/Tests/Editor/Builders/ActionStubBuilder.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d59954ff3ac54a9da177f8fad414e4cb 3 | timeCreated: 1560803581 -------------------------------------------------------------------------------- /Assets/com.fluid.dialogue/Tests/Editor/Builders/ChoiceStubBuilder.cs: -------------------------------------------------------------------------------- 1 | using CleverCrow.Fluid.Dialogues.Choices; 2 | using CleverCrow.Fluid.Dialogues.Nodes; 3 | using NSubstitute; 4 | 5 | namespace CleverCrow.Fluid.Dialogues.Builders { 6 | public class ChoiceStubBuilder { 7 | private bool _overrideChildNode; 8 | private INode _validChildNode; 9 | 10 | private bool _isValid = true; 11 | 12 | public ChoiceStubBuilder WithIsValid (bool isValid) { 13 | _isValid = isValid; 14 | return this; 15 | } 16 | 17 | public ChoiceStubBuilder WithValidChildNode (INode validChildNode) { 18 | _overrideChildNode = true; 19 | _validChildNode = validChildNode; 20 | return this; 21 | } 22 | 23 | public IChoice Build () { 24 | var choice = Substitute.For(); 25 | choice.IsValid.Returns(_isValid); 26 | 27 | if (_overrideChildNode) { 28 | choice.GetValidChildNode().Returns(_validChildNode); 29 | } 30 | 31 | return choice; 32 | } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /Assets/com.fluid.dialogue/Tests/Editor/Builders/ChoiceStubBuilder.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 65975b0c866a4e5294d50bd2f706ea6f 3 | timeCreated: 1566058101 -------------------------------------------------------------------------------- /Assets/com.fluid.dialogue/Tests/Editor/Builders/DialogueGraphStubBuilder.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using CleverCrow.Fluid.Dialogues.Graphs; 3 | using CleverCrow.Fluid.Dialogues.Nodes; 4 | using NSubstitute; 5 | 6 | namespace CleverCrow.Fluid.Dialogues.Builders { 7 | public class DialogueGraphStubBuilder { 8 | private readonly List _nodes = new List(); 9 | private INode _next; 10 | 11 | public DialogueGraphStubBuilder WithNode (INodeData node) { 12 | _nodes.Add(node); 13 | return this; 14 | } 15 | 16 | public DialogueGraphStubBuilder WithNextResult (INode node) { 17 | _next = node; 18 | return this; 19 | } 20 | 21 | public IGraph Build () { 22 | var graph = Substitute.For(); 23 | var root = A.Node 24 | .WithNextResult(_next) 25 | .WithPlayAction((playback) => playback.Next()) 26 | .Build(); 27 | graph.Root.Returns(root); 28 | 29 | var rootData = A.NodeData 30 | .WithNode(root) 31 | .Build(); 32 | 33 | graph.GetCopy(rootData).Returns(root); 34 | 35 | foreach (var nodeData in _nodes) { 36 | graph 37 | .GetCopy(nodeData) 38 | .Returns(x => nodeData.GetRuntime(null, null)); 39 | } 40 | 41 | return graph; 42 | } 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /Assets/com.fluid.dialogue/Tests/Editor/Builders/DialogueGraphStubBuilder.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: af85b0b1d4db4e96b15be923a987352c 3 | timeCreated: 1560546007 -------------------------------------------------------------------------------- /Assets/com.fluid.dialogue/Tests/Editor/Builders/DialogueNodeStubBuilder.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 1105f9dfcbf746b8a2d6fd16f5779dec 3 | timeCreated: 1560546092 -------------------------------------------------------------------------------- /Assets/com.fluid.dialogue/Tests/Editor/Builders/NodeDataStubBuilder.cs: -------------------------------------------------------------------------------- 1 | using CleverCrow.Fluid.Dialogues.Nodes; 2 | using NSubstitute; 3 | 4 | namespace CleverCrow.Fluid.Dialogues.Builders { 5 | public class NodeDataStubBuilder { 6 | private INode _node; 7 | 8 | public NodeDataStubBuilder WithNode (INode node) { 9 | _node = node; 10 | return this; 11 | } 12 | 13 | public INodeData Build () { 14 | var nodeData = Substitute.For(); 15 | nodeData.GetRuntime(null, null).ReturnsForAnyArgs(_node); 16 | 17 | return nodeData; 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /Assets/com.fluid.dialogue/Tests/Editor/Builders/NodeDataStubBuilder.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 085928b446694f10b7561130d685ee48 3 | timeCreated: 1565991122 -------------------------------------------------------------------------------- /Assets/com.fluid.dialogue/Tests/Editor/ChoiceRuntimeTest.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 313cd24e9d404b6990cebc70187d9256 3 | timeCreated: 1560975758 -------------------------------------------------------------------------------- /Assets/com.fluid.dialogue/Tests/Editor/ConditionRuntimeTest.cs: -------------------------------------------------------------------------------- 1 | using CleverCrow.Fluid.Dialogues.Conditions; 2 | using NSubstitute; 3 | using NUnit.Framework; 4 | 5 | namespace FluidDialogue.Tests.Editor { 6 | public class ConditionRuntimeTest { 7 | private IConditionData _data; 8 | 9 | [SetUp] 10 | public void Setup () { 11 | _data = Substitute.For(); 12 | } 13 | 14 | public class GetIsValidMethod { 15 | public class OnGetIsValidTriggering : ConditionRuntimeTest { 16 | [Test] 17 | public void It_should_return_the_OnGetIsValid_value () { 18 | _data.OnGetIsValid(null).Returns(true); 19 | var condition = new ConditionRuntime(null, null, _data); 20 | 21 | var result = condition.GetIsValid(null); 22 | 23 | Assert.IsTrue(result); 24 | } 25 | } 26 | 27 | public class OnInitTriggering : ConditionRuntimeTest { 28 | [Test] 29 | public void It_should_trigger_OnInit_with_a_dialogue_controller () { 30 | var condition = new ConditionRuntime(null, null, _data); 31 | 32 | condition.GetIsValid(null); 33 | 34 | _data.Received(1).OnInit(null); 35 | } 36 | 37 | [Test] 38 | public void It_should_trigger_OnInit_only_once () { 39 | var condition = new ConditionRuntime(null, null, _data); 40 | 41 | condition.GetIsValid(null); 42 | condition.GetIsValid(null); 43 | 44 | _data.Received(1).OnInit(null); 45 | } 46 | } 47 | } 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /Assets/com.fluid.dialogue/Tests/Editor/ConditionRuntimeTest.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 72132a51ffe94cdcba6e79bc1a8674c9 3 | timeCreated: 1561067131 -------------------------------------------------------------------------------- /Assets/com.fluid.dialogue/Tests/Editor/DialogueControllerTest.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 39100e9d49f942c1b833c9432e434d69 3 | timeCreated: 1561159830 -------------------------------------------------------------------------------- /Assets/com.fluid.dialogue/Tests/Editor/DialoguePlaybackTest.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: bc06da1936b2432e945e56d7b98b671d 3 | timeCreated: 1560528721 -------------------------------------------------------------------------------- /Assets/com.fluid.dialogue/Tests/Editor/GraphRuntimeTest.cs: -------------------------------------------------------------------------------- 1 | using CleverCrow.Fluid.Dialogues.Graphs; 2 | using CleverCrow.Fluid.Dialogues.Nodes; 3 | using NSubstitute; 4 | using NUnit.Framework; 5 | using System.Collections.Generic; 6 | 7 | namespace FluidDialogue.Tests.Editor { 8 | public class GraphRuntimeTest { 9 | public class Constructor { 10 | [Test] 11 | public void It_should_set_the_root_to_the_root_runtime_value () { 12 | var root = Substitute.For(); 13 | var rootCopy = Substitute.For(); 14 | root.GetRuntime(null, null).ReturnsForAnyArgs(rootCopy); 15 | 16 | var graphData = Substitute.For(); 17 | IReadOnlyList nodeList = new List {root}; 18 | graphData.Nodes.Returns(nodeList); 19 | graphData.Root.Returns(root); 20 | 21 | var graph = new GraphRuntime(null, graphData); 22 | 23 | Assert.AreEqual(rootCopy, graph.Root); 24 | } 25 | } 26 | 27 | public class GetCopyMethod { 28 | [Test] 29 | public void It_should_return_a_copy_of_the_original () { 30 | var root = Substitute.For(); 31 | var rootCopy = Substitute.For(); 32 | root.GetRuntime(null, null).ReturnsForAnyArgs(rootCopy); 33 | 34 | var graphData = Substitute.For(); 35 | IReadOnlyList nodeList = new List {root}; 36 | graphData.Nodes.Returns(nodeList); 37 | graphData.Root.Returns(root); 38 | 39 | var graph = new GraphRuntime(null, graphData); 40 | 41 | Assert.AreEqual(rootCopy, graph.GetCopy(root)); 42 | } 43 | } 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /Assets/com.fluid.dialogue/Tests/Editor/GraphRuntimeTest.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3f3d1ac0c1df42c6b16bfc59ed4ff44b 3 | timeCreated: 1560878582 -------------------------------------------------------------------------------- /Assets/com.fluid.dialogue/Tests/Editor/Nodes.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 28d313687cb942c180e520d641b34990 3 | timeCreated: 1561070005 -------------------------------------------------------------------------------- /Assets/com.fluid.dialogue/Tests/Editor/Nodes/NodeChoiceHubTest.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: dd68e7df1f8245268c30173597d9d944 3 | timeCreated: 1561143230 -------------------------------------------------------------------------------- /Assets/com.fluid.dialogue/Tests/Editor/Nodes/NodeDialogueTest.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b4c09b0eb4d4412ca3ed77d8de64ce72 3 | timeCreated: 1560805453 -------------------------------------------------------------------------------- /Assets/com.fluid.dialogue/Tests/Editor/Nodes/NodeHubTest.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b2510f4a9859453fb16bca960bd78d6a 3 | timeCreated: 1561140970 -------------------------------------------------------------------------------- /Assets/com.fluid.dialogue/Tests/Editor/Nodes/NodeLinkTest.cs: -------------------------------------------------------------------------------- 1 | using CleverCrow.Fluid.Dialogues.Builders; 2 | using CleverCrow.Fluid.Dialogues.Graphs; 3 | using NSubstitute; 4 | using NUnit.Framework; 5 | 6 | namespace CleverCrow.Fluid.Dialogues.Nodes { 7 | public class NodeLinkTest { 8 | private INode _child; 9 | private NodeLink _link; 10 | private IGraph _graph; 11 | 12 | [SetUp] 13 | public void BeforeEach () { 14 | _child = A.Node.Build(); 15 | var childData = A.NodeData.WithNode(_child).Build(); 16 | _graph = A.Graph.WithNode(childData).Build(); 17 | _link = new NodeLink(_graph, null, childData, null, null, null); 18 | } 19 | 20 | public class IsValidProperty : NodeLinkTest { 21 | [Test] 22 | public void It_should_return_the_child_IsValid_status () { 23 | _child.IsValid.Returns(true); 24 | 25 | Assert.IsTrue(_link.IsValid); 26 | } 27 | 28 | [Test] 29 | public void It_should_not_crash_if_there_is_no_child () { 30 | _link = new NodeLink(_graph, null, null, null, null, null); 31 | 32 | Assert.DoesNotThrow(() => { 33 | var value = _link.IsValid; 34 | Assert.IsFalse(value); 35 | }); 36 | } 37 | } 38 | 39 | public class NextMethod : NodeLinkTest { 40 | [Test] 41 | public void It_should_return_its_child () { 42 | _child.IsValid.Returns(true); 43 | 44 | Assert.AreEqual(_child, _link.Next()); 45 | } 46 | 47 | [Test] 48 | public void It_should_not_return_its_child_if_invalid () { 49 | _child.IsValid.Returns(false); 50 | 51 | Assert.IsNull(_link.Next()); 52 | } 53 | } 54 | 55 | public class PlayMethod : NodeLinkTest { 56 | [Test] 57 | public void It_should_trigger_next_on_playback () { 58 | var playback = Substitute.For(); 59 | 60 | _link.Play(playback); 61 | 62 | playback.Received(1).Next(); 63 | } 64 | } 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /Assets/com.fluid.dialogue/Tests/Editor/Nodes/NodeLinkTest.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 90a52cc2c734413eb2d5452c27864005 3 | timeCreated: 1561135234 -------------------------------------------------------------------------------- /Assets/com.fluid.dialogue/Tests/Editor/Nodes/NodePlayGraphTest.cs: -------------------------------------------------------------------------------- 1 | using CleverCrow.Fluid.Dialogues.Graphs; 2 | using CleverCrow.Fluid.Dialogues.Nodes.PlayGraph; 3 | using NSubstitute; 4 | using NUnit.Framework; 5 | 6 | namespace CleverCrow.Fluid.Dialogues.Nodes { 7 | public class NodePlayGraphTest { 8 | public class PlayMethod { 9 | [Test] 10 | public void It_should_call_PlayChild_on_the_DialogueController () { 11 | var graph = Substitute.For(); 12 | var playGraph = new NodePlayGraph(null, null, graph, null, null, null, null); 13 | var playback = Substitute.For(); 14 | 15 | playGraph.Play(playback); 16 | 17 | playback.ParentCtrl.Received(1).PlayChild(graph); 18 | } 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /Assets/com.fluid.dialogue/Tests/Editor/Nodes/NodePlayGraphTest.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 93d4443b147e410490fea2c0bff2ce1b 3 | timeCreated: 1561153376 -------------------------------------------------------------------------------- /Assets/com.fluid.dialogue/Tests/Editor/Nodes/NodeRootTest.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using CleverCrow.Fluid.Dialogues.Builders; 3 | using NUnit.Framework; 4 | 5 | namespace CleverCrow.Fluid.Dialogues.Nodes { 6 | public class NodeRootTest { 7 | public class NextMethod { 8 | [Test] 9 | public void It_should_return_a_valid_child () { 10 | var node = A.Node.Build(); 11 | var nodeData = A.NodeData.WithNode(node).Build(); 12 | var children = new List { nodeData }; 13 | var graph = A.Graph.WithNode(nodeData).Build(); 14 | 15 | var root = new NodeRoot(graph, null, children, null, null, null); 16 | 17 | Assert.AreEqual(node, root.Next()); 18 | } 19 | 20 | [Test] 21 | public void It_should_not_return_an_invalid_child () { 22 | var child = A.Node.WithIsValid(false).Build(); 23 | var childData = A.NodeData.WithNode(child).Build(); 24 | var children = new List { childData }; 25 | var graph = A.Graph.WithNode(childData).Build(); 26 | 27 | var root = new NodeRoot(graph, null, children, null, null, null); 28 | 29 | Assert.AreEqual(null, root.Next()); 30 | } 31 | } 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /Assets/com.fluid.dialogue/Tests/Editor/Nodes/NodeRootTest.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c4018fa99e504492bb3d27604ec03ec4 3 | timeCreated: 1561070042 -------------------------------------------------------------------------------- /Assets/com.fluid.dialogue/Tests/Editor/Utilities.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 786876dd440e4c4e8492c9b69cb9e02c 3 | timeCreated: 1563655736 -------------------------------------------------------------------------------- /Assets/com.fluid.dialogue/Tests/Editor/Utilities/RectCleanerTest.cs: -------------------------------------------------------------------------------- 1 | using CleverCrow.Fluid.Dialogues.Editors; 2 | using NUnit.Framework; 3 | using UnityEngine; 4 | 5 | namespace FluidDialogue.Tests.Editor.Utilities { 6 | public class RectCleanerTest { 7 | public class Positions { 8 | [Test] 9 | public void It_should_do_nothing_to_a_normal_rect_position () { 10 | var rect = new Rect(0, 0, 10, 10); 11 | 12 | var result = rect.FixNegativeSize(); 13 | 14 | Assert.AreEqual(Vector2.zero, result.position); 15 | } 16 | 17 | [Test] 18 | public void It_should_adjust_axis_with_negative_size () { 19 | var rect = new Rect(0, 0, -10, -10); 20 | var expected = new Vector2(rect.x + rect.width, rect.y + rect.height); 21 | 22 | var result = rect.FixNegativeSize(); 23 | 24 | Assert.AreEqual(expected, result.position); 25 | } 26 | } 27 | 28 | public class Sizes { 29 | [Test] 30 | public void It_should_do_nothing_to_a_normal_rect_size () { 31 | var expectedSize = new Vector2(10, 10); 32 | var rect = new Rect(Vector2.zero, expectedSize); 33 | 34 | var result = rect.FixNegativeSize(); 35 | 36 | Assert.AreEqual(expectedSize, result.size); 37 | } 38 | 39 | [Test] 40 | public void It_should_reverse_negative_size () { 41 | var rect = new Rect(0, 0, -10, -10); 42 | var expectedSize = new Vector2( 43 | Mathf.Abs(rect.size.x), 44 | Mathf.Abs(rect.size.y)); 45 | 46 | var result = rect.FixNegativeSize(); 47 | 48 | Assert.AreEqual(expectedSize, result.size); 49 | } 50 | } 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /Assets/com.fluid.dialogue/Tests/Editor/Utilities/RectCleanerTest.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c78a71b4453d46e4bf498b3122d094db 3 | timeCreated: 1563655746 -------------------------------------------------------------------------------- /Assets/com.fluid.dialogue/Tests/Editor/com.fluid.dialogue.Editor.Tests.asmdef: -------------------------------------------------------------------------------- 1 | { 2 | "name": "com.fluid.dialogue.Editor.Tests", 3 | "references": [ 4 | "com.fluid.dialogue", 5 | "com.fluid.dialogue.Editor", 6 | "com.fluid.database", 7 | "com.fluid.unity-event-plus", 8 | "UnityEngine.TestRunner", 9 | "UnityEditor.TestRunner" 10 | ], 11 | "includePlatforms": [ 12 | "Editor" 13 | ], 14 | "excludePlatforms": [], 15 | "allowUnsafeCode": false, 16 | "overrideReferences": true, 17 | "precompiledReferences": [ 18 | "nunit.framework.dll", 19 | "NSubstitute.dll" 20 | ], 21 | "autoReferenced": false, 22 | "defineConstraints": [ 23 | "UNITY_INCLUDE_TESTS" 24 | ], 25 | "versionDefines": [] 26 | } -------------------------------------------------------------------------------- /Assets/com.fluid.dialogue/Tests/Editor/com.fluid.dialogue.Editor.Tests.asmdef.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 1cdefd57abfe06e499e1e6d2512982e6 3 | AssemblyDefinitionImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Assets/com.fluid.dialogue/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "com.fluid.dialogue", 3 | "version": "0.0.0", 4 | "displayName": "Fluid Dialogue", 5 | "description": "A Unity dialogue system that features an easy to use drag and drop graph. ScriptableObject driven with the ability to write custom actions and conditions to create complex dialogue workflows.", 6 | "unity": "2019.1", 7 | "dependencies": { 8 | "com.fluid.database": "2.1.0", 9 | "com.fluid.unity-event-plus": "1.2.0", 10 | "com.fluid.simple-spellcheck": "1.1.1", 11 | "com.fluid.find-and-replace": "1.0.1" 12 | }, 13 | "repository": { 14 | "type": "git", 15 | "url": "git+https://github.com/ashblue/fluid-dialogue.git" 16 | }, 17 | "license": "MIT", 18 | "bugs": { 19 | "url": "https://github.com/ashblue/fluid-dialogue/issues" 20 | }, 21 | "homepage": "https://github.com/ashblue/fluid-dialogue#readme", 22 | "keywords": [ 23 | "unity", 24 | "dialogue", 25 | "dialogue system" 26 | ], 27 | "author": { 28 | "name": "Ash Blue", 29 | "email": "ash@clevercrowgames.com", 30 | "url": "http://blueashes.com" 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /Assets/com.fluid.dialogue/package.json.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 4d19c1cc336223c4ab5b6a7b5839c91a 3 | TextScriptImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2019 Ash Blue 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /ProjectSettings/AudioManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!11 &1 4 | AudioManager: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 2 7 | m_Volume: 1 8 | Rolloff Scale: 1 9 | Doppler Factor: 1 10 | Default Speaker Mode: 2 11 | m_SampleRate: 0 12 | m_DSPBufferSize: 1024 13 | m_VirtualVoiceCount: 512 14 | m_RealVoiceCount: 32 15 | m_SpatializerPlugin: 16 | m_AmbisonicDecoderPlugin: 17 | m_DisableAudio: 0 18 | m_VirtualizeEffects: 1 19 | m_RequestedDSPBufferSize: 1024 20 | -------------------------------------------------------------------------------- /ProjectSettings/ClusterInputManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!236 &1 4 | ClusterInputManager: 5 | m_ObjectHideFlags: 0 6 | m_Inputs: [] 7 | -------------------------------------------------------------------------------- /ProjectSettings/DynamicsManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!55 &1 4 | PhysicsManager: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 11 7 | m_Gravity: {x: 0, y: -9.81, z: 0} 8 | m_DefaultMaterial: {fileID: 0} 9 | m_BounceThreshold: 2 10 | m_SleepThreshold: 0.005 11 | m_DefaultContactOffset: 0.01 12 | m_DefaultSolverIterations: 6 13 | m_DefaultSolverVelocityIterations: 1 14 | m_QueriesHitBackfaces: 0 15 | m_QueriesHitTriggers: 1 16 | m_EnableAdaptiveForce: 0 17 | m_ClothInterCollisionDistance: 0 18 | m_ClothInterCollisionStiffness: 0 19 | m_ContactsGeneration: 1 20 | m_LayerCollisionMatrix: ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff 21 | m_AutoSimulation: 1 22 | m_AutoSyncTransforms: 0 23 | m_ReuseCollisionCallbacks: 1 24 | m_ClothInterCollisionSettingsToggle: 0 25 | m_ContactPairsMode: 0 26 | m_BroadphaseType: 0 27 | m_WorldBounds: 28 | m_Center: {x: 0, y: 0, z: 0} 29 | m_Extent: {x: 250, y: 250, z: 250} 30 | m_WorldSubdivisions: 8 31 | m_FrictionType: 0 32 | m_EnableEnhancedDeterminism: 0 33 | m_EnableUnifiedHeightmaps: 1 34 | m_DefaultMaxAngluarSpeed: 7 35 | -------------------------------------------------------------------------------- /ProjectSettings/EditorBuildSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!1045 &1 4 | EditorBuildSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 2 7 | m_Scenes: [] 8 | m_configObjects: {} 9 | -------------------------------------------------------------------------------- /ProjectSettings/EditorSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!159 &1 4 | EditorSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 9 7 | m_ExternalVersionControlSupport: Visible Meta Files 8 | m_SerializationMode: 2 9 | m_LineEndingsForNewScripts: 2 10 | m_DefaultBehaviorMode: 0 11 | m_PrefabRegularEnvironment: {fileID: 0} 12 | m_PrefabUIEnvironment: {fileID: 0} 13 | m_SpritePackerMode: 0 14 | m_SpritePackerPaddingPower: 1 15 | m_EtcTextureCompressorBehavior: 1 16 | m_EtcTextureFastCompressor: 1 17 | m_EtcTextureNormalCompressor: 2 18 | m_EtcTextureBestCompressor: 4 19 | m_ProjectGenerationIncludedExtensions: txt;xml;fnt;cd;asmdef;rsp;asmref 20 | m_ProjectGenerationRootNamespace: 21 | m_CollabEditorSettings: 22 | inProgressEnabled: 1 23 | m_EnableTextureStreamingInEditMode: 1 24 | m_EnableTextureStreamingInPlayMode: 1 25 | m_AsyncShaderCompilation: 1 26 | m_EnterPlayModeOptionsEnabled: 0 27 | m_EnterPlayModeOptions: 3 28 | m_ShowLightmapResolutionOverlay: 1 29 | m_UseLegacyProbeSampleCount: 1 30 | m_AssetPipelineMode: 1 31 | m_CacheServerMode: 0 32 | m_CacheServerEndpoint: 33 | m_CacheServerNamespacePrefix: default 34 | m_CacheServerEnableDownload: 1 35 | m_CacheServerEnableUpload: 1 36 | -------------------------------------------------------------------------------- /ProjectSettings/MemorySettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!387306366 &1 4 | MemorySettings: 5 | m_ObjectHideFlags: 0 6 | m_EditorMemorySettings: 7 | m_MainAllocatorBlockSize: -1 8 | m_ThreadAllocatorBlockSize: -1 9 | m_MainGfxBlockSize: -1 10 | m_ThreadGfxBlockSize: -1 11 | m_CacheBlockSize: -1 12 | m_TypetreeBlockSize: -1 13 | m_ProfilerBlockSize: -1 14 | m_ProfilerEditorBlockSize: -1 15 | m_BucketAllocatorGranularity: -1 16 | m_BucketAllocatorBucketsCount: -1 17 | m_BucketAllocatorBlockSize: -1 18 | m_BucketAllocatorBlockCount: -1 19 | m_ProfilerBucketAllocatorGranularity: -1 20 | m_ProfilerBucketAllocatorBucketsCount: -1 21 | m_ProfilerBucketAllocatorBlockSize: -1 22 | m_ProfilerBucketAllocatorBlockCount: -1 23 | m_TempAllocatorSizeMain: -1 24 | m_JobTempAllocatorBlockSize: -1 25 | m_BackgroundJobTempAllocatorBlockSize: -1 26 | m_JobTempAllocatorReducedBlockSize: -1 27 | m_TempAllocatorSizeGIBakingWorker: -1 28 | m_TempAllocatorSizeNavMeshWorker: -1 29 | m_TempAllocatorSizeAudioWorker: -1 30 | m_TempAllocatorSizeCloudWorker: -1 31 | m_TempAllocatorSizeGfx: -1 32 | m_TempAllocatorSizeJobWorker: -1 33 | m_TempAllocatorSizeBackgroundWorker: -1 34 | m_TempAllocatorSizePreloadManager: -1 35 | m_PlatformMemorySettings: {} 36 | -------------------------------------------------------------------------------- /ProjectSettings/MultiplayerManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!655991488 &1 4 | MultiplayerManager: 5 | m_ObjectHideFlags: 0 6 | m_EnableMultiplayerRoles: 0 7 | m_ActiveMultiplayerRole: 0 8 | -------------------------------------------------------------------------------- /ProjectSettings/NavMeshAreas.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!126 &1 4 | NavMeshProjectSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 2 7 | areas: 8 | - name: Walkable 9 | cost: 1 10 | - name: Not Walkable 11 | cost: 1 12 | - name: Jump 13 | cost: 2 14 | - name: 15 | cost: 1 16 | - name: 17 | cost: 1 18 | - name: 19 | cost: 1 20 | - name: 21 | cost: 1 22 | - name: 23 | cost: 1 24 | - name: 25 | cost: 1 26 | - name: 27 | cost: 1 28 | - name: 29 | cost: 1 30 | - name: 31 | cost: 1 32 | - name: 33 | cost: 1 34 | - name: 35 | cost: 1 36 | - name: 37 | cost: 1 38 | - name: 39 | cost: 1 40 | - name: 41 | cost: 1 42 | - name: 43 | cost: 1 44 | - name: 45 | cost: 1 46 | - name: 47 | cost: 1 48 | - name: 49 | cost: 1 50 | - name: 51 | cost: 1 52 | - name: 53 | cost: 1 54 | - name: 55 | cost: 1 56 | - name: 57 | cost: 1 58 | - name: 59 | cost: 1 60 | - name: 61 | cost: 1 62 | - name: 63 | cost: 1 64 | - name: 65 | cost: 1 66 | - name: 67 | cost: 1 68 | - name: 69 | cost: 1 70 | - name: 71 | cost: 1 72 | m_LastAgentTypeID: -887442657 73 | m_Settings: 74 | - serializedVersion: 2 75 | agentTypeID: 0 76 | agentRadius: 0.5 77 | agentHeight: 2 78 | agentSlope: 45 79 | agentClimb: 0.75 80 | ledgeDropHeight: 0 81 | maxJumpAcrossDistance: 0 82 | minRegionArea: 2 83 | manualCellSize: 0 84 | cellSize: 0.16666667 85 | manualTileSize: 0 86 | tileSize: 256 87 | accuratePlacement: 0 88 | debug: 89 | m_Flags: 0 90 | m_SettingNames: 91 | - Humanoid 92 | -------------------------------------------------------------------------------- /ProjectSettings/PackageManagerSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!114 &1 4 | MonoBehaviour: 5 | m_ObjectHideFlags: 61 6 | m_CorrespondingSourceObject: {fileID: 0} 7 | m_PrefabInstance: {fileID: 0} 8 | m_PrefabAsset: {fileID: 0} 9 | m_GameObject: {fileID: 0} 10 | m_Enabled: 1 11 | m_EditorHideFlags: 0 12 | m_Script: {fileID: 13964, guid: 0000000000000000e000000000000000, type: 0} 13 | m_Name: 14 | m_EditorClassIdentifier: 15 | m_EnablePreReleasePackages: 0 16 | m_AdvancedSettingsExpanded: 1 17 | m_ScopedRegistriesSettingsExpanded: 1 18 | m_SeeAllPackageVersions: 0 19 | m_DismissPreviewPackagesInUse: 0 20 | oneTimeWarningShown: 0 21 | oneTimeDeprecatedPopUpShown: 0 22 | m_Registries: 23 | - m_Id: main 24 | m_Name: 25 | m_Url: https://packages.unity.com 26 | m_Scopes: [] 27 | m_IsDefault: 1 28 | m_Capabilities: 7 29 | m_ConfigSource: 0 30 | - m_Id: scoped:project:NPM 31 | m_Name: NPM 32 | m_Url: https://registry.npmjs.org 33 | m_Scopes: 34 | - clever-crow 35 | - com.fluid 36 | m_IsDefault: 0 37 | m_Capabilities: 0 38 | m_ConfigSource: 4 39 | m_UserSelectedRegistryName: NPM 40 | m_UserAddingNewScopedRegistry: 0 41 | m_RegistryInfoDraft: 42 | m_Modified: 0 43 | m_ErrorMessage: 44 | m_UserModificationsInstanceId: -850 45 | m_OriginalInstanceId: -854 46 | m_LoadAssets: 0 47 | -------------------------------------------------------------------------------- /ProjectSettings/Packages/com.unity.services.core/Settings.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ashblue/fluid-dialogue/6b48530bb195996f15bb2702bd0765aa6f676d7c/ProjectSettings/Packages/com.unity.services.core/Settings.json -------------------------------------------------------------------------------- /ProjectSettings/Physics2DSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!19 &1 4 | Physics2DSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 4 7 | m_Gravity: {x: 0, y: -9.81} 8 | m_DefaultMaterial: {fileID: 0} 9 | m_VelocityIterations: 8 10 | m_PositionIterations: 3 11 | m_VelocityThreshold: 1 12 | m_MaxLinearCorrection: 0.2 13 | m_MaxAngularCorrection: 8 14 | m_MaxTranslationSpeed: 100 15 | m_MaxRotationSpeed: 360 16 | m_BaumgarteScale: 0.2 17 | m_BaumgarteTimeOfImpactScale: 0.75 18 | m_TimeToSleep: 0.5 19 | m_LinearSleepTolerance: 0.01 20 | m_AngularSleepTolerance: 2 21 | m_DefaultContactOffset: 0.01 22 | m_JobOptions: 23 | serializedVersion: 2 24 | useMultithreading: 0 25 | useConsistencySorting: 0 26 | m_InterpolationPosesPerJob: 100 27 | m_NewContactsPerJob: 30 28 | m_CollideContactsPerJob: 100 29 | m_ClearFlagsPerJob: 200 30 | m_ClearBodyForcesPerJob: 200 31 | m_SyncDiscreteFixturesPerJob: 50 32 | m_SyncContinuousFixturesPerJob: 50 33 | m_FindNearestContactsPerJob: 100 34 | m_UpdateTriggerContactsPerJob: 100 35 | m_IslandSolverCostThreshold: 100 36 | m_IslandSolverBodyCostScale: 1 37 | m_IslandSolverContactCostScale: 10 38 | m_IslandSolverJointCostScale: 10 39 | m_IslandSolverBodiesPerJob: 50 40 | m_IslandSolverContactsPerJob: 50 41 | m_AutoSimulation: 1 42 | m_QueriesHitTriggers: 1 43 | m_QueriesStartInColliders: 1 44 | m_CallbacksOnDisable: 1 45 | m_ReuseCollisionCallbacks: 1 46 | m_AutoSyncTransforms: 0 47 | m_AlwaysShowColliders: 0 48 | m_ShowColliderSleep: 1 49 | m_ShowColliderContacts: 0 50 | m_ShowColliderAABB: 0 51 | m_ContactArrowScale: 0.2 52 | m_ColliderAwakeColor: {r: 0.5686275, g: 0.95686275, b: 0.54509807, a: 0.7529412} 53 | m_ColliderAsleepColor: {r: 0.5686275, g: 0.95686275, b: 0.54509807, a: 0.36078432} 54 | m_ColliderContactColor: {r: 1, g: 0, b: 1, a: 0.6862745} 55 | m_ColliderAABBColor: {r: 1, g: 1, b: 0, a: 0.2509804} 56 | m_LayerCollisionMatrix: ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff 57 | -------------------------------------------------------------------------------- /ProjectSettings/PresetManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!1386491679 &1 4 | PresetManager: 5 | m_ObjectHideFlags: 0 6 | m_DefaultList: [] 7 | -------------------------------------------------------------------------------- /ProjectSettings/ProjectVersion.txt: -------------------------------------------------------------------------------- 1 | m_EditorVersion: 2023.2.19f1 2 | m_EditorVersionWithRevision: 2023.2.19f1 (95c298372b1e) 3 | -------------------------------------------------------------------------------- /ProjectSettings/TagManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!78 &1 4 | TagManager: 5 | serializedVersion: 2 6 | tags: [] 7 | layers: 8 | - Default 9 | - TransparentFX 10 | - Ignore Raycast 11 | - 12 | - Water 13 | - UI 14 | - 15 | - 16 | - 17 | - 18 | - 19 | - 20 | - 21 | - 22 | - 23 | - 24 | - 25 | - 26 | - 27 | - 28 | - 29 | - 30 | - 31 | - 32 | - 33 | - 34 | - 35 | - 36 | - 37 | - 38 | - 39 | - 40 | m_SortingLayers: 41 | - name: Default 42 | uniqueID: 0 43 | locked: 0 44 | -------------------------------------------------------------------------------- /ProjectSettings/TimeManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!5 &1 4 | TimeManager: 5 | m_ObjectHideFlags: 0 6 | Fixed Timestep: 0.02 7 | Maximum Allowed Timestep: 0.33333334 8 | m_TimeScale: 1 9 | Maximum Particle Timestep: 0.03 10 | -------------------------------------------------------------------------------- /ProjectSettings/UnityConnectSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!310 &1 4 | UnityConnectSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 1 7 | m_Enabled: 1 8 | m_TestMode: 0 9 | m_EventOldUrl: https://api.uca.cloud.unity3d.com/v1/events 10 | m_EventUrl: https://cdp.cloud.unity3d.com/v1/events 11 | m_ConfigUrl: https://config.uca.cloud.unity3d.com 12 | m_TestInitMode: 0 13 | CrashReportingSettings: 14 | m_EventUrl: https://perf-events.cloud.unity3d.com 15 | m_Enabled: 0 16 | m_LogBufferSize: 10 17 | m_CaptureEditorExceptions: 1 18 | UnityPurchasingSettings: 19 | m_Enabled: 0 20 | m_TestMode: 0 21 | UnityAnalyticsSettings: 22 | m_Enabled: 0 23 | m_TestMode: 0 24 | m_InitializeOnStartup: 1 25 | UnityAdsSettings: 26 | m_Enabled: 0 27 | m_InitializeOnStartup: 1 28 | m_TestMode: 0 29 | m_IosGameId: 30 | m_AndroidGameId: 31 | m_GameIds: {} 32 | m_GameId: 33 | PerformanceReportingSettings: 34 | m_Enabled: 0 35 | -------------------------------------------------------------------------------- /ProjectSettings/VFXManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!937362698 &1 4 | VFXManager: 5 | m_ObjectHideFlags: 0 6 | m_IndirectShader: {fileID: 0} 7 | m_CopyBufferShader: {fileID: 0} 8 | m_SortShader: {fileID: 0} 9 | m_RenderPipeSettingsPath: 10 | m_FixedTimeStep: 0.016666668 11 | m_MaxDeltaTime: 0.05 12 | -------------------------------------------------------------------------------- /ProjectSettings/VersionControlSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!890905787 &1 4 | VersionControlSettings: 5 | m_ObjectHideFlags: 0 6 | m_Mode: Visible Meta Files 7 | m_CollabEditorSettings: 8 | inProgressEnabled: 1 9 | -------------------------------------------------------------------------------- /ProjectSettings/XRSettings.asset: -------------------------------------------------------------------------------- 1 | { 2 | "m_SettingKeys": [ 3 | "VR Device Disabled", 4 | "VR Device User Alert" 5 | ], 6 | "m_SettingValues": [ 7 | "False", 8 | "False" 9 | ] 10 | } -------------------------------------------------------------------------------- /UserSettings/EditorUserSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!162 &1 4 | EditorUserSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 4 7 | m_ConfigSettings: 8 | RecentlyUsedSceneGuid-0: 9 | value: 5a5757560101590a5d0c0e24427b5d44434e4c7a7b7a23677f2b4565b7b5353a 10 | flags: 0 11 | vcSharedLogLevel: 12 | value: 0d5e400f0650 13 | flags: 0 14 | m_VCAutomaticAdd: 1 15 | m_VCDebugCom: 0 16 | m_VCDebugCmd: 0 17 | m_VCDebugOut: 0 18 | m_SemanticMergeMode: 2 19 | m_DesiredImportWorkerCount: 4 20 | m_StandbyImportWorkerCount: 2 21 | m_IdleImportWorkerShutdownDelay: 60000 22 | m_VCShowFailedCheckout: 1 23 | m_VCOverwriteFailedCheckoutAssets: 1 24 | m_VCProjectOverlayIcons: 1 25 | m_VCHierarchyOverlayIcons: 1 26 | m_VCOtherOverlayIcons: 1 27 | m_VCAllowAsyncUpdate: 0 28 | m_ArtifactGarbageCollection: 1 29 | -------------------------------------------------------------------------------- /build.js: -------------------------------------------------------------------------------- 1 | const { populatePackage } = require('upm-package-populator'); 2 | 3 | populatePackage('.', 'Assets/com.fluid.dialogue'); 4 | -------------------------------------------------------------------------------- /com.fluid.dialogue.Editor.Tests.csproj.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 4f9d0243509f42cfa0b007d85095fc16 3 | timeCreated: 1580320885 -------------------------------------------------------------------------------- /com.fluid.dialogue.Editor.csproj.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 44bce29863084f7a84b66b4525802ac5 3 | timeCreated: 1580320885 -------------------------------------------------------------------------------- /com.fluid.dialogue.csproj.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 0491b5596fbb44efb66fa8130ec44b1e 3 | timeCreated: 1580320885 -------------------------------------------------------------------------------- /commitlint.config.js: -------------------------------------------------------------------------------- 1 | module.exports = {extends: ['@commitlint/config-conventional']}; 2 | -------------------------------------------------------------------------------- /docs/example-dialogue.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ashblue/fluid-dialogue/6b48530bb195996f15bb2702bd0765aa6f676d7c/docs/example-dialogue.png -------------------------------------------------------------------------------- /docs/send-message.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ashblue/fluid-dialogue/6b48530bb195996f15bb2702bd0765aa6f676d7c/docs/send-message.png -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "com.fluid.dialogue", 3 | "version": "0.0.0", 4 | "unity": "2019.1", 5 | "displayName": "Fluid Dialogue", 6 | "description": "A Unity dialogue system that features an easy to use drag and drop graph. ScriptableObject driven with the ability to write custom actions and conditions to create complex dialogue workflows.", 7 | "main": "build.js", 8 | "scripts": { 9 | "build": "node build.js", 10 | "semantic-release": "semantic-release", 11 | "commit": "git-cz", 12 | "prepare": "husky install" 13 | }, 14 | "keywords": [ 15 | "unity", 16 | "dialogue", 17 | "dialogue system" 18 | ], 19 | "repository": { 20 | "type": "git", 21 | "url": "git+https://github.com/ashblue/fluid-dialogue.git" 22 | }, 23 | "author": { 24 | "name": "Ash Blue", 25 | "email": "ash@clevercrowgames.com", 26 | "url": "http://blueashes.com" 27 | }, 28 | "license": "MIT", 29 | "bugs": { 30 | "url": "https://github.com/ashblue/fluid-dialogue/issues" 31 | }, 32 | "homepage": "https://github.com/ashblue/fluid-dialogue#readme", 33 | "devDependencies": { 34 | "@commitlint/cli": "~17.1.2", 35 | "@commitlint/config-conventional": "~17.1.0", 36 | "@semantic-release/changelog": "~6.0.1", 37 | "@semantic-release/commit-analyzer": "~9.0.2", 38 | "@semantic-release/exec": "~6.0.3", 39 | "@semantic-release/git": "~10.0.1", 40 | "@semantic-release/github": "~8.0.6", 41 | "@semantic-release/npm": "~9.0.1", 42 | "@semantic-release/release-notes-generator": "~10.0.3", 43 | "commitizen": "^4.2.5", 44 | "cz-conventional-changelog": "~3.3.0", 45 | "husky": "^8.0.1", 46 | "semantic-release": "~19.0.5", 47 | "upm-package-populator": "^2.0.0" 48 | }, 49 | "config": { 50 | "commitizen": { 51 | "path": "./node_modules/cz-conventional-changelog" 52 | } 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /publish-nightly.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | setup_git() { 4 | git config --global user.email "no-reply@github.com" 5 | git config --global user.name "Github-Actions[bot]" 6 | } 7 | 8 | update_nightly_branch() { 9 | printf "Run nightly update \n" 10 | git remote add origin-nightly "https://${GH_TOKEN}@github.com/ashblue/fluid-dialogue.git" 11 | git subtree split --prefix Assets/com.fluid.dialogue -b nightly 12 | git push -f origin-nightly nightly:nightly 13 | } 14 | 15 | setup_git 16 | update_nightly_branch 17 | --------------------------------------------------------------------------------