first commit
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: faf0b915d6a88f6439750f26c8576c33
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
userData:
|
||||
@@ -0,0 +1,111 @@
|
||||
using NodeCanvas.Framework;
|
||||
using ParadoxNotion;
|
||||
using ParadoxNotion.Design;
|
||||
using UnityEngine;
|
||||
|
||||
|
||||
namespace NodeCanvas.Tasks.Actions
|
||||
{
|
||||
|
||||
[Category("Animation")]
|
||||
public class PlayAnimationAdvanced : ActionTask<Animation>
|
||||
{
|
||||
|
||||
[RequiredField]
|
||||
public BBParameter<AnimationClip> animationClip;
|
||||
public WrapMode animationWrap;
|
||||
public AnimationBlendMode blendMode;
|
||||
[SliderField(0, 2)]
|
||||
public float playbackSpeed = 1;
|
||||
[SliderField(0, 1)]
|
||||
public float crossFadeTime = 0.25f;
|
||||
public PlayDirections playDirection = PlayDirections.Forward;
|
||||
public BBParameter<string> mixTransformName;
|
||||
public BBParameter<int> animationLayer;
|
||||
public bool queueAnimation;
|
||||
public bool waitActionFinish = true;
|
||||
|
||||
private string animationToPlay = string.Empty;
|
||||
private int dir = -1;
|
||||
private Transform mixTransform;
|
||||
|
||||
protected override string info {
|
||||
get { return "Anim " + animationClip.ToString(); }
|
||||
}
|
||||
|
||||
protected override string OnInit() {
|
||||
agent.AddClip(animationClip.value, animationClip.value.name);
|
||||
animationClip.value.legacy = true;
|
||||
return null;
|
||||
}
|
||||
|
||||
protected override void OnExecute() {
|
||||
|
||||
if ( playDirection == PlayDirections.Toggle )
|
||||
dir = -dir;
|
||||
|
||||
if ( playDirection == PlayDirections.Backward )
|
||||
dir = -1;
|
||||
|
||||
if ( playDirection == PlayDirections.Forward )
|
||||
dir = 1;
|
||||
|
||||
agent.AddClip(animationClip.value, animationClip.value.name);
|
||||
animationToPlay = animationClip.value.name;
|
||||
|
||||
if ( !string.IsNullOrEmpty(mixTransformName.value) ) {
|
||||
mixTransform = FindTransform(agent.transform, mixTransformName.value);
|
||||
if ( !mixTransform ) {
|
||||
ParadoxNotion.Services.Logger.LogWarning("Cant find transform with name '" + mixTransformName.value + "' for PlayAnimation Action", LogTag.EXECUTION, this);
|
||||
}
|
||||
|
||||
} else {
|
||||
mixTransform = null;
|
||||
}
|
||||
|
||||
animationToPlay = animationClip.value.name;
|
||||
|
||||
if ( mixTransform ) {
|
||||
agent[animationToPlay].AddMixingTransform(mixTransform, true);
|
||||
}
|
||||
|
||||
agent[animationToPlay].layer = animationLayer.value;
|
||||
agent[animationToPlay].speed = dir * playbackSpeed;
|
||||
agent[animationToPlay].normalizedTime = Mathf.Clamp01(-dir);
|
||||
agent[animationToPlay].wrapMode = animationWrap;
|
||||
agent[animationToPlay].blendMode = blendMode;
|
||||
|
||||
if ( queueAnimation ) {
|
||||
agent.CrossFadeQueued(animationToPlay, crossFadeTime);
|
||||
} else {
|
||||
agent.CrossFade(animationToPlay, crossFadeTime);
|
||||
}
|
||||
|
||||
if ( !waitActionFinish ) {
|
||||
EndAction(true);
|
||||
}
|
||||
}
|
||||
|
||||
protected override void OnUpdate() {
|
||||
|
||||
if ( elapsedTime >= ( agent[animationToPlay].length / playbackSpeed ) - crossFadeTime ) {
|
||||
EndAction(true);
|
||||
}
|
||||
}
|
||||
|
||||
Transform FindTransform(Transform parent, string name) {
|
||||
|
||||
if ( parent.name == name )
|
||||
return parent;
|
||||
|
||||
var transforms = parent.GetComponentsInChildren<Transform>();
|
||||
|
||||
foreach ( var t in transforms ) {
|
||||
if ( t.name == name )
|
||||
return t;
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
fileFormatVersion: 2
|
||||
guid: fd97af9e2cdb80849986192c53640eab
|
||||
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/Actions/Animation (Legacy)/PlayAnimationAdvanced.cs
|
||||
uploadId: 704937
|
||||
@@ -0,0 +1,58 @@
|
||||
using System.Collections.Generic;
|
||||
using NodeCanvas.Framework;
|
||||
using ParadoxNotion.Design;
|
||||
using UnityEngine;
|
||||
|
||||
|
||||
namespace NodeCanvas.Tasks.Actions
|
||||
{
|
||||
|
||||
[Category("Animation")]
|
||||
public class PlayAnimationSimple : ActionTask<Animation>
|
||||
{
|
||||
|
||||
[RequiredField]
|
||||
public BBParameter<AnimationClip> animationClip;
|
||||
[SliderField(0, 1)]
|
||||
public float crossFadeTime = 0.25f;
|
||||
public WrapMode animationWrap = WrapMode.Loop;
|
||||
public bool waitActionFinish = true;
|
||||
|
||||
//holds the last played animationClip.value for each agent
|
||||
private static Dictionary<Animation, AnimationClip> lastPlayedClips = new Dictionary<Animation, AnimationClip>();
|
||||
|
||||
protected override string info {
|
||||
get { return "Anim " + animationClip.ToString(); }
|
||||
}
|
||||
|
||||
protected override string OnInit() {
|
||||
agent.AddClip(animationClip.value, animationClip.value.name);
|
||||
animationClip.value.legacy = true;
|
||||
return null;
|
||||
}
|
||||
|
||||
protected override void OnExecute() {
|
||||
|
||||
AnimationClip last = null;
|
||||
if ( lastPlayedClips.TryGetValue(agent, out last) && last == animationClip.value ) {
|
||||
EndAction(true);
|
||||
return;
|
||||
}
|
||||
|
||||
lastPlayedClips[agent] = animationClip.value;
|
||||
agent[animationClip.value.name].wrapMode = animationWrap;
|
||||
agent.CrossFade(animationClip.value.name, crossFadeTime);
|
||||
|
||||
if ( !waitActionFinish ) {
|
||||
EndAction(true);
|
||||
}
|
||||
}
|
||||
|
||||
protected override void OnUpdate() {
|
||||
|
||||
if ( elapsedTime >= animationClip.value.length - crossFadeTime ) {
|
||||
EndAction(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 0ee037a87018d194e9552fc9c1575e28
|
||||
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/Actions/Animation (Legacy)/PlayAnimationSimple.cs
|
||||
uploadId: 704937
|
||||
@@ -0,0 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 5d698b044b1d69740b04b8afba652181
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
userData:
|
||||
@@ -0,0 +1,64 @@
|
||||
using NodeCanvas.Framework;
|
||||
using ParadoxNotion.Design;
|
||||
using UnityEngine;
|
||||
|
||||
|
||||
namespace NodeCanvas.Tasks.Actions
|
||||
{
|
||||
|
||||
[Name("Play Animation")]
|
||||
[Category("Animator")]
|
||||
public class MecanimPlayAnimation : ActionTask<Animator>
|
||||
{
|
||||
|
||||
public BBParameter<int> layerIndex;
|
||||
[RequiredField]
|
||||
public BBParameter<string> stateName;
|
||||
[SliderField(0, 1)]
|
||||
public float transitTime = 0.25f;
|
||||
public bool waitUntilFinish;
|
||||
|
||||
private AnimatorStateInfo stateInfo;
|
||||
private bool played;
|
||||
|
||||
protected override string info {
|
||||
get { return "Anim '" + stateName.ToString() + "'"; }
|
||||
}
|
||||
|
||||
protected override void OnExecute() {
|
||||
if ( string.IsNullOrEmpty(stateName.value) ) {
|
||||
EndAction();
|
||||
return;
|
||||
}
|
||||
played = false;
|
||||
var current = agent.GetCurrentAnimatorStateInfo(layerIndex.value);
|
||||
agent.CrossFade(stateName.value, transitTime / current.length, layerIndex.value, 0, 0);
|
||||
}
|
||||
|
||||
protected override void OnUpdate() {
|
||||
|
||||
stateInfo = agent.GetCurrentAnimatorStateInfo(layerIndex.value);
|
||||
|
||||
if ( waitUntilFinish ) {
|
||||
|
||||
if ( stateInfo.IsName(stateName.value) ) {
|
||||
|
||||
played = true;
|
||||
if ( elapsedTime >= ( stateInfo.length / agent.speed ) ) {
|
||||
EndAction();
|
||||
}
|
||||
|
||||
} else if ( played ) {
|
||||
|
||||
EndAction();
|
||||
}
|
||||
|
||||
} else {
|
||||
|
||||
if ( elapsedTime >= transitTime ) {
|
||||
EndAction();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 068de04d6f321674f8df75b0e7799e08
|
||||
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/Actions/Animator/MecanimPlayAnimation.cs
|
||||
uploadId: 704937
|
||||
@@ -0,0 +1,32 @@
|
||||
using NodeCanvas.Framework;
|
||||
using ParadoxNotion.Design;
|
||||
using UnityEngine;
|
||||
|
||||
|
||||
namespace NodeCanvas.Tasks.Actions
|
||||
{
|
||||
|
||||
[Name("Set Parameter Bool")]
|
||||
[Category("Animator")]
|
||||
[Description("You can either use a parameter name OR hashID. Leave the parameter name empty or none to use hashID instead.")]
|
||||
public class MecanimSetBool : ActionTask<Animator>
|
||||
{
|
||||
|
||||
public BBParameter<string> parameter;
|
||||
public BBParameter<int> parameterHashID;
|
||||
public BBParameter<bool> setTo;
|
||||
|
||||
protected override string info {
|
||||
get { return string.Format("Mec.SetBool {0} to {1}", string.IsNullOrEmpty(parameter.value) && !parameter.useBlackboard ? parameterHashID.ToString() : parameter.ToString(), setTo); }
|
||||
}
|
||||
|
||||
protected override void OnExecute() {
|
||||
if ( !string.IsNullOrEmpty(parameter.value) ) {
|
||||
agent.SetBool(parameter.value, setTo.value);
|
||||
} else {
|
||||
agent.SetBool(parameterHashID.value, setTo.value);
|
||||
}
|
||||
EndAction(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 3b4b5555c43840447a0a5bf21924e8b0
|
||||
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/Actions/Animator/MecanimSetBool.cs
|
||||
uploadId: 704937
|
||||
@@ -0,0 +1,61 @@
|
||||
using NodeCanvas.Framework;
|
||||
using ParadoxNotion.Design;
|
||||
using UnityEngine;
|
||||
|
||||
|
||||
namespace NodeCanvas.Tasks.Actions
|
||||
{
|
||||
|
||||
[Name("Set Parameter Float")]
|
||||
[Category("Animator")]
|
||||
[Description("You can either use a parameter name OR hashID. Leave the parameter name empty or none to use hashID instead.")]
|
||||
public class MecanimSetFloat : ActionTask<Animator>
|
||||
{
|
||||
|
||||
public BBParameter<string> parameter;
|
||||
public BBParameter<int> parameterHashID;
|
||||
public BBParameter<float> setTo;
|
||||
[SliderField(0, 1)]
|
||||
public float transitTime = 0.25f;
|
||||
|
||||
private float currentValue;
|
||||
|
||||
protected override string info {
|
||||
get { return string.Format("Mec.SetFloat {0} to {1}", string.IsNullOrEmpty(parameter.value) && !parameter.useBlackboard ? parameterHashID.ToString() : parameter.ToString(), setTo); }
|
||||
}
|
||||
|
||||
|
||||
protected override void OnExecute() {
|
||||
|
||||
if ( transitTime <= 0 ) {
|
||||
Set(setTo.value);
|
||||
EndAction();
|
||||
return;
|
||||
}
|
||||
|
||||
currentValue = Get();
|
||||
}
|
||||
|
||||
protected override void OnUpdate() {
|
||||
Set(Mathf.Lerp(currentValue, setTo.value, elapsedTime / transitTime));
|
||||
if ( elapsedTime >= transitTime ) {
|
||||
EndAction(true);
|
||||
}
|
||||
}
|
||||
|
||||
float Get() {
|
||||
if ( !string.IsNullOrEmpty(parameter.value) ) {
|
||||
return agent.GetFloat(parameter.value);
|
||||
}
|
||||
return agent.GetFloat(parameterHashID.value);
|
||||
}
|
||||
|
||||
void Set(float newValue) {
|
||||
if ( !string.IsNullOrEmpty(parameter.value) ) {
|
||||
agent.SetFloat(parameter.value, newValue);
|
||||
return;
|
||||
}
|
||||
agent.SetFloat(parameterHashID.value, newValue);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 81ea6c2dce41d5649a91981c87313f37
|
||||
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/Actions/Animator/MecanimSetFloat.cs
|
||||
uploadId: 704937
|
||||
@@ -0,0 +1,37 @@
|
||||
using NodeCanvas.Framework;
|
||||
using ParadoxNotion.Design;
|
||||
using UnityEngine;
|
||||
|
||||
|
||||
namespace NodeCanvas.Tasks.Actions
|
||||
{
|
||||
|
||||
[Name("Set IK")]
|
||||
[Category("Animator")]
|
||||
public class MecanimSetIK : ActionTask<Animator>
|
||||
{
|
||||
|
||||
public AvatarIKGoal IKGoal;
|
||||
[RequiredField]
|
||||
public BBParameter<GameObject> goal;
|
||||
public BBParameter<float> weight;
|
||||
|
||||
protected override string info {
|
||||
get { return "Set '" + IKGoal + "' " + goal; }
|
||||
}
|
||||
|
||||
protected override void OnExecute() {
|
||||
router.onAnimatorIK += OnAnimatorIK;
|
||||
}
|
||||
|
||||
protected override void OnStop() {
|
||||
router.onAnimatorIK -= OnAnimatorIK;
|
||||
}
|
||||
|
||||
void OnAnimatorIK(ParadoxNotion.EventData<int> msg) {
|
||||
agent.SetIKPositionWeight(IKGoal, weight.value);
|
||||
agent.SetIKPosition(IKGoal, goal.value.transform.position);
|
||||
EndAction();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 6aa8269a954781a40a72e0ab09b42ebd
|
||||
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/Actions/Animator/MecanimSetIK.cs
|
||||
uploadId: 704937
|
||||
@@ -0,0 +1,32 @@
|
||||
using NodeCanvas.Framework;
|
||||
using ParadoxNotion.Design;
|
||||
using UnityEngine;
|
||||
|
||||
|
||||
namespace NodeCanvas.Tasks.Actions
|
||||
{
|
||||
|
||||
[Name("Set Parameter Integer")]
|
||||
[Category("Animator")]
|
||||
[Description("You can either use a parameter name OR hashID. Leave the parameter name empty or none to use hashID instead.")]
|
||||
public class MecanimSetInt : ActionTask<Animator>
|
||||
{
|
||||
|
||||
public BBParameter<string> parameter;
|
||||
public BBParameter<int> parameterHashID;
|
||||
public BBParameter<int> setTo;
|
||||
|
||||
protected override string info {
|
||||
get { return string.Format("Mec.SetInt {0} to {1}", string.IsNullOrEmpty(parameter.value) && !parameter.useBlackboard ? parameterHashID.ToString() : parameter.ToString(), setTo); }
|
||||
}
|
||||
|
||||
protected override void OnExecute() {
|
||||
if ( !string.IsNullOrEmpty(parameter.value) ) {
|
||||
agent.SetInteger(parameter.value, setTo.value);
|
||||
} else {
|
||||
agent.SetInteger(parameterHashID.value, setTo.value);
|
||||
}
|
||||
EndAction();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
fileFormatVersion: 2
|
||||
guid: fe51923d669e70d48b6154e408605923
|
||||
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/Actions/Animator/MecanimSetInt.cs
|
||||
uploadId: 704937
|
||||
@@ -0,0 +1,42 @@
|
||||
using NodeCanvas.Framework;
|
||||
using ParadoxNotion.Design;
|
||||
using UnityEngine;
|
||||
|
||||
|
||||
namespace NodeCanvas.Tasks.Actions
|
||||
{
|
||||
|
||||
[Name("Set Layer Weight")]
|
||||
[Category("Animator")]
|
||||
public class MecanimSetLayerWeight : ActionTask<Animator>
|
||||
{
|
||||
|
||||
public BBParameter<int> layerIndex;
|
||||
|
||||
[SliderField(0, 1)]
|
||||
public BBParameter<float> layerWeight;
|
||||
|
||||
[SliderField(0, 1)]
|
||||
public float transitTime;
|
||||
|
||||
private float currentValue;
|
||||
|
||||
protected override string info {
|
||||
get { return "Set Layer " + layerIndex + ", weight " + layerWeight; }
|
||||
}
|
||||
|
||||
protected override void OnExecute() {
|
||||
|
||||
currentValue = agent.GetLayerWeight(layerIndex.value);
|
||||
}
|
||||
|
||||
protected override void OnUpdate() {
|
||||
var norm = transitTime > 0f ? Mathf.Lerp(currentValue, layerWeight.value, elapsedTime / transitTime) : layerWeight.value;
|
||||
agent.SetLayerWeight(layerIndex.value, norm);
|
||||
|
||||
if ( elapsedTime >= transitTime ) {
|
||||
EndAction(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
fileFormatVersion: 2
|
||||
guid: c6f88c3bb281ccf469df8a20555329cf
|
||||
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/Actions/Animator/MecanimSetLayerWeight.cs
|
||||
uploadId: 704937
|
||||
@@ -0,0 +1,35 @@
|
||||
using NodeCanvas.Framework;
|
||||
using ParadoxNotion.Design;
|
||||
using UnityEngine;
|
||||
|
||||
|
||||
namespace NodeCanvas.Tasks.Actions
|
||||
{
|
||||
|
||||
[Name("Set Look At")]
|
||||
[Category("Animator")]
|
||||
public class MecanimSetLookAt : ActionTask<Animator>
|
||||
{
|
||||
|
||||
public BBParameter<GameObject> targetPosition;
|
||||
public BBParameter<float> targetWeight;
|
||||
|
||||
protected override string info {
|
||||
get { return "Mec.SetLookAt " + targetPosition; }
|
||||
}
|
||||
|
||||
protected override void OnExecute() {
|
||||
router.onAnimatorIK += OnAnimatorIK;
|
||||
}
|
||||
|
||||
protected override void OnStop() {
|
||||
router.onAnimatorIK -= OnAnimatorIK;
|
||||
}
|
||||
|
||||
void OnAnimatorIK(ParadoxNotion.EventData<int> msg) {
|
||||
agent.SetLookAtPosition(targetPosition.value.transform.position);
|
||||
agent.SetLookAtWeight(targetWeight.value);
|
||||
EndAction();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 5ba868e9fed5f284c9cfac8f2aa92a73
|
||||
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/Actions/Animator/MecanimSetLookAt.cs
|
||||
uploadId: 704937
|
||||
@@ -0,0 +1,31 @@
|
||||
using NodeCanvas.Framework;
|
||||
using ParadoxNotion.Design;
|
||||
using UnityEngine;
|
||||
|
||||
|
||||
namespace NodeCanvas.Tasks.Actions
|
||||
{
|
||||
|
||||
[Name("Set Parameter Trigger")]
|
||||
[Category("Animator")]
|
||||
[Description("You can either use a parameter name OR hashID. Leave the parameter name empty or none to use hashID instead.")]
|
||||
public class MecanimSetTrigger : ActionTask<Animator>
|
||||
{
|
||||
|
||||
public BBParameter<string> parameter;
|
||||
public BBParameter<int> parameterHashID;
|
||||
|
||||
protected override string info {
|
||||
get { return string.Format("Mec.SetTrigger {0}", string.IsNullOrEmpty(parameter.value) && !parameter.useBlackboard ? parameterHashID.ToString() : parameter.ToString()); }
|
||||
}
|
||||
|
||||
protected override void OnExecute() {
|
||||
if ( !string.IsNullOrEmpty(parameter.value) ) {
|
||||
agent.SetTrigger(parameter.value);
|
||||
} else {
|
||||
agent.SetTrigger(parameterHashID.value);
|
||||
}
|
||||
EndAction();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 755b04421778adb43ab33691892beed5
|
||||
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/Actions/Animator/MecanimSetTrigger.cs
|
||||
uploadId: 704937
|
||||
@@ -0,0 +1,9 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 95b1e8757eddc74439756d25269ab31d
|
||||
folderAsset: yes
|
||||
timeCreated: 1513695268
|
||||
licenseType: Store
|
||||
DefaultImporter:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,25 @@
|
||||
using NodeCanvas.Framework;
|
||||
using ParadoxNotion.Design;
|
||||
using UnityEngine.SceneManagement;
|
||||
|
||||
namespace NodeCanvas.Tasks.Actions
|
||||
{
|
||||
|
||||
[Category("Application")]
|
||||
public class LoadScene : ActionTask
|
||||
{
|
||||
|
||||
[RequiredField]
|
||||
public BBParameter<string> sceneName;
|
||||
public BBParameter<LoadSceneMode> mode;
|
||||
|
||||
protected override string info {
|
||||
get { return string.Format("Load Scene {0}", sceneName); }
|
||||
}
|
||||
|
||||
protected override void OnExecute() {
|
||||
SceneManager.LoadScene(sceneName.value, mode.value);
|
||||
EndAction();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 4d0d2ed30df85694ea2442577faee142
|
||||
timeCreated: 1513694910
|
||||
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/Actions/Application/LoadScene.cs
|
||||
uploadId: 704937
|
||||
@@ -0,0 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: cc2451fd9afdd33409549a4c7372b17c
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
userData:
|
||||
@@ -0,0 +1,34 @@
|
||||
using NodeCanvas.Framework;
|
||||
using ParadoxNotion.Design;
|
||||
using UnityEngine;
|
||||
|
||||
|
||||
namespace NodeCanvas.Tasks.Actions
|
||||
{
|
||||
|
||||
[Category("Audio")]
|
||||
public class PlayAudioAtPosition : ActionTask<Transform>
|
||||
{
|
||||
|
||||
[RequiredField]
|
||||
public BBParameter<AudioClip> audioClip;
|
||||
[SliderField(0, 1)]
|
||||
public float volume = 1;
|
||||
public bool waitActionFinish;
|
||||
|
||||
protected override string info {
|
||||
get { return "PlayAudio " + audioClip.ToString(); }
|
||||
}
|
||||
|
||||
protected override void OnExecute() {
|
||||
AudioSource.PlayClipAtPoint(audioClip.value, agent.position, volume);
|
||||
if ( !waitActionFinish )
|
||||
EndAction();
|
||||
}
|
||||
|
||||
protected override void OnUpdate() {
|
||||
if ( elapsedTime >= audioClip.value.length )
|
||||
EndAction();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
fileFormatVersion: 2
|
||||
guid: d15857f495a22c44fb7213edb95ae242
|
||||
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/Actions/Audio/PlayAudioAtPosition.cs
|
||||
uploadId: 704937
|
||||
@@ -0,0 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: cc7722cad61550744b11fe913139ce5b
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
userData:
|
||||
@@ -0,0 +1,29 @@
|
||||
using NodeCanvas.Framework;
|
||||
using ParadoxNotion.Design;
|
||||
using UnityEngine;
|
||||
|
||||
|
||||
namespace NodeCanvas.Tasks.Actions
|
||||
{
|
||||
|
||||
[Category("✫ Blackboard")]
|
||||
[Description("Create a new Vector out of 3 floats and save it to the blackboard")]
|
||||
public class ComposeVector : ActionTask
|
||||
{
|
||||
|
||||
public BBParameter<float> x;
|
||||
public BBParameter<float> y;
|
||||
public BBParameter<float> z;
|
||||
[BlackboardOnly]
|
||||
public BBParameter<Vector3> saveAs;
|
||||
|
||||
protected override string info {
|
||||
get { return "New Vector as " + saveAs; }
|
||||
}
|
||||
|
||||
protected override void OnExecute() {
|
||||
saveAs.value = new Vector3(x.value, y.value, z.value);
|
||||
EndAction();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 125a28cbed450e440bd316c7b9e892b8
|
||||
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/Actions/Blackboard/ComposeVector.cs
|
||||
uploadId: 704937
|
||||
@@ -0,0 +1,33 @@
|
||||
using NodeCanvas.Framework;
|
||||
using ParadoxNotion.Design;
|
||||
using UnityEngine;
|
||||
|
||||
|
||||
namespace NodeCanvas.Tasks.Actions
|
||||
{
|
||||
|
||||
[Category("✫ Blackboard")]
|
||||
[Description("Create up to 3 floats from a Vector and save them to blackboard")]
|
||||
public class DecomposeVector : ActionTask
|
||||
{
|
||||
|
||||
public BBParameter<Vector3> targetVector;
|
||||
[BlackboardOnly]
|
||||
public BBParameter<float> x;
|
||||
[BlackboardOnly]
|
||||
public BBParameter<float> y;
|
||||
[BlackboardOnly]
|
||||
public BBParameter<float> z;
|
||||
|
||||
protected override string info {
|
||||
get { return "Decompose Vector " + targetVector; }
|
||||
}
|
||||
|
||||
protected override void OnExecute() {
|
||||
x.value = targetVector.value.x;
|
||||
y.value = targetVector.value.y;
|
||||
z.value = targetVector.value.z;
|
||||
EndAction();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 0515a42e61cc03749ae53272ad6c2ea6
|
||||
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/Actions/Blackboard/DecomposeVector.cs
|
||||
uploadId: 704937
|
||||
@@ -0,0 +1,9 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 098a65292321a36459b788555a241eb5
|
||||
folderAsset: yes
|
||||
timeCreated: 1508931960
|
||||
licenseType: Store
|
||||
DefaultImporter:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,33 @@
|
||||
using UnityEngine;
|
||||
using System.Collections.Generic;
|
||||
using ParadoxNotion.Design;
|
||||
using NodeCanvas.Framework;
|
||||
|
||||
namespace NodeCanvas.Tasks.Actions
|
||||
{
|
||||
|
||||
[Category("✫ Blackboard/Dictionaries")]
|
||||
public class AddElementToDictionary<T> : ActionTask
|
||||
{
|
||||
|
||||
[BlackboardOnly]
|
||||
[RequiredField]
|
||||
public BBParameter<Dictionary<string, T>> dictionary;
|
||||
|
||||
public BBParameter<string> key;
|
||||
public BBParameter<T> value;
|
||||
|
||||
protected override string info {
|
||||
get { return string.Format("{0}[{1}] = {2}", dictionary, key, value); }
|
||||
}
|
||||
|
||||
protected override void OnExecute() {
|
||||
if ( dictionary.value == null ) {
|
||||
EndAction(false);
|
||||
return;
|
||||
}
|
||||
dictionary.value[key.value] = value.value;
|
||||
EndAction();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 4d79bc69b7846bf4c83186d11632de43
|
||||
timeCreated: 1466908765
|
||||
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/Actions/Blackboard/Dictionary
|
||||
Specific/AddElementToDictionary.cs
|
||||
uploadId: 704937
|
||||
@@ -0,0 +1,35 @@
|
||||
using UnityEngine;
|
||||
using System.Collections.Generic;
|
||||
using ParadoxNotion.Design;
|
||||
using NodeCanvas.Framework;
|
||||
|
||||
namespace NodeCanvas.Tasks.Actions
|
||||
{
|
||||
|
||||
[Category("✫ Blackboard/Dictionaries")]
|
||||
public class GetDictionaryElement<T> : ActionTask
|
||||
{
|
||||
|
||||
[BlackboardOnly]
|
||||
[RequiredField]
|
||||
public BBParameter<Dictionary<string, T>> dictionary;
|
||||
|
||||
public BBParameter<string> key;
|
||||
|
||||
[BlackboardOnly]
|
||||
public BBParameter<T> saveAs;
|
||||
|
||||
protected override string info {
|
||||
get { return string.Format("{0} = {1}[{2}]", saveAs, dictionary, key); }
|
||||
}
|
||||
|
||||
protected override void OnExecute() {
|
||||
if ( dictionary.value == null ) {
|
||||
EndAction(false);
|
||||
return;
|
||||
}
|
||||
saveAs.value = dictionary.value[key.value];
|
||||
EndAction();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 6e1ccc612605fa743a99c87bd393d0b0
|
||||
timeCreated: 1466909038
|
||||
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/Actions/Blackboard/Dictionary
|
||||
Specific/GetDictionaryElement.cs
|
||||
uploadId: 704937
|
||||
@@ -0,0 +1,29 @@
|
||||
using NodeCanvas.Framework;
|
||||
using ParadoxNotion.Design;
|
||||
using UnityEngine;
|
||||
|
||||
|
||||
namespace NodeCanvas.Tasks.Actions
|
||||
{
|
||||
|
||||
[Category("✫ Blackboard")]
|
||||
public class EvaluateCurve : ActionTask
|
||||
{
|
||||
|
||||
[RequiredField]
|
||||
public BBParameter<AnimationCurve> curve;
|
||||
public BBParameter<float> from;
|
||||
public BBParameter<float> to = 1;
|
||||
public BBParameter<float> time = 1;
|
||||
|
||||
[BlackboardOnly]
|
||||
public BBParameter<float> saveAs;
|
||||
|
||||
protected override void OnUpdate() {
|
||||
|
||||
saveAs.value = curve.value.Evaluate(Mathf.Lerp(from.value, to.value, elapsedTime / time.value));
|
||||
if ( elapsedTime > time.value )
|
||||
EndAction();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
fileFormatVersion: 2
|
||||
guid: d1044d383c112af42875e99d56d74eb6
|
||||
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/Actions/Blackboard/EvaluateCurve.cs
|
||||
uploadId: 704937
|
||||
@@ -0,0 +1,21 @@
|
||||
using NodeCanvas.Framework;
|
||||
using ParadoxNotion.Design;
|
||||
|
||||
|
||||
namespace NodeCanvas.Tasks.Actions
|
||||
{
|
||||
|
||||
[Category("✫ Blackboard")]
|
||||
[Description("Stores the agent gameobject on the blackboard.")]
|
||||
public class GetSelf : ActionTask
|
||||
{
|
||||
|
||||
[BlackboardOnly]
|
||||
public BBParameter<UnityEngine.GameObject> saveAs;
|
||||
|
||||
protected override void OnExecute() {
|
||||
saveAs.value = agent?.gameObject;
|
||||
EndAction(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
fileFormatVersion: 2
|
||||
guid: bf92aabc17a4570478349500cd9b79a9
|
||||
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/Actions/Blackboard/Get Self.cs
|
||||
uploadId: 704937
|
||||
@@ -0,0 +1,49 @@
|
||||
using NodeCanvas.Framework;
|
||||
using NodeCanvas.Framework.Internal;
|
||||
using ParadoxNotion.Design;
|
||||
using UnityEngine;
|
||||
|
||||
namespace NodeCanvas.Tasks.Actions
|
||||
{
|
||||
|
||||
[Category("✫ Blackboard")]
|
||||
[Description("Use this to get a variable on any blackboard by overriding the agent")]
|
||||
public class GetOtherBlackboardVariable : ActionTask<Blackboard>
|
||||
{
|
||||
|
||||
[RequiredField]
|
||||
public BBParameter<string> targetVariableName;
|
||||
[BlackboardOnly]
|
||||
public BBObjectParameter saveAs;
|
||||
|
||||
protected override string info {
|
||||
get { return string.Format("{0} = {1}", saveAs, targetVariableName); }
|
||||
}
|
||||
|
||||
protected override void OnExecute() {
|
||||
var targetVar = agent.GetVariable(targetVariableName.value);
|
||||
if ( targetVar == null ) {
|
||||
EndAction(false);
|
||||
return;
|
||||
}
|
||||
|
||||
saveAs.value = targetVar.value;
|
||||
EndAction(true);
|
||||
}
|
||||
|
||||
///----------------------------------------------------------------------------------------------
|
||||
///---------------------------------------UNITY EDITOR-------------------------------------------
|
||||
#if UNITY_EDITOR
|
||||
|
||||
protected override void OnTaskInspectorGUI() {
|
||||
if ( GUILayout.Button("Select Target Variable Type") ) {
|
||||
EditorUtils.ShowPreferedTypesSelectionMenu(typeof(object), (t) => { saveAs.SetType(t); });
|
||||
}
|
||||
if ( saveAs.varType != typeof(object) ) {
|
||||
DrawDefaultInspector();
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 7ca32d6509e23bd4e842449e806de9ab
|
||||
timeCreated: 1452355528
|
||||
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/Actions/Blackboard/GetOtherBlackboardVariable.cs
|
||||
uploadId: 704937
|
||||
@@ -0,0 +1,27 @@
|
||||
using NodeCanvas.Framework;
|
||||
using ParadoxNotion.Design;
|
||||
|
||||
|
||||
namespace NodeCanvas.Tasks.Actions
|
||||
{
|
||||
|
||||
[Name("Get Variable To String")]
|
||||
[Category("✫ Blackboard")]
|
||||
public class GetToString : ActionTask
|
||||
{
|
||||
|
||||
[BlackboardOnly]
|
||||
public BBParameter<object> variable;
|
||||
[BlackboardOnly]
|
||||
public BBParameter<string> toString;
|
||||
|
||||
protected override string info {
|
||||
get { return string.Format("{0} = {1}.ToString()", toString, variable); }
|
||||
}
|
||||
|
||||
protected override void OnExecute() {
|
||||
toString.value = !variable.isNull ? variable.value.ToString() : "NULL";
|
||||
EndAction();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
fileFormatVersion: 2
|
||||
guid: c9952e043e762554894e6b5bee9d1c0b
|
||||
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/Actions/Blackboard/GetToString.cs
|
||||
uploadId: 704937
|
||||
@@ -0,0 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 4420330d08ae1df49bc313a7384e4b86
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
userData:
|
||||
@@ -0,0 +1,26 @@
|
||||
using System.Collections.Generic;
|
||||
using NodeCanvas.Framework;
|
||||
using ParadoxNotion.Design;
|
||||
using UnityEngine;
|
||||
|
||||
namespace NodeCanvas.Tasks.Actions
|
||||
{
|
||||
|
||||
[Category("✫ Blackboard/Lists")]
|
||||
public class AddElementToList<T> : ActionTask
|
||||
{
|
||||
[RequiredField]
|
||||
[BlackboardOnly]
|
||||
public BBParameter<List<T>> targetList;
|
||||
public BBParameter<T> targetElement;
|
||||
|
||||
protected override string info {
|
||||
get { return string.Format("Add {0} In {1}", targetElement, targetList); }
|
||||
}
|
||||
|
||||
protected override void OnExecute() {
|
||||
targetList.value.Add(targetElement.value);
|
||||
EndAction();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
fileFormatVersion: 2
|
||||
guid: d56a1bdefc0c30d4ba58e57badb096a1
|
||||
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/Actions/Blackboard/List Specific/AddElementToList.cs
|
||||
uploadId: 704937
|
||||
@@ -0,0 +1,26 @@
|
||||
using System.Collections;
|
||||
using NodeCanvas.Framework;
|
||||
using ParadoxNotion.Design;
|
||||
|
||||
|
||||
namespace NodeCanvas.Tasks.Actions
|
||||
{
|
||||
|
||||
[Category("✫ Blackboard/Lists")]
|
||||
public class ClearList : ActionTask
|
||||
{
|
||||
|
||||
[RequiredField]
|
||||
[BlackboardOnly]
|
||||
public BBParameter<IList> targetList;
|
||||
|
||||
protected override string info {
|
||||
get { return string.Format("Clear List {0}", targetList); }
|
||||
}
|
||||
|
||||
protected override void OnExecute() {
|
||||
targetList.value.Clear();
|
||||
EndAction(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
fileFormatVersion: 2
|
||||
guid: d84431e6405163d45abc8dbfa6357145
|
||||
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/Actions/Blackboard/List Specific/ClearList.cs
|
||||
uploadId: 704937
|
||||
@@ -0,0 +1,46 @@
|
||||
using System.Collections.Generic;
|
||||
using NodeCanvas.Framework;
|
||||
using ParadoxNotion.Design;
|
||||
using UnityEngine;
|
||||
|
||||
|
||||
namespace NodeCanvas.Tasks.Actions
|
||||
{
|
||||
|
||||
[Category("✫ Blackboard/Lists")]
|
||||
[Description("Get the closer game object to the agent from within a list of game objects and save it in the blackboard.")]
|
||||
public class GetCloserGameObjectInList : ActionTask<Transform>
|
||||
{
|
||||
|
||||
[RequiredField]
|
||||
public BBParameter<List<GameObject>> list;
|
||||
|
||||
[BlackboardOnly]
|
||||
public BBParameter<GameObject> saveAs;
|
||||
|
||||
protected override string info {
|
||||
get { return "Get Closer from '" + list + "' as " + saveAs; }
|
||||
}
|
||||
|
||||
protected override void OnExecute() {
|
||||
|
||||
if ( list.value.Count == 0 ) {
|
||||
EndAction(false);
|
||||
return;
|
||||
}
|
||||
|
||||
var closerDistance = Mathf.Infinity;
|
||||
GameObject closerGO = null;
|
||||
foreach ( var go in list.value ) {
|
||||
var dist = Vector3.Distance(agent.position, go.transform.position);
|
||||
if ( dist < closerDistance ) {
|
||||
closerDistance = dist;
|
||||
closerGO = go;
|
||||
}
|
||||
}
|
||||
|
||||
saveAs.value = closerGO;
|
||||
EndAction(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 01a20afa5dc0e3d43a6498bf8da0501e
|
||||
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/Actions/Blackboard/List Specific/GetCloserGameObjectInList.cs
|
||||
uploadId: 704937
|
||||
@@ -0,0 +1,24 @@
|
||||
using System.Collections.Generic;
|
||||
using NodeCanvas.Framework;
|
||||
using ParadoxNotion.Design;
|
||||
|
||||
namespace NodeCanvas.Tasks.Actions
|
||||
{
|
||||
|
||||
[Category("✫ Blackboard/Lists")]
|
||||
public class GetIndexOfElement<T> : ActionTask
|
||||
{
|
||||
[RequiredField]
|
||||
[BlackboardOnly]
|
||||
public BBParameter<List<T>> targetList;
|
||||
public BBParameter<T> targetElement;
|
||||
[BlackboardOnly]
|
||||
public BBParameter<int> saveIndexAs;
|
||||
|
||||
protected override void OnExecute() {
|
||||
|
||||
saveIndexAs.value = targetList.value.IndexOf(targetElement.value);
|
||||
EndAction(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 9f9a0e64340064849bccbc79218a1712
|
||||
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/Actions/Blackboard/List Specific/GetIndexOfElement.cs
|
||||
uploadId: 704937
|
||||
@@ -0,0 +1,28 @@
|
||||
using System.Collections;
|
||||
using NodeCanvas.Framework;
|
||||
using ParadoxNotion.Design;
|
||||
|
||||
|
||||
namespace NodeCanvas.Tasks.Actions
|
||||
{
|
||||
|
||||
[Category("✫ Blackboard/Lists")]
|
||||
public class GetListCount : ActionTask
|
||||
{
|
||||
|
||||
[RequiredField]
|
||||
[BlackboardOnly]
|
||||
public BBParameter<IList> targetList;
|
||||
[BlackboardOnly]
|
||||
public BBParameter<int> saveAs;
|
||||
|
||||
protected override string info {
|
||||
get { return string.Format("{0} = {1}.Count", saveAs, targetList); }
|
||||
}
|
||||
|
||||
protected override void OnExecute() {
|
||||
saveAs.value = targetList.value.Count;
|
||||
EndAction(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
fileFormatVersion: 2
|
||||
guid: cd7f6af7a9a3802488547672d96b5505
|
||||
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/Actions/Blackboard/List Specific/GetListCount.cs
|
||||
uploadId: 704937
|
||||
@@ -0,0 +1,34 @@
|
||||
using System.Collections.Generic;
|
||||
using NodeCanvas.Framework;
|
||||
using ParadoxNotion.Design;
|
||||
using UnityEngine;
|
||||
|
||||
namespace NodeCanvas.Tasks.Actions
|
||||
{
|
||||
|
||||
[Category("✫ Blackboard/Lists")]
|
||||
public class InsertElementToList<T> : ActionTask
|
||||
{
|
||||
[RequiredField]
|
||||
[BlackboardOnly]
|
||||
public BBParameter<List<T>> targetList;
|
||||
public BBParameter<T> targetElement;
|
||||
public BBParameter<int> targetIndex;
|
||||
|
||||
protected override string info {
|
||||
get { return string.Format("Insert {0} in {1} at {2}", targetElement, targetList, targetIndex); }
|
||||
}
|
||||
|
||||
protected override void OnExecute() {
|
||||
var index = targetIndex.value;
|
||||
var list = targetList.value;
|
||||
if ( index < 0 || index >= list.Count ) {
|
||||
EndAction(false);
|
||||
return;
|
||||
}
|
||||
|
||||
list.Insert(index, targetElement.value);
|
||||
EndAction(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 4f62b3be125206e49ad73bcaf4c279c2
|
||||
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/Actions/Blackboard/List Specific/InsertElementToList.cs
|
||||
uploadId: 704937
|
||||
@@ -0,0 +1,34 @@
|
||||
using System.Collections.Generic;
|
||||
using NodeCanvas.Framework;
|
||||
using ParadoxNotion.Design;
|
||||
|
||||
|
||||
namespace NodeCanvas.Tasks.Actions
|
||||
{
|
||||
|
||||
[Category("✫ Blackboard/Lists")]
|
||||
public class PickListElement<T> : ActionTask
|
||||
{
|
||||
[RequiredField]
|
||||
[BlackboardOnly]
|
||||
public BBParameter<List<T>> targetList;
|
||||
public BBParameter<int> index;
|
||||
[BlackboardOnly]
|
||||
public BBParameter<T> saveAs;
|
||||
|
||||
protected override string info {
|
||||
get { return string.Format("{0} = {1} [{2}]", saveAs, targetList, index); }
|
||||
}
|
||||
|
||||
protected override void OnExecute() {
|
||||
|
||||
if ( index.value < 0 || index.value >= targetList.value.Count ) {
|
||||
EndAction(false);
|
||||
return;
|
||||
}
|
||||
|
||||
saveAs.value = targetList.value[index.value];
|
||||
EndAction(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
fileFormatVersion: 2
|
||||
guid: a733201b66a33fb478371b3cafca3885
|
||||
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/Actions/Blackboard/List Specific/PickListElement.cs
|
||||
uploadId: 704937
|
||||
@@ -0,0 +1,32 @@
|
||||
using System.Collections.Generic;
|
||||
using NodeCanvas.Framework;
|
||||
using ParadoxNotion.Design;
|
||||
using UnityEngine;
|
||||
|
||||
|
||||
namespace NodeCanvas.Tasks.Actions
|
||||
{
|
||||
|
||||
[Category("✫ Blackboard/Lists")]
|
||||
public class PickRandomListElement<T> : ActionTask
|
||||
{
|
||||
[RequiredField]
|
||||
public BBParameter<List<T>> targetList;
|
||||
public BBParameter<T> saveAs;
|
||||
|
||||
protected override string info {
|
||||
get { return string.Format("{0} = Random From {1}", saveAs, targetList); }
|
||||
}
|
||||
|
||||
protected override void OnExecute() {
|
||||
|
||||
if ( targetList.value.Count <= 0 ) {
|
||||
EndAction(false);
|
||||
return;
|
||||
}
|
||||
|
||||
saveAs.value = targetList.value[Random.Range(0, targetList.value.Count)];
|
||||
EndAction(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 376917d99c2b14440b8153aa391c973b
|
||||
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/Actions/Blackboard/List Specific/PickRandomListElement.cs
|
||||
uploadId: 704937
|
||||
@@ -0,0 +1,28 @@
|
||||
using System.Collections.Generic;
|
||||
using NodeCanvas.Framework;
|
||||
using ParadoxNotion.Design;
|
||||
|
||||
|
||||
namespace NodeCanvas.Tasks.Actions
|
||||
{
|
||||
|
||||
[Category("✫ Blackboard/Lists")]
|
||||
[Description("Remove an element from the target list")]
|
||||
public class RemoveElementFromList<T> : ActionTask
|
||||
{
|
||||
|
||||
[RequiredField]
|
||||
[BlackboardOnly]
|
||||
public BBParameter<List<T>> targetList;
|
||||
public BBParameter<T> targetElement;
|
||||
|
||||
protected override string info {
|
||||
get { return string.Format("Remove {0} From {1}", targetElement, targetList); }
|
||||
}
|
||||
|
||||
protected override void OnExecute() {
|
||||
targetList.value.Remove(targetElement.value);
|
||||
EndAction(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 19f9361b4228af843a49e3b8ae77e088
|
||||
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/Actions/Blackboard/List Specific/RemoveElementFromList.cs
|
||||
uploadId: 704937
|
||||
@@ -0,0 +1,29 @@
|
||||
using System.Collections.Generic;
|
||||
using NodeCanvas.Framework;
|
||||
using ParadoxNotion.Design;
|
||||
|
||||
namespace NodeCanvas.Tasks.Actions
|
||||
{
|
||||
|
||||
[Category("✫ Blackboard/Lists")]
|
||||
public class SetListElement<T> : ActionTask
|
||||
{
|
||||
|
||||
[RequiredField]
|
||||
[BlackboardOnly]
|
||||
public BBParameter<List<T>> targetList;
|
||||
public BBParameter<int> index;
|
||||
public BBParameter<T> newValue;
|
||||
|
||||
protected override void OnExecute() {
|
||||
|
||||
if ( index.value < 0 || index.value >= targetList.value.Count ) {
|
||||
EndAction(false);
|
||||
return;
|
||||
}
|
||||
|
||||
targetList.value[index.value] = newValue.value;
|
||||
EndAction(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
fileFormatVersion: 2
|
||||
guid: bf62d460f7f94de41ab26802a6f68a89
|
||||
timeCreated: 1429294008
|
||||
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/Actions/Blackboard/List Specific/SetListElement.cs
|
||||
uploadId: 704937
|
||||
@@ -0,0 +1,32 @@
|
||||
using System.Collections;
|
||||
using NodeCanvas.Framework;
|
||||
using ParadoxNotion.Design;
|
||||
using UnityEngine;
|
||||
|
||||
|
||||
namespace NodeCanvas.Tasks.Actions
|
||||
{
|
||||
|
||||
[Category("✫ Blackboard/Lists")]
|
||||
public class ShuffleList : ActionTask
|
||||
{
|
||||
|
||||
[RequiredField]
|
||||
[BlackboardOnly]
|
||||
public BBParameter<IList> targetList;
|
||||
|
||||
protected override void OnExecute() {
|
||||
|
||||
var list = targetList.value;
|
||||
|
||||
for ( var i = list.Count - 1; i > 0; i-- ) {
|
||||
var j = (int)Mathf.Floor(Random.value * ( i + 1 ));
|
||||
var temp = list[i];
|
||||
list[i] = list[j];
|
||||
list[j] = temp;
|
||||
}
|
||||
|
||||
EndAction();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
fileFormatVersion: 2
|
||||
guid: c9f0b48046c2e0f4ea62a52ab7cbbcd7
|
||||
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/Actions/Blackboard/List Specific/ShuffleList.cs
|
||||
uploadId: 704937
|
||||
@@ -0,0 +1,36 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using NodeCanvas.Framework;
|
||||
using ParadoxNotion.Design;
|
||||
using UnityEngine;
|
||||
|
||||
|
||||
namespace NodeCanvas.Tasks.Actions
|
||||
{
|
||||
|
||||
[Category("✫ Blackboard/Lists")]
|
||||
[Description("Will sort the gameobjects in the target list by their distance to the agent (closer first) and save that list to the blackboard")]
|
||||
public class SortGameObjectListByDistance : ActionTask<Transform>
|
||||
{
|
||||
|
||||
[RequiredField]
|
||||
[BlackboardOnly]
|
||||
public BBParameter<List<GameObject>> targetList;
|
||||
[BlackboardOnly]
|
||||
public BBParameter<List<GameObject>> saveAs;
|
||||
public bool reverse;
|
||||
|
||||
protected override string info {
|
||||
get { return "Sort " + targetList + " by distance as " + saveAs; }
|
||||
}
|
||||
|
||||
protected override void OnExecute() {
|
||||
|
||||
saveAs.value = targetList.value.OrderBy(go => Vector3.Distance(go.transform.position, agent.position)).ToList();
|
||||
if ( reverse )
|
||||
saveAs.value.Reverse();
|
||||
|
||||
EndAction();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
fileFormatVersion: 2
|
||||
guid: e1d1c6083791fd54e813c7f076fe6f8e
|
||||
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/Actions/Blackboard/List Specific/SortGameObjectListByDistance.cs
|
||||
uploadId: 704937
|
||||
@@ -0,0 +1,24 @@
|
||||
using NodeCanvas.Framework;
|
||||
using ParadoxNotion.Design;
|
||||
|
||||
|
||||
namespace NodeCanvas.Tasks.Actions
|
||||
{
|
||||
|
||||
[Category("✫ Blackboard")]
|
||||
[Description("Loads the blackboard variables previously saved in the provided PlayerPrefs key if at all. Returns false if no saves found or load was failed")]
|
||||
public class LoadBlackboard : ActionTask<Blackboard>
|
||||
{
|
||||
|
||||
[RequiredField]
|
||||
public BBParameter<string> saveKey;
|
||||
|
||||
protected override string info {
|
||||
get { return string.Format("Load Blackboard [{0}]", saveKey.ToString()); }
|
||||
}
|
||||
|
||||
protected override void OnExecute() {
|
||||
EndAction(agent.Load(saveKey.value));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
fileFormatVersion: 2
|
||||
guid: f6ffb4e56978514448a9c042085bc84b
|
||||
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/Actions/Blackboard/LoadBlackboard.cs
|
||||
uploadId: 704937
|
||||
@@ -0,0 +1,21 @@
|
||||
using NodeCanvas.Framework;
|
||||
using ParadoxNotion.Design;
|
||||
using UnityEngine;
|
||||
|
||||
|
||||
namespace NodeCanvas.Tasks.Actions
|
||||
{
|
||||
|
||||
[Category("✫ Blackboard")]
|
||||
public class NormalizeVector : ActionTask
|
||||
{
|
||||
|
||||
public BBParameter<Vector3> targetVector;
|
||||
public BBParameter<float> multiply = 1;
|
||||
|
||||
protected override void OnExecute() {
|
||||
targetVector.value = targetVector.value.normalized * multiply.value;
|
||||
EndAction(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 20fef3a7de804de419be6a0bf3d152c0
|
||||
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/Actions/Blackboard/NormalizeVector.cs
|
||||
uploadId: 704937
|
||||
@@ -0,0 +1,27 @@
|
||||
using NodeCanvas.Framework;
|
||||
using ParadoxNotion.Design;
|
||||
using UnityEngine;
|
||||
|
||||
|
||||
namespace NodeCanvas.Tasks.Actions
|
||||
{
|
||||
|
||||
[Category("✫ Blackboard")]
|
||||
public class SampleCurve : ActionTask
|
||||
{
|
||||
|
||||
[RequiredField]
|
||||
public BBParameter<AnimationCurve> curve;
|
||||
[SliderField(0, 1)]
|
||||
public BBParameter<float> sampleAt;
|
||||
|
||||
[BlackboardOnly]
|
||||
public BBParameter<float> saveAs;
|
||||
|
||||
protected override void OnExecute() {
|
||||
|
||||
saveAs.value = curve.value.Evaluate(sampleAt.value);
|
||||
EndAction();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
fileFormatVersion: 2
|
||||
guid: ef1a2fcbfbe87264cb5751e9e8950c01
|
||||
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/Actions/Blackboard/SampleCurve.cs
|
||||
uploadId: 704937
|
||||
@@ -0,0 +1,25 @@
|
||||
using NodeCanvas.Framework;
|
||||
using ParadoxNotion.Design;
|
||||
|
||||
|
||||
namespace NodeCanvas.Tasks.Actions
|
||||
{
|
||||
|
||||
[Category("✫ Blackboard")]
|
||||
[Description("Saves the blackboard variables in the provided key and to be loaded later on")]
|
||||
public class SaveBlackboard : ActionTask<Blackboard>
|
||||
{
|
||||
|
||||
[RequiredField]
|
||||
public BBParameter<string> saveKey;
|
||||
|
||||
protected override string info {
|
||||
get { return string.Format("Save Blackboard [{0}]", saveKey.ToString()); }
|
||||
}
|
||||
|
||||
protected override void OnExecute() {
|
||||
agent.Save(saveKey.value);
|
||||
EndAction();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 0a73b57e13726a04ab5a2e67e9f001f5
|
||||
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/Actions/Blackboard/SaveBlackboard.cs
|
||||
uploadId: 704937
|
||||
@@ -0,0 +1,50 @@
|
||||
using NodeCanvas.Framework;
|
||||
using ParadoxNotion.Design;
|
||||
|
||||
|
||||
namespace NodeCanvas.Tasks.Actions
|
||||
{
|
||||
|
||||
[Category("✫ Blackboard")]
|
||||
[Description("Set a blackboard boolean variable")]
|
||||
public class SetBoolean : ActionTask
|
||||
{
|
||||
|
||||
public enum BoolSetModes
|
||||
{
|
||||
False = 0,
|
||||
True = 1,
|
||||
Toggle = 2
|
||||
}
|
||||
|
||||
[RequiredField]
|
||||
[BlackboardOnly]
|
||||
public BBParameter<bool> boolVariable;
|
||||
public BoolSetModes setTo = BoolSetModes.True;
|
||||
|
||||
protected override string info {
|
||||
get
|
||||
{
|
||||
if ( setTo == BoolSetModes.Toggle )
|
||||
return "Toggle " + boolVariable.ToString();
|
||||
|
||||
return "Set " + boolVariable.ToString() + " to " + setTo.ToString();
|
||||
}
|
||||
}
|
||||
|
||||
protected override void OnExecute() {
|
||||
|
||||
if ( setTo == BoolSetModes.Toggle ) {
|
||||
|
||||
boolVariable.value = !boolVariable.value;
|
||||
|
||||
} else {
|
||||
|
||||
var checkBool = ( (int)setTo == 1 );
|
||||
boolVariable.value = checkBool;
|
||||
}
|
||||
|
||||
EndAction();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 9839dba5b1d0fca4bb2d6e2f9b11a664
|
||||
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/Actions/Blackboard/SetBoolean.cs
|
||||
uploadId: 704937
|
||||
@@ -0,0 +1,26 @@
|
||||
using NodeCanvas.Framework;
|
||||
using ParadoxNotion.Design;
|
||||
using UnityEngine;
|
||||
|
||||
|
||||
namespace NodeCanvas.Tasks.Actions
|
||||
{
|
||||
|
||||
[Category("✫ Blackboard")]
|
||||
[Description("Set a blackboard boolean variable at random between min and max value")]
|
||||
public class SetBooleanRandom : ActionTask
|
||||
{
|
||||
|
||||
[BlackboardOnly]
|
||||
public BBParameter<bool> boolVariable;
|
||||
|
||||
protected override string info {
|
||||
get { return "Set " + boolVariable + " Random"; }
|
||||
}
|
||||
|
||||
protected override void OnExecute() {
|
||||
boolVariable.value = Random.Range(0, 2) == 0 ? false : true;
|
||||
EndAction();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 908d17f9eed377a4b92f3ee03b95df5f
|
||||
timeCreated: 1430488841
|
||||
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/Actions/Blackboard/SetBooleanRandom.cs
|
||||
uploadId: 704937
|
||||
@@ -0,0 +1,39 @@
|
||||
using NodeCanvas.Framework;
|
||||
using NodeCanvas.Framework.Internal;
|
||||
using ParadoxNotion.Design;
|
||||
|
||||
|
||||
namespace NodeCanvas.Tasks.Actions
|
||||
{
|
||||
|
||||
[Category("✫ Blackboard")]
|
||||
public class SetEnum : ActionTask
|
||||
{
|
||||
|
||||
[BlackboardOnly]
|
||||
[RequiredField]
|
||||
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 void OnExecute() {
|
||||
valueA.value = valueB.value;
|
||||
EndAction();
|
||||
}
|
||||
|
||||
|
||||
///----------------------------------------------------------------------------------------------
|
||||
///---------------------------------------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: 15dcac4b081172143a0879e8b717de36
|
||||
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/Actions/Blackboard/SetEnum.cs
|
||||
uploadId: 704937
|
||||
@@ -0,0 +1,40 @@
|
||||
using System;
|
||||
using NodeCanvas.Framework;
|
||||
using NodeCanvas.Framework.Internal;
|
||||
using ParadoxNotion.Design;
|
||||
|
||||
[Category("✫ Blackboard")]
|
||||
public class SetEnumFlag : ActionTask
|
||||
{
|
||||
[BlackboardOnly]
|
||||
[RequiredField]
|
||||
public readonly BBObjectParameter Variable = new BBObjectParameter(typeof(Enum));
|
||||
|
||||
public readonly BBObjectParameter Flag = new BBObjectParameter(typeof(Enum));
|
||||
public readonly BBParameter<bool> Clear = new BBParameter<bool>();
|
||||
|
||||
protected override string info => $"{(Clear.value ? "Clear" : "Set")} {Variable} for {Flag} flag";
|
||||
|
||||
protected override void OnExecute()
|
||||
{
|
||||
var Value = (int)Variable.value;
|
||||
|
||||
if (Clear.value) Value &= ~(int)Flag.value;
|
||||
else Value |= (int)Flag.value;
|
||||
|
||||
Variable.value = Enum.ToObject(Variable.varRef.varType, Value);
|
||||
|
||||
EndAction();
|
||||
}
|
||||
|
||||
#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: 2cb60d6a9aa366d4f94c18d5e0d36b6c
|
||||
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/Actions/Blackboard/SetEnumFlag.cs
|
||||
uploadId: 704937
|
||||
@@ -0,0 +1,29 @@
|
||||
using NodeCanvas.Framework;
|
||||
using ParadoxNotion;
|
||||
using ParadoxNotion.Design;
|
||||
|
||||
|
||||
namespace NodeCanvas.Tasks.Actions
|
||||
{
|
||||
|
||||
[Category("✫ Blackboard")]
|
||||
[Description("Set a blackboard float variable")]
|
||||
public class SetFloat : ActionTask
|
||||
{
|
||||
|
||||
[BlackboardOnly]
|
||||
public BBParameter<float> valueA;
|
||||
public OperationMethod Operation = OperationMethod.Set;
|
||||
public BBParameter<float> valueB;
|
||||
public bool perSecond;
|
||||
|
||||
protected override string info {
|
||||
get { return string.Format("{0} {1} {2}{3}", valueA, OperationTools.GetOperationString(Operation), valueB, ( perSecond ? " Per Second" : "" )); }
|
||||
}
|
||||
|
||||
protected override void OnExecute() {
|
||||
valueA.value = OperationTools.Operate(valueA.value, valueB.value, Operation, perSecond ? UnityEngine.Time.deltaTime : 1f);
|
||||
EndAction(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 51f848e47c3fbed49a26ccf73bd4024a
|
||||
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/Actions/Blackboard/SetFloat.cs
|
||||
uploadId: 704937
|
||||
@@ -0,0 +1,28 @@
|
||||
using NodeCanvas.Framework;
|
||||
using ParadoxNotion.Design;
|
||||
using UnityEngine;
|
||||
|
||||
namespace NodeCanvas.Tasks.Actions
|
||||
{
|
||||
|
||||
[Category("✫ Blackboard")]
|
||||
[Description("Set a blackboard float variable at random between min and max value")]
|
||||
public class SetFloatRandom : ActionTask
|
||||
{
|
||||
|
||||
public BBParameter<float> minValue;
|
||||
public BBParameter<float> maxValue;
|
||||
|
||||
[BlackboardOnly]
|
||||
public BBParameter<float> floatVariable;
|
||||
|
||||
protected override string info {
|
||||
get { return "Set " + floatVariable + " Random(" + minValue + ", " + maxValue + ")"; }
|
||||
}
|
||||
|
||||
protected override void OnExecute() {
|
||||
floatVariable.value = Random.Range(minValue.value, maxValue.value);
|
||||
EndAction();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
fileFormatVersion: 2
|
||||
guid: f3adcd74c33b0da428edc26c6fed097b
|
||||
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/Actions/Blackboard/SetFloatRandom.cs
|
||||
uploadId: 704937
|
||||
@@ -0,0 +1,29 @@
|
||||
using NodeCanvas.Framework;
|
||||
using ParadoxNotion;
|
||||
using ParadoxNotion.Design;
|
||||
|
||||
|
||||
namespace NodeCanvas.Tasks.Actions
|
||||
{
|
||||
|
||||
[Name("Set Integer")]
|
||||
[Category("✫ Blackboard")]
|
||||
[Description("Set a blackboard integer variable")]
|
||||
public class SetInt : ActionTask
|
||||
{
|
||||
|
||||
[BlackboardOnly]
|
||||
public BBParameter<int> valueA;
|
||||
public OperationMethod Operation = OperationMethod.Set;
|
||||
public BBParameter<int> valueB;
|
||||
|
||||
protected override string info {
|
||||
get { return valueA + OperationTools.GetOperationString(Operation) + valueB; }
|
||||
}
|
||||
|
||||
protected override void OnExecute() {
|
||||
valueA.value = OperationTools.Operate(valueA.value, valueB.value, Operation);
|
||||
EndAction();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 7e7022659287e9947b7288e9b9b19906
|
||||
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/Actions/Blackboard/SetInt.cs
|
||||
uploadId: 704937
|
||||
@@ -0,0 +1,30 @@
|
||||
using NodeCanvas.Framework;
|
||||
using ParadoxNotion.Design;
|
||||
using UnityEngine;
|
||||
|
||||
|
||||
namespace NodeCanvas.Tasks.Actions
|
||||
{
|
||||
|
||||
[Name("Set Integer Random")]
|
||||
[Category("✫ Blackboard")]
|
||||
[Description("Set a blackboard integer variable at random between min and max value")]
|
||||
public class SetIntRandom : ActionTask
|
||||
{
|
||||
|
||||
public BBParameter<int> minValue;
|
||||
public BBParameter<int> maxValue;
|
||||
|
||||
[BlackboardOnly]
|
||||
public BBParameter<int> intVariable;
|
||||
|
||||
protected override string info {
|
||||
get { return "Set " + intVariable + " Random(" + minValue + ", " + maxValue + ")"; }
|
||||
}
|
||||
|
||||
protected override void OnExecute() {
|
||||
intVariable.value = Random.Range(minValue.value, maxValue.value + 1);
|
||||
EndAction();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
fileFormatVersion: 2
|
||||
guid: c41382e1a478f36429475e6a2bb32566
|
||||
timeCreated: 1430488716
|
||||
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/Actions/Blackboard/SetIntRandom.cs
|
||||
uploadId: 704937
|
||||
@@ -0,0 +1,44 @@
|
||||
using NodeCanvas.Framework;
|
||||
using NodeCanvas.Framework.Internal;
|
||||
using ParadoxNotion.Design;
|
||||
using UnityEngine;
|
||||
|
||||
|
||||
namespace NodeCanvas.Tasks.Actions
|
||||
{
|
||||
|
||||
[Category("✫ Blackboard")]
|
||||
[Description("Use this to set a variable on any blackboard by overriding the agent")]
|
||||
public class SetOtherBlackboardVariable : ActionTask<Blackboard>
|
||||
{
|
||||
|
||||
[RequiredField]
|
||||
public BBParameter<string> targetVariableName;
|
||||
public BBObjectParameter newValue;
|
||||
|
||||
protected override string info {
|
||||
get { return string.Format("<b>{0}</b> = {1}", targetVariableName.ToString(), newValue != null ? newValue.ToString() : ""); }
|
||||
}
|
||||
|
||||
protected override void OnExecute() {
|
||||
agent.SetVariableValue(targetVariableName.value, newValue.value);
|
||||
EndAction();
|
||||
}
|
||||
|
||||
///----------------------------------------------------------------------------------------------
|
||||
///---------------------------------------UNITY EDITOR-------------------------------------------
|
||||
#if UNITY_EDITOR
|
||||
|
||||
protected override void OnTaskInspectorGUI() {
|
||||
if ( GUILayout.Button("Select Target Variable Type") ) {
|
||||
EditorUtils.ShowPreferedTypesSelectionMenu(typeof(object), (t) => { newValue.SetType(t); });
|
||||
}
|
||||
|
||||
if ( newValue.varType != typeof(object) ) {
|
||||
DrawDefaultInspector();
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
fileFormatVersion: 2
|
||||
guid: efdb0ef782aeff746a21d318c4c5459f
|
||||
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/Actions/Blackboard/SetOtherBlackboardVariable.cs
|
||||
uploadId: 704937
|
||||
@@ -0,0 +1,24 @@
|
||||
using NodeCanvas.Framework;
|
||||
using ParadoxNotion.Design;
|
||||
|
||||
namespace NodeCanvas.Tasks.Actions
|
||||
{
|
||||
|
||||
[Category("✫ Blackboard")]
|
||||
public class SetVariable<T> : ActionTask
|
||||
{
|
||||
|
||||
[BlackboardOnly]
|
||||
public BBParameter<T> valueA;
|
||||
public BBParameter<T> valueB;
|
||||
|
||||
protected override string info {
|
||||
get { return valueA + " = " + valueB; }
|
||||
}
|
||||
|
||||
protected override void OnExecute() {
|
||||
valueA.value = valueB.value;
|
||||
EndAction();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 4a288d6b789d3d646a822eec3b23b924
|
||||
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/Actions/Blackboard/SetVariable.cs
|
||||
uploadId: 704937
|
||||
@@ -0,0 +1,30 @@
|
||||
using NodeCanvas.Framework;
|
||||
using ParadoxNotion;
|
||||
using ParadoxNotion.Design;
|
||||
using UnityEngine;
|
||||
|
||||
|
||||
namespace NodeCanvas.Tasks.Actions
|
||||
{
|
||||
|
||||
[Category("✫ Blackboard")]
|
||||
[Description("Set a blackboard Vector3 variable")]
|
||||
public class SetVector3 : ActionTask
|
||||
{
|
||||
|
||||
[BlackboardOnly]
|
||||
public BBParameter<Vector3> valueA;
|
||||
public OperationMethod operation;
|
||||
public BBParameter<Vector3> valueB;
|
||||
public bool perSecond;
|
||||
|
||||
protected override string info {
|
||||
get { return string.Format("{0} {1} {2}{3}", valueA, OperationTools.GetOperationString(operation), valueB, ( perSecond ? " Per Second" : "" )); }
|
||||
}
|
||||
|
||||
protected override void OnExecute() {
|
||||
valueA.value = OperationTools.Operate(valueA.value, valueB.value, operation, perSecond ? Time.deltaTime : 1f);
|
||||
EndAction();
|
||||
}
|
||||
}
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user