first commit
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
using NodeCanvas.Framework;
|
||||
using ParadoxNotion.Design;
|
||||
|
||||
|
||||
namespace NodeCanvas.Tasks.Conditions
|
||||
{
|
||||
|
||||
[Category("✫ Blackboard")]
|
||||
public class CheckBoolean : ConditionTask
|
||||
{
|
||||
|
||||
[BlackboardOnly]
|
||||
public BBParameter<bool> valueA;
|
||||
public BBParameter<bool> valueB = true;
|
||||
|
||||
protected override string info {
|
||||
get { return valueA + " == " + valueB; }
|
||||
}
|
||||
|
||||
protected override bool OnCheck() {
|
||||
|
||||
return valueA.value == valueB.value;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 30c7d93969f69c2498ca58567bebf9ba
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 14914
|
||||
packageName: NodeCanvas
|
||||
packageVersion: 3.3.1
|
||||
assetPath: Assets/ParadoxNotion/NodeCanvas/Tasks/Conditions/Blackboard/CheckBoolean.cs
|
||||
uploadId: 704937
|
||||
@@ -0,0 +1,28 @@
|
||||
using NodeCanvas.Framework;
|
||||
using ParadoxNotion.Design;
|
||||
|
||||
|
||||
namespace NodeCanvas.Tasks.Conditions
|
||||
{
|
||||
|
||||
[Category("✫ Blackboard")]
|
||||
[Description("Check if a boolean variable is true and if so, it is immediately reset to false.")]
|
||||
public class CheckBooleanTrigger : ConditionTask
|
||||
{
|
||||
|
||||
[BlackboardOnly]
|
||||
public BBParameter<bool> trigger;
|
||||
|
||||
protected override string info {
|
||||
get { return string.Format("Trigger {0}", trigger); }
|
||||
}
|
||||
|
||||
protected override bool OnCheck() {
|
||||
if ( trigger.value ) {
|
||||
trigger.value = false;
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
fileFormatVersion: 2
|
||||
guid: db4e7f34bdfd6094c9f5fd9d4a0ac7b9
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 14914
|
||||
packageName: NodeCanvas
|
||||
packageVersion: 3.3.1
|
||||
assetPath: Assets/ParadoxNotion/NodeCanvas/Tasks/Conditions/Blackboard/CheckBooleanTrigger.cs
|
||||
uploadId: 704937
|
||||
@@ -0,0 +1,36 @@
|
||||
using NodeCanvas.Framework;
|
||||
using NodeCanvas.Framework.Internal;
|
||||
using ParadoxNotion.Design;
|
||||
|
||||
|
||||
namespace NodeCanvas.Tasks.Conditions
|
||||
{
|
||||
|
||||
[Category("✫ Blackboard")]
|
||||
public class CheckEnum : ConditionTask
|
||||
{
|
||||
|
||||
[BlackboardOnly]
|
||||
public BBObjectParameter valueA = new BBObjectParameter(typeof(System.Enum));
|
||||
public BBObjectParameter valueB = new BBObjectParameter(typeof(System.Enum));
|
||||
|
||||
protected override string info {
|
||||
get { return valueA + " == " + valueB; }
|
||||
}
|
||||
|
||||
protected override bool OnCheck() {
|
||||
return Equals(valueA.value, valueB.value);
|
||||
}
|
||||
|
||||
///----------------------------------------------------------------------------------------------
|
||||
///---------------------------------------UNITY EDITOR-------------------------------------------
|
||||
#if UNITY_EDITOR
|
||||
|
||||
protected override void OnTaskInspectorGUI() {
|
||||
DrawDefaultInspector();
|
||||
if ( valueB.varType != valueA.refType ) { valueB.SetType(valueA.refType); }
|
||||
}
|
||||
|
||||
#endif
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
fileFormatVersion: 2
|
||||
guid: c6fad112a61560e448dc29a11d8cb549
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 14914
|
||||
packageName: NodeCanvas
|
||||
packageVersion: 3.3.1
|
||||
assetPath: Assets/ParadoxNotion/NodeCanvas/Tasks/Conditions/Blackboard/CheckEnum.cs
|
||||
uploadId: 704937
|
||||
@@ -0,0 +1,29 @@
|
||||
using System;
|
||||
using NodeCanvas.Framework;
|
||||
using NodeCanvas.Framework.Internal;
|
||||
using ParadoxNotion.Design;
|
||||
|
||||
[Category("✫ Blackboard")]
|
||||
public class CheckEnumFlag : ConditionTask
|
||||
{
|
||||
[BlackboardOnly]
|
||||
[RequiredField]
|
||||
public readonly BBObjectParameter Variable = new BBObjectParameter(typeof(Enum));
|
||||
|
||||
public readonly BBObjectParameter Flag = new BBObjectParameter(typeof(Enum));
|
||||
|
||||
protected override string info => $"{Variable} has {Flag} flag";
|
||||
|
||||
protected override bool OnCheck() => ((Enum)Variable.value).HasFlag((Enum)Flag.value);
|
||||
|
||||
#if UNITY_EDITOR
|
||||
|
||||
protected override void OnTaskInspectorGUI()
|
||||
{
|
||||
DrawDefaultInspector();
|
||||
|
||||
if (Flag.varType != Variable.refType) Flag.SetType(Variable.refType);
|
||||
}
|
||||
|
||||
#endif
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 74d9a3ba0701dd34e856bb15db85427b
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 14914
|
||||
packageName: NodeCanvas
|
||||
packageVersion: 3.3.1
|
||||
assetPath: Assets/ParadoxNotion/NodeCanvas/Tasks/Conditions/Blackboard/CheckEnumFlag.cs
|
||||
uploadId: 704937
|
||||
@@ -0,0 +1,29 @@
|
||||
using NodeCanvas.Framework;
|
||||
using ParadoxNotion;
|
||||
using ParadoxNotion.Design;
|
||||
|
||||
|
||||
namespace NodeCanvas.Tasks.Conditions
|
||||
{
|
||||
|
||||
[Category("✫ Blackboard")]
|
||||
public class CheckFloat : ConditionTask
|
||||
{
|
||||
|
||||
[BlackboardOnly]
|
||||
public BBParameter<float> valueA;
|
||||
public CompareMethod checkType = CompareMethod.EqualTo;
|
||||
public BBParameter<float> valueB;
|
||||
|
||||
[SliderField(0, 0.1f)]
|
||||
public float differenceThreshold = 0.05f;
|
||||
|
||||
protected override string info {
|
||||
get { return valueA + OperationTools.GetCompareString(checkType) + valueB; }
|
||||
}
|
||||
|
||||
protected override bool OnCheck() {
|
||||
return OperationTools.Compare((float)valueA.value, (float)valueB.value, checkType, differenceThreshold);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 71df5e640f84c9845837ce31e6cdebdb
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 14914
|
||||
packageName: NodeCanvas
|
||||
packageVersion: 3.3.1
|
||||
assetPath: Assets/ParadoxNotion/NodeCanvas/Tasks/Conditions/Blackboard/CheckFloat.cs
|
||||
uploadId: 704937
|
||||
@@ -0,0 +1,26 @@
|
||||
using NodeCanvas.Framework;
|
||||
using ParadoxNotion;
|
||||
using ParadoxNotion.Design;
|
||||
|
||||
|
||||
namespace NodeCanvas.Tasks.Conditions
|
||||
{
|
||||
|
||||
[Category("✫ Blackboard")]
|
||||
public class CheckInt : ConditionTask
|
||||
{
|
||||
|
||||
[BlackboardOnly]
|
||||
public BBParameter<int> valueA;
|
||||
public CompareMethod checkType = CompareMethod.EqualTo;
|
||||
public BBParameter<int> valueB;
|
||||
|
||||
protected override string info {
|
||||
get { return valueA + OperationTools.GetCompareString(checkType) + valueB; }
|
||||
}
|
||||
|
||||
protected override bool OnCheck() {
|
||||
return OperationTools.Compare((int)valueA.value, (int)valueB.value, checkType);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 5eb629b285320f84c848b226e1d259ca
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 14914
|
||||
packageName: NodeCanvas
|
||||
packageVersion: 3.3.1
|
||||
assetPath: Assets/ParadoxNotion/NodeCanvas/Tasks/Conditions/Blackboard/CheckInt.cs
|
||||
uploadId: 704937
|
||||
@@ -0,0 +1,24 @@
|
||||
using NodeCanvas.Framework;
|
||||
using ParadoxNotion.Design;
|
||||
|
||||
|
||||
namespace NodeCanvas.Tasks.Conditions
|
||||
{
|
||||
|
||||
[Category("✫ Blackboard")]
|
||||
[Description("Check whether or not a variable is null")]
|
||||
public class CheckNull : ConditionTask
|
||||
{
|
||||
|
||||
[BlackboardOnly]
|
||||
public BBParameter<System.Object> variable;
|
||||
|
||||
protected override string info {
|
||||
get { return variable + " == null"; }
|
||||
}
|
||||
|
||||
protected override bool OnCheck() {
|
||||
return ParadoxNotion.ObjectUtils.AnyEquals(variable.value, null);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
fileFormatVersion: 2
|
||||
guid: ce98eb096d2095c428751cef230777e2
|
||||
timeCreated: 1426526308
|
||||
licenseType: Store
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 14914
|
||||
packageName: NodeCanvas
|
||||
packageVersion: 3.3.1
|
||||
assetPath: Assets/ParadoxNotion/NodeCanvas/Tasks/Conditions/Blackboard/CheckNull.cs
|
||||
uploadId: 704937
|
||||
@@ -0,0 +1,24 @@
|
||||
using NodeCanvas.Framework;
|
||||
using ParadoxNotion.Design;
|
||||
|
||||
|
||||
namespace NodeCanvas.Tasks.Conditions
|
||||
{
|
||||
|
||||
[Category("✫ Blackboard")]
|
||||
public class CheckString : ConditionTask
|
||||
{
|
||||
|
||||
[BlackboardOnly]
|
||||
public BBParameter<string> valueA;
|
||||
public BBParameter<string> valueB;
|
||||
|
||||
protected override string info {
|
||||
get { return valueA + " == " + valueB; }
|
||||
}
|
||||
|
||||
protected override bool OnCheck() {
|
||||
return valueA.value == valueB.value;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 5b0392f1b31c6bd43b7049cdc4fa0019
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 14914
|
||||
packageName: NodeCanvas
|
||||
packageVersion: 3.3.1
|
||||
assetPath: Assets/ParadoxNotion/NodeCanvas/Tasks/Conditions/Blackboard/CheckString.cs
|
||||
uploadId: 704937
|
||||
@@ -0,0 +1,25 @@
|
||||
using NodeCanvas.Framework;
|
||||
using ParadoxNotion.Design;
|
||||
|
||||
|
||||
namespace NodeCanvas.Tasks.Conditions
|
||||
{
|
||||
|
||||
[Category("✫ Blackboard")]
|
||||
[System.Obsolete("Use CheckVariable(T)")]
|
||||
public class CheckUnityObject : ConditionTask
|
||||
{
|
||||
|
||||
[BlackboardOnly]
|
||||
public BBParameter<UnityEngine.Object> valueA;
|
||||
public BBParameter<UnityEngine.Object> valueB;
|
||||
|
||||
protected override string info {
|
||||
get { return valueA + " == " + valueB; }
|
||||
}
|
||||
|
||||
protected override bool OnCheck() {
|
||||
return valueA.value == valueB.value;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
fileFormatVersion: 2
|
||||
guid: abc2c3ffc8679a346a30f6cb197e0bd9
|
||||
timeCreated: 1426526308
|
||||
licenseType: Store
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 14914
|
||||
packageName: NodeCanvas
|
||||
packageVersion: 3.3.1
|
||||
assetPath: Assets/ParadoxNotion/NodeCanvas/Tasks/Conditions/Blackboard/CheckUnityObject.cs
|
||||
uploadId: 704937
|
||||
@@ -0,0 +1,25 @@
|
||||
using NodeCanvas.Framework;
|
||||
using ParadoxNotion;
|
||||
using ParadoxNotion.Design;
|
||||
|
||||
namespace NodeCanvas.Tasks.Conditions
|
||||
{
|
||||
|
||||
[Category("✫ Blackboard")]
|
||||
[Description("It's best to use the respective Condition for a type if existant since they support operations as well")]
|
||||
public class CheckVariable<T> : ConditionTask
|
||||
{
|
||||
|
||||
[BlackboardOnly]
|
||||
public BBParameter<T> valueA;
|
||||
public BBParameter<T> valueB;
|
||||
|
||||
protected override string info {
|
||||
get { return valueA + " == " + valueB; }
|
||||
}
|
||||
|
||||
protected override bool OnCheck() {
|
||||
return ObjectUtils.AnyEquals(valueA.value, valueB.value);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 236198dd654292446b6ac9702834864d
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 14914
|
||||
packageName: NodeCanvas
|
||||
packageVersion: 3.3.1
|
||||
assetPath: Assets/ParadoxNotion/NodeCanvas/Tasks/Conditions/Blackboard/CheckVariable.cs
|
||||
uploadId: 704937
|
||||
@@ -0,0 +1,29 @@
|
||||
using NodeCanvas.Framework;
|
||||
using ParadoxNotion;
|
||||
using ParadoxNotion.Design;
|
||||
using UnityEngine;
|
||||
|
||||
namespace NodeCanvas.Tasks.Conditions
|
||||
{
|
||||
|
||||
[Category("✫ Blackboard")]
|
||||
public class CheckVectorDistance : ConditionTask
|
||||
{
|
||||
|
||||
[BlackboardOnly]
|
||||
public BBParameter<Vector3> vectorA;
|
||||
[BlackboardOnly]
|
||||
public BBParameter<Vector3> vectorB;
|
||||
public CompareMethod comparison = CompareMethod.EqualTo;
|
||||
public BBParameter<float> distance;
|
||||
|
||||
protected override string info {
|
||||
get { return string.Format("Distance ({0}, {1}) {2} {3}", vectorA, vectorB, OperationTools.GetCompareString(comparison), distance); }
|
||||
}
|
||||
|
||||
protected override bool OnCheck() {
|
||||
var d = Vector3.Distance(vectorA.value, vectorB.value);
|
||||
return OperationTools.Compare((float)d, (float)distance.value, comparison, 0f);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 84a093587aae2c34baed0954a5b627f2
|
||||
timeCreated: 1506035589
|
||||
licenseType: Store
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 14914
|
||||
packageName: NodeCanvas
|
||||
packageVersion: 3.3.1
|
||||
assetPath: Assets/ParadoxNotion/NodeCanvas/Tasks/Conditions/Blackboard/CheckVectorDistance.cs
|
||||
uploadId: 704937
|
||||
@@ -0,0 +1,9 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 04209ce429981cd4a8b4b401166b30b6
|
||||
folderAsset: yes
|
||||
timeCreated: 1508932206
|
||||
licenseType: Store
|
||||
DefaultImporter:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,39 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using NodeCanvas.Framework;
|
||||
using ParadoxNotion.Design;
|
||||
|
||||
namespace NodeCanvas.Tasks.Conditions
|
||||
{
|
||||
|
||||
[Category("✫ Blackboard/Dictionaries")]
|
||||
public class TryGetValue<T> : ConditionTask
|
||||
{
|
||||
|
||||
[RequiredField]
|
||||
[BlackboardOnly]
|
||||
public BBParameter<Dictionary<string, T>> targetDictionary;
|
||||
[RequiredField]
|
||||
public BBParameter<string> key;
|
||||
[BlackboardOnly]
|
||||
public BBParameter<T> saveValueAs;
|
||||
|
||||
protected override string info {
|
||||
get { return string.Format("{0}.TryGetValue({1} as {2})", targetDictionary, key, saveValueAs); }
|
||||
}
|
||||
|
||||
protected override bool OnCheck() {
|
||||
if ( targetDictionary.value == null ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
T result;
|
||||
if ( targetDictionary.value.TryGetValue(key.value, out result) ) {
|
||||
saveValueAs.value = result;
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 23a553d2db12b1a42a75b68abd94988f
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 14914
|
||||
packageName: NodeCanvas
|
||||
packageVersion: 3.3.1
|
||||
assetPath: Assets/ParadoxNotion/NodeCanvas/Tasks/Conditions/Blackboard/Dictionaries/TryGetValue.cs
|
||||
uploadId: 704937
|
||||
@@ -0,0 +1,9 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 6074a1b42a5b07142aa489e2c1dcd57c
|
||||
folderAsset: yes
|
||||
timeCreated: 1508932200
|
||||
licenseType: Store
|
||||
DefaultImporter:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,27 @@
|
||||
using System.Collections.Generic;
|
||||
using NodeCanvas.Framework;
|
||||
using ParadoxNotion.Design;
|
||||
|
||||
|
||||
namespace NodeCanvas.Tasks.Conditions
|
||||
{
|
||||
|
||||
[Category("✫ Blackboard/Lists")]
|
||||
[Description("Check if an element is contained in the target list")]
|
||||
public class ListContainsElement<T> : ConditionTask
|
||||
{
|
||||
|
||||
[RequiredField]
|
||||
[BlackboardOnly]
|
||||
public BBParameter<List<T>> targetList;
|
||||
public BBParameter<T> checkElement;
|
||||
|
||||
protected override string info {
|
||||
get { return targetList + " contains " + checkElement; }
|
||||
}
|
||||
|
||||
protected override bool OnCheck() {
|
||||
return targetList.value.Contains(checkElement.value);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 8f0b93561b5e9f74283301345e027722
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 14914
|
||||
packageName: NodeCanvas
|
||||
packageVersion: 3.3.1
|
||||
assetPath: Assets/ParadoxNotion/NodeCanvas/Tasks/Conditions/Blackboard/Lists/ListContainsElement.cs
|
||||
uploadId: 704937
|
||||
@@ -0,0 +1,25 @@
|
||||
using System.Collections;
|
||||
using NodeCanvas.Framework;
|
||||
using ParadoxNotion.Design;
|
||||
|
||||
|
||||
namespace NodeCanvas.Tasks.Conditions
|
||||
{
|
||||
|
||||
[Category("✫ Blackboard/Lists")]
|
||||
public class ListIsEmpty : ConditionTask
|
||||
{
|
||||
|
||||
[RequiredField]
|
||||
[BlackboardOnly]
|
||||
public BBParameter<IList> targetList;
|
||||
|
||||
protected override string info {
|
||||
get { return string.Format("{0} Is Empty", targetList); }
|
||||
}
|
||||
|
||||
protected override bool OnCheck() {
|
||||
return targetList.value.Count == 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 2259ad95d8dfb954a9ed58401aa95a21
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 14914
|
||||
packageName: NodeCanvas
|
||||
packageVersion: 3.3.1
|
||||
assetPath: Assets/ParadoxNotion/NodeCanvas/Tasks/Conditions/Blackboard/Lists/ListIsEmpty.cs
|
||||
uploadId: 704937
|
||||
@@ -0,0 +1,39 @@
|
||||
using NodeCanvas.Framework;
|
||||
using NodeCanvas.Framework.Internal;
|
||||
using ParadoxNotion.Design;
|
||||
|
||||
namespace NodeCanvas.Tasks.Conditions
|
||||
{
|
||||
[Name("On Variable Changed")]
|
||||
[Category("✫ Blackboard")]
|
||||
public class BBVariableChanged : ConditionTask
|
||||
{
|
||||
|
||||
[BlackboardOnly] public BBObjectParameter targetVariable;
|
||||
|
||||
protected override string info {
|
||||
get { return targetVariable + " Changed."; }
|
||||
}
|
||||
|
||||
protected override string OnInit() {
|
||||
if ( targetVariable.isNone ) {
|
||||
return "Blackboard Variable not set.";
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
protected override void OnEnable() {
|
||||
targetVariable.varRef.onValueChanged += OnValueChanged;
|
||||
}
|
||||
|
||||
protected override void OnDisable() {
|
||||
targetVariable.varRef.onValueChanged -= OnValueChanged;
|
||||
}
|
||||
|
||||
protected override bool OnCheck() { return false; }
|
||||
|
||||
private void OnValueChanged(object varValue) {
|
||||
YieldReturn(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 1ff196daaad5993488b31a0ebb9207d7
|
||||
timeCreated: 1517683305
|
||||
licenseType: Store
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 14914
|
||||
packageName: NodeCanvas
|
||||
packageVersion: 3.3.1
|
||||
assetPath: Assets/ParadoxNotion/NodeCanvas/Tasks/Conditions/Blackboard/OnVariableChange.cs
|
||||
uploadId: 704937
|
||||
@@ -0,0 +1,25 @@
|
||||
using NodeCanvas.Framework;
|
||||
using ParadoxNotion.Design;
|
||||
|
||||
|
||||
namespace NodeCanvas.Tasks.Conditions
|
||||
{
|
||||
|
||||
[Category("✫ Blackboard")]
|
||||
public class StringContains : ConditionTask
|
||||
{
|
||||
|
||||
[RequiredField]
|
||||
[BlackboardOnly]
|
||||
public BBParameter<string> targetString;
|
||||
public BBParameter<string> checkString;
|
||||
|
||||
protected override string info {
|
||||
get { return string.Format("{0} Contains {1}", targetString, checkString); }
|
||||
}
|
||||
|
||||
protected override bool OnCheck() {
|
||||
return targetString.value.Contains(checkString.value);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
fileFormatVersion: 2
|
||||
guid: b47ef073f9055bb45998448f1854c372
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 14914
|
||||
packageName: NodeCanvas
|
||||
packageVersion: 3.3.1
|
||||
assetPath: Assets/ParadoxNotion/NodeCanvas/Tasks/Conditions/Blackboard/StringContains.cs
|
||||
uploadId: 704937
|
||||
Reference in New Issue
Block a user