Skip to content

Commit

Permalink
Merge branch 'feature/fix-for-missing-actions' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
ashblue committed Jan 1, 2020
2 parents 3b1b3c8 + 49bdd34 commit 7e422d5
Show file tree
Hide file tree
Showing 12 changed files with 93 additions and 48 deletions.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 18 additions & 2 deletions Assets/Examples/BasicConversation/ExampleConversation.asset
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,21 @@ MonoBehaviour:
choices: []
actor: {fileID: 11400000, guid: d6a8e0fd1eb801d4ca00320f6b2e9e8b, type: 2}
dialogue: What of the king's enemies. They said they'd send reinforcements.
--- !u!114 &-7811679642350466681
MonoBehaviour:
m_ObjectHideFlags: 1
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 949d12ec87ffe584496e1a35ca4c038f, type: 3}
m_Name: ExampleAction
m_EditorClassIdentifier:
_title: ExampleAction
_uniqueId: e12b3421-1683-4814-b40e-28a913c61d5c
_text: Example action ran
--- !u!114 &-7347677369531188231
MonoBehaviour:
m_ObjectHideFlags: 0
Expand Down Expand Up @@ -410,7 +425,7 @@ MonoBehaviour:
- {fileID: -1807495471838374980}
- {fileID: -7347677369531188231}
root: {fileID: 426936237664981933}
scrollPosition: {x: 51823.676, y: 50046}
scrollPosition: {x: 49972.676, y: 49968}
--- !u!114 &373158185418196577
MonoBehaviour:
m_ObjectHideFlags: 0
Expand Down Expand Up @@ -650,7 +665,8 @@ MonoBehaviour:
children:
- {fileID: 373158185418196577}
conditions: []
enterActions: []
enterActions:
- {fileID: -7811679642350466681}
exitActions: []
choices: []
actor: {fileID: 11400000, guid: aebb863e25cae0a4495c09b6a617ecf6, type: 2}
Expand Down
13 changes: 13 additions & 0 deletions Assets/Examples/ExampleAction.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
using CleverCrow.Fluid.Dialogues.Actions;
using UnityEngine;

namespace CleverCrow.Fluid.Dialogues.Examples {
[CreateMenu("Example/Action")]
public class ExampleAction : ActionDataBase {
[SerializeField] private string _text;

public override void OnStart () {
Debug.Log(_text);
}
}
}
11 changes: 11 additions & 0 deletions Assets/Examples/ExampleAction.cs.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 0 additions & 8 deletions Assets/Plugins.meta

This file was deleted.

8 changes: 0 additions & 8 deletions Assets/Plugins/Editor.meta

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using UnityEngine;

namespace CleverCrow.Fluid.Dialogues.Editors.Inspectors {
public class TypesToMenu<T> {
Expand All @@ -18,19 +19,21 @@ public TypesToMenu () {
}

private static List<TypeEntry> GetTypeEntries () {
return Assembly
.GetAssembly(typeof(T))
.GetTypes()
.Where(t => t.IsSubclassOf(typeof(T)) && !t.IsAbstract)
.Select(t => {
var attr = t.GetCustomAttribute<CreateMenuAttribute>();
var list = new List<TypeEntry>();
foreach (var assembly in AppDomain.CurrentDomain.GetAssemblies()) {
foreach (var type in assembly.GetTypes()) {
if (!type.IsSubclassOf(typeof(T)) || type.IsAbstract) continue;
var attr = type.GetCustomAttribute<CreateMenuAttribute>();

return new TypeEntry {
type = t,
path = attr?.Path ?? t.FullName,
list.Add(new TypeEntry {
type = type,
path = attr?.Path ?? type.FullName,
priority = attr?.Priority ?? 0,
};
})
});
}
}

return list
.OrderByDescending(t => t.priority)
.ToList();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ public class HubChoicesProperty : NodeChoiceHubTest {
[Test]
public void It_should_return_choices_with_a_valid_child_node () {
var choice = Substitute.For<IChoice>();
choice.IsValid.Returns(true);
choice.GetValidChildNode()
.Returns(x => A.Node.Build());
_choiceList.Add(choice);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,23 @@
"com.fluid.dialogue",
"com.fluid.dialogue.Editor",
"com.fluid.database",
"com.fluid.unity-event-plus"
],
"optionalUnityReferences": [
"TestAssemblies"
"com.fluid.unity-event-plus",
"UnityEngine.TestRunner",
"UnityEditor.TestRunner"
],
"includePlatforms": [
"Editor"
],
"excludePlatforms": [],
"allowUnsafeCode": false,
"overrideReferences": false,
"precompiledReferences": [],
"autoReferenced": true,
"defineConstraints": []
}
"overrideReferences": true,
"precompiledReferences": [
"nunit.framework.dll",
"NSubstitute.dll"
],
"autoReferenced": false,
"defineConstraints": [
"UNITY_INCLUDE_TESTS"
],
"versionDefines": []
}
12 changes: 10 additions & 2 deletions Packages/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,22 @@
"clever-crow.nsubstitute": "2.0.3",
"com.fluid.database": "2.0.0",
"com.fluid.unity-event-plus": "1.1.0",
"com.unity.2d.sprite": "1.0.0",
"com.unity.2d.tilemap": "1.0.0",
"com.unity.ads": "2.0.8",
"com.unity.analytics": "3.3.2",
"com.unity.collab-proxy": "1.2.16",
"com.unity.package-manager-ui": "2.1.2",
"com.unity.ext.nunit": "1.0.0",
"com.unity.ide.rider": "1.1.0",
"com.unity.ide.vscode": "1.1.3",
"com.unity.package-manager-ui": "2.2.0",
"com.unity.purchasing": "2.0.6",
"com.unity.test-framework": "1.0.13",
"com.unity.textmeshpro": "2.0.1",
"com.unity.timeline": "1.0.0",
"com.unity.timeline": "1.1.0",
"com.unity.ugui": "1.0.0",
"com.unity.modules.ai": "1.0.0",
"com.unity.modules.androidjni": "1.0.0",
"com.unity.modules.animation": "1.0.0",
"com.unity.modules.assetbundle": "1.0.0",
"com.unity.modules.audio": "1.0.0",
Expand Down
4 changes: 2 additions & 2 deletions ProjectSettings/ProjectVersion.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
m_EditorVersion: 2019.1.14f1
m_EditorVersionWithRevision: 2019.1.14f1 (148b5891095a)
m_EditorVersion: 2019.2.17f1
m_EditorVersionWithRevision: 2019.2.17f1 (8e603399ca02)

0 comments on commit 7e422d5

Please sign in to comment.