first commit
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
using NodeCanvas.Framework;
|
||||
using ParadoxNotion.Design;
|
||||
using UnityEngine;
|
||||
|
||||
|
||||
namespace NodeCanvas.Tasks.Actions
|
||||
{
|
||||
|
||||
[Category("GameObject")]
|
||||
public class CreateGameObject : ActionTask
|
||||
{
|
||||
|
||||
public BBParameter<string> objectName;
|
||||
public BBParameter<Vector3> position;
|
||||
public BBParameter<Vector3> rotation;
|
||||
|
||||
[BlackboardOnly]
|
||||
public BBParameter<GameObject> saveAs;
|
||||
|
||||
protected override void OnExecute() {
|
||||
var newGO = new GameObject(objectName.value);
|
||||
newGO.transform.position = position.value;
|
||||
newGO.transform.eulerAngles = rotation.value;
|
||||
saveAs.value = newGO;
|
||||
EndAction();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
fileFormatVersion: 2
|
||||
guid: df5bbf2b88ef95445935356468baedf9
|
||||
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/GameObject/CreateGameObject.cs
|
||||
uploadId: 704937
|
||||
@@ -0,0 +1,30 @@
|
||||
using NodeCanvas.Framework;
|
||||
using ParadoxNotion.Design;
|
||||
using UnityEngine;
|
||||
|
||||
|
||||
namespace NodeCanvas.Tasks.Actions
|
||||
{
|
||||
|
||||
[Category("GameObject")]
|
||||
public class CreatePrimitive : ActionTask
|
||||
{
|
||||
|
||||
public BBParameter<string> objectName;
|
||||
public BBParameter<Vector3> position;
|
||||
public BBParameter<Vector3> rotation;
|
||||
public BBParameter<PrimitiveType> type;
|
||||
|
||||
[BlackboardOnly]
|
||||
public BBParameter<GameObject> saveAs;
|
||||
|
||||
protected override void OnExecute() {
|
||||
var newGO = GameObject.CreatePrimitive(type.value);
|
||||
newGO.name = objectName.value;
|
||||
newGO.transform.position = position.value;
|
||||
newGO.transform.eulerAngles = rotation.value;
|
||||
saveAs.value = newGO;
|
||||
EndAction();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
fileFormatVersion: 2
|
||||
guid: de612f4b60c7af648ba4f59d7e49b887
|
||||
timeCreated: 1428004326
|
||||
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/GameObject/CreatePrimitive.cs
|
||||
uploadId: 704937
|
||||
@@ -0,0 +1,30 @@
|
||||
using NodeCanvas.Framework;
|
||||
using ParadoxNotion.Design;
|
||||
using UnityEngine;
|
||||
|
||||
|
||||
namespace NodeCanvas.Tasks.Actions
|
||||
{
|
||||
|
||||
[Category("GameObject")]
|
||||
public class DestroyGameObject : ActionTask<Transform>
|
||||
{
|
||||
|
||||
[Tooltip("DestroyImmediately is recomended if you are destroying objects in use of the framework.")]
|
||||
public bool immediately;
|
||||
|
||||
protected override string info {
|
||||
get { return string.Format("Destroy {0}", agentInfo); }
|
||||
}
|
||||
|
||||
//in case it destroys self
|
||||
protected override void OnUpdate() {
|
||||
if ( immediately ) {
|
||||
Object.DestroyImmediate(agent.gameObject);
|
||||
} else {
|
||||
Object.Destroy(agent.gameObject);
|
||||
}
|
||||
EndAction();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 638bb042fda0af24b98d43afb69da626
|
||||
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/GameObject/DestroyGameObject.cs
|
||||
uploadId: 704937
|
||||
@@ -0,0 +1,30 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using NodeCanvas.Framework;
|
||||
using ParadoxNotion.Design;
|
||||
using UnityEngine;
|
||||
|
||||
|
||||
namespace NodeCanvas.Tasks.Actions
|
||||
{
|
||||
|
||||
[Category("GameObject")]
|
||||
[Description("Action will end in Failure if no objects are found")]
|
||||
public class FindAllWithLayer : ActionTask
|
||||
{
|
||||
|
||||
[RequiredField]
|
||||
public BBParameter<LayerMask> targetLayers;
|
||||
[BlackboardOnly]
|
||||
public BBParameter<List<GameObject>> saveAs;
|
||||
|
||||
protected override string info {
|
||||
get { return "GetObjects in '" + targetLayers + "' as " + saveAs; }
|
||||
}
|
||||
|
||||
protected override void OnExecute() {
|
||||
saveAs.value = ParadoxNotion.ObjectUtils.FindGameObjectsWithinLayerMask(targetLayers.value).ToList();
|
||||
EndAction(saveAs.value.Count != 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
fileFormatVersion: 2
|
||||
guid: f86bab41242d1994eb0adc8aaa311add
|
||||
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/GameObject/FindAllWithLayer.cs
|
||||
uploadId: 704937
|
||||
@@ -0,0 +1,36 @@
|
||||
using System.Collections.Generic;
|
||||
using NodeCanvas.Framework;
|
||||
using ParadoxNotion.Design;
|
||||
using UnityEngine;
|
||||
|
||||
|
||||
namespace NodeCanvas.Tasks.Actions
|
||||
{
|
||||
|
||||
[Category("GameObject")]
|
||||
[Description("Note that this is slow.\nAction will end in Failure if no objects are found")]
|
||||
public class FindAllWithName : ActionTask
|
||||
{
|
||||
|
||||
[RequiredField]
|
||||
public BBParameter<string> searchName = "GameObject";
|
||||
[BlackboardOnly]
|
||||
public BBParameter<List<GameObject>> saveAs;
|
||||
|
||||
protected override string info {
|
||||
get { return "GetObjects '" + searchName + "' as " + saveAs; }
|
||||
}
|
||||
|
||||
protected override void OnExecute() {
|
||||
|
||||
var gos = new List<GameObject>();
|
||||
foreach ( var go in Object.FindObjectsByType<GameObject>(FindObjectsSortMode.None) ) {
|
||||
if ( go.name == searchName.value )
|
||||
gos.Add(go);
|
||||
}
|
||||
|
||||
saveAs.value = gos;
|
||||
EndAction(gos.Count != 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 396b0173f86d0b04fa2e6bcc6f150550
|
||||
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/GameObject/FindAllWithName.cs
|
||||
uploadId: 704937
|
||||
@@ -0,0 +1,30 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using NodeCanvas.Framework;
|
||||
using ParadoxNotion.Design;
|
||||
using UnityEngine;
|
||||
|
||||
|
||||
namespace NodeCanvas.Tasks.Actions
|
||||
{
|
||||
|
||||
[Category("GameObject")]
|
||||
[Description("Action will end in Failure if no objects are found")]
|
||||
public class FindAllWithTag : ActionTask
|
||||
{
|
||||
|
||||
[RequiredField, TagField]
|
||||
public BBParameter<string> searchTag = "Untagged";
|
||||
[BlackboardOnly]
|
||||
public BBParameter<List<GameObject>> saveAs;
|
||||
|
||||
protected override string info {
|
||||
get { return "GetObjects '" + searchTag + "' as " + saveAs; }
|
||||
}
|
||||
|
||||
protected override void OnExecute() {
|
||||
saveAs.value = GameObject.FindGameObjectsWithTag(searchTag.value).ToList();
|
||||
EndAction(saveAs.value.Count != 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
fileFormatVersion: 2
|
||||
guid: a108d61570245ad46ab4f8620dcb4c0e
|
||||
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/GameObject/FindAllWithTag.cs
|
||||
uploadId: 704937
|
||||
@@ -0,0 +1,29 @@
|
||||
using NodeCanvas.Framework;
|
||||
using ParadoxNotion.Design;
|
||||
using UnityEngine;
|
||||
|
||||
namespace NodeCanvas.Tasks.Actions
|
||||
{
|
||||
|
||||
[Category("GameObject")]
|
||||
[Description("Find a transform child by name within the agent's transform")]
|
||||
public class FindChildByName : ActionTask<Transform>
|
||||
{
|
||||
|
||||
[RequiredField]
|
||||
public BBParameter<string> childName;
|
||||
|
||||
[BlackboardOnly]
|
||||
public BBParameter<Transform> saveAs;
|
||||
|
||||
protected override string info {
|
||||
get { return string.Format("{0} = {1}.FindChild({2})", saveAs, agentInfo, childName); }
|
||||
}
|
||||
|
||||
protected override void OnExecute() {
|
||||
var result = agent.Find(childName.value);
|
||||
saveAs.value = result;
|
||||
EndAction(result != null);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
fileFormatVersion: 2
|
||||
guid: dc184b48292a1b44689b2678ddc4ff29
|
||||
timeCreated: 1481620865
|
||||
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/GameObject/FindChildByName.cs
|
||||
uploadId: 704937
|
||||
@@ -0,0 +1,58 @@
|
||||
using System.Linq;
|
||||
using NodeCanvas.Framework;
|
||||
using ParadoxNotion.Design;
|
||||
using UnityEngine;
|
||||
|
||||
|
||||
namespace NodeCanvas.Tasks.Actions
|
||||
{
|
||||
|
||||
[Category("GameObject")]
|
||||
[Description("Find the closest game object of tag to the agent")]
|
||||
public class FindClosestWithTag : ActionTask<Transform>
|
||||
{
|
||||
|
||||
[TagField]
|
||||
[RequiredField]
|
||||
public BBParameter<string> searchTag;
|
||||
public BBParameter<bool> ignoreChildren;
|
||||
[BlackboardOnly]
|
||||
public BBParameter<GameObject> saveObjectAs;
|
||||
[BlackboardOnly]
|
||||
public BBParameter<float> saveDistanceAs;
|
||||
|
||||
protected override void OnExecute() {
|
||||
|
||||
var found = GameObject.FindGameObjectsWithTag(searchTag.value);
|
||||
if ( found.Length == 0 ) {
|
||||
saveObjectAs.value = null;
|
||||
saveDistanceAs.value = 0;
|
||||
EndAction(false);
|
||||
return;
|
||||
}
|
||||
|
||||
GameObject closest = null;
|
||||
var dist = Mathf.Infinity;
|
||||
foreach ( var go in found ) {
|
||||
|
||||
if ( go.transform == agent ) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if ( ignoreChildren.value && go.transform.IsChildOf(agent) ) {
|
||||
continue;
|
||||
}
|
||||
|
||||
var newDist = Vector3.Distance(go.transform.position, agent.position);
|
||||
if ( newDist < dist ) {
|
||||
dist = newDist;
|
||||
closest = go;
|
||||
}
|
||||
}
|
||||
|
||||
saveObjectAs.value = closest;
|
||||
saveDistanceAs.value = dist;
|
||||
EndAction();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
fileFormatVersion: 2
|
||||
guid: cb1786bed55fb7344bc37169af0b0f79
|
||||
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/GameObject/FindClosestWithTag.cs
|
||||
uploadId: 704937
|
||||
@@ -0,0 +1,31 @@
|
||||
using NodeCanvas.Framework;
|
||||
using ParadoxNotion.Design;
|
||||
using UnityEngine;
|
||||
|
||||
|
||||
namespace NodeCanvas.Tasks.Actions
|
||||
{
|
||||
|
||||
[Category("GameObject")]
|
||||
[Description("Note that this is very slow")]
|
||||
public class FindObjectOfType<T> : ActionTask where T : Component
|
||||
{
|
||||
|
||||
[BlackboardOnly]
|
||||
public BBParameter<T> saveComponentAs;
|
||||
[BlackboardOnly]
|
||||
public BBParameter<GameObject> saveGameObjectAs;
|
||||
|
||||
protected override void OnExecute() {
|
||||
var o = Object.FindAnyObjectByType<T>();
|
||||
if ( o != null ) {
|
||||
saveComponentAs.value = o;
|
||||
saveGameObjectAs.value = o.gameObject;
|
||||
EndAction(true);
|
||||
return;
|
||||
}
|
||||
|
||||
EndAction(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 52a4a3a41948df946af285273ff3c3de
|
||||
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/GameObject/FindObjectOfType.cs
|
||||
uploadId: 704937
|
||||
@@ -0,0 +1,34 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using NodeCanvas.Framework;
|
||||
using ParadoxNotion.Design;
|
||||
using UnityEngine;
|
||||
|
||||
|
||||
namespace NodeCanvas.Tasks.Actions
|
||||
{
|
||||
|
||||
[Category("GameObject")]
|
||||
[Description("Note that this is very slow")]
|
||||
public class FindObjectsOfType<T> : ActionTask where T : Component
|
||||
{
|
||||
|
||||
[BlackboardOnly]
|
||||
public BBParameter<List<GameObject>> saveGameObjects;
|
||||
[BlackboardOnly]
|
||||
public BBParameter<List<T>> saveComponents;
|
||||
|
||||
protected override void OnExecute() {
|
||||
|
||||
var objects = Object.FindObjectsByType<T>(FindObjectsSortMode.None);
|
||||
if ( objects != null && objects.Length != 0 ) {
|
||||
saveGameObjects.value = objects.Select(o => o.gameObject).ToList();
|
||||
saveComponents.value = objects.ToList();
|
||||
EndAction(true);
|
||||
return;
|
||||
}
|
||||
|
||||
EndAction(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
fileFormatVersion: 2
|
||||
guid: c613b340928dbd74fac60067655b39ce
|
||||
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/GameObject/FindObjectsOfType.cs
|
||||
uploadId: 704937
|
||||
@@ -0,0 +1,28 @@
|
||||
using NodeCanvas.Framework;
|
||||
using ParadoxNotion.Design;
|
||||
using UnityEngine;
|
||||
|
||||
|
||||
namespace NodeCanvas.Tasks.Actions
|
||||
{
|
||||
|
||||
[Category("GameObject")]
|
||||
public class FindWithName : ActionTask
|
||||
{
|
||||
|
||||
[RequiredField]
|
||||
public BBParameter<string> gameObjectName;
|
||||
[BlackboardOnly]
|
||||
public BBParameter<GameObject> saveAs;
|
||||
|
||||
protected override string info {
|
||||
get { return "Find Object " + gameObjectName + " as " + saveAs; }
|
||||
}
|
||||
|
||||
protected override void OnExecute() {
|
||||
|
||||
saveAs.value = GameObject.Find(gameObjectName.value);
|
||||
EndAction();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 1dad36b464a1dae41ba27af7d54ea50b
|
||||
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/GameObject/FindWithName.cs
|
||||
uploadId: 704937
|
||||
@@ -0,0 +1,29 @@
|
||||
using NodeCanvas.Framework;
|
||||
using ParadoxNotion.Design;
|
||||
using UnityEngine;
|
||||
|
||||
|
||||
namespace NodeCanvas.Tasks.Actions
|
||||
{
|
||||
|
||||
[Category("GameObject")]
|
||||
public class FindWithTag : ActionTask
|
||||
{
|
||||
|
||||
[RequiredField]
|
||||
[TagField]
|
||||
public string searchTag = "Untagged";
|
||||
|
||||
[BlackboardOnly]
|
||||
public BBParameter<GameObject> saveAs;
|
||||
|
||||
protected override string info {
|
||||
get { return "GetObject '" + searchTag + "' as " + saveAs; }
|
||||
}
|
||||
|
||||
protected override void OnExecute() {
|
||||
saveAs.value = GameObject.FindWithTag(searchTag);
|
||||
EndAction();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
fileFormatVersion: 2
|
||||
guid: bc55926081afaf5498a2c14e1b14b028
|
||||
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/GameObject/FindWithTag.cs
|
||||
uploadId: 704937
|
||||
@@ -0,0 +1,45 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using NodeCanvas.Framework;
|
||||
using ParadoxNotion.Design;
|
||||
using UnityEngine;
|
||||
|
||||
|
||||
namespace NodeCanvas.Tasks.Actions
|
||||
{
|
||||
|
||||
[Category("GameObject")]
|
||||
public class GetAllChildGameObjects : ActionTask<Transform>
|
||||
{
|
||||
|
||||
[BlackboardOnly]
|
||||
public BBParameter<List<GameObject>> saveAs;
|
||||
public bool recursive = false;
|
||||
|
||||
protected override string info {
|
||||
get { return string.Format("{0} = {1} Children Of {2}", saveAs, recursive ? "All" : "First", agentInfo); }
|
||||
}
|
||||
|
||||
protected override void OnExecute() {
|
||||
|
||||
var found = new List<Transform>();
|
||||
foreach ( Transform t in agent.transform ) {
|
||||
found.Add(t);
|
||||
if ( recursive ) {
|
||||
found.AddRange(Get(t));
|
||||
}
|
||||
}
|
||||
saveAs.value = found.Select(t => t.gameObject).ToList();
|
||||
EndAction();
|
||||
}
|
||||
|
||||
List<Transform> Get(Transform parent) {
|
||||
var found = new List<Transform>();
|
||||
foreach ( Transform t in parent ) {
|
||||
found.Add(t);
|
||||
found.AddRange(Get(t));
|
||||
}
|
||||
return found;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 5b5c9e187f9673a4399e8866e7b1bde5
|
||||
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/GameObject/GetAllChildGameObjects.cs
|
||||
uploadId: 704937
|
||||
@@ -0,0 +1,26 @@
|
||||
using NodeCanvas.Framework;
|
||||
using ParadoxNotion.Design;
|
||||
using UnityEngine;
|
||||
|
||||
|
||||
namespace NodeCanvas.Tasks.Actions
|
||||
{
|
||||
|
||||
[Category("GameObject")]
|
||||
public class GetComponent<T> : ActionTask<Transform> where T : Component
|
||||
{
|
||||
|
||||
[BlackboardOnly]
|
||||
public BBParameter<T> saveAs;
|
||||
|
||||
protected override string info {
|
||||
get { return string.Format("Get {0} as {1}", typeof(T).Name, saveAs.ToString()); }
|
||||
}
|
||||
|
||||
protected override void OnExecute() {
|
||||
var o = agent.GetComponent<T>();
|
||||
saveAs.value = o;
|
||||
EndAction(o != null);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
fileFormatVersion: 2
|
||||
guid: a83d9c12e6e941f478dbbe72000a572c
|
||||
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/GameObject/GetComponent.cs
|
||||
uploadId: 704937
|
||||
@@ -0,0 +1,28 @@
|
||||
using NodeCanvas.Framework;
|
||||
using ParadoxNotion.Design;
|
||||
using UnityEngine;
|
||||
|
||||
|
||||
namespace NodeCanvas.Tasks.Actions
|
||||
{
|
||||
|
||||
[Category("GameObject")]
|
||||
public class GetDistance : ActionTask<Transform>
|
||||
{
|
||||
|
||||
[RequiredField]
|
||||
public BBParameter<GameObject> target;
|
||||
[BlackboardOnly]
|
||||
public BBParameter<float> saveAs;
|
||||
|
||||
protected override string info {
|
||||
get { return string.Format("Get Distance to {0}", target.ToString()); }
|
||||
}
|
||||
|
||||
protected override void OnExecute() {
|
||||
|
||||
saveAs.value = Vector3.Distance(agent.position, target.value.transform.position);
|
||||
EndAction();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 02ab2522b615cde4a8fc9019ccd42f78
|
||||
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/GameObject/GetDistance.cs
|
||||
uploadId: 704937
|
||||
@@ -0,0 +1,26 @@
|
||||
using NodeCanvas.Framework;
|
||||
using ParadoxNotion.Design;
|
||||
using UnityEngine;
|
||||
|
||||
|
||||
namespace NodeCanvas.Tasks.Actions
|
||||
{
|
||||
|
||||
[System.Obsolete("Use Get Property instead")]
|
||||
[Category("GameObject")]
|
||||
public class GetGameObjectPosition : ActionTask<Transform>
|
||||
{
|
||||
|
||||
[BlackboardOnly]
|
||||
public BBParameter<Vector3> saveAs;
|
||||
|
||||
protected override string info {
|
||||
get { return "Get " + agentInfo + " position as " + saveAs; }
|
||||
}
|
||||
|
||||
protected override void OnExecute() {
|
||||
saveAs.value = agent.position;
|
||||
EndAction();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 1bc221c2055daaf439426eed557a46cc
|
||||
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/GameObject/GetGameObjectPosition.cs
|
||||
uploadId: 704937
|
||||
@@ -0,0 +1,38 @@
|
||||
using NodeCanvas.Framework;
|
||||
using ParadoxNotion.Design;
|
||||
using UnityEngine;
|
||||
|
||||
namespace NodeCanvas.Tasks.Actions
|
||||
{
|
||||
[Category("GameObject")]
|
||||
public class InstantiateGameObject : ActionTask<Transform>
|
||||
{
|
||||
public BBParameter<Transform> parent;
|
||||
public BBParameter<Vector3> clonePosition;
|
||||
public BBParameter<Vector3> cloneRotation;
|
||||
[BlackboardOnly]
|
||||
public BBParameter<GameObject> saveCloneAs;
|
||||
|
||||
protected override string info {
|
||||
get { return "Instantiate " + agentInfo + " under " + ( parent.value ? parent.ToString() : "World" ) + " at " + clonePosition + " as " + saveCloneAs; }
|
||||
}
|
||||
|
||||
protected override void OnExecute() {
|
||||
#if UNITY_5_4_OR_NEWER
|
||||
|
||||
var clone = (GameObject)Object.Instantiate(agent.gameObject, parent.value, false);
|
||||
|
||||
#else
|
||||
|
||||
var clone = (GameObject)Object.Instantiate(agent.gameObject);
|
||||
clone.transform.SetParent(parent.value);
|
||||
|
||||
#endif
|
||||
|
||||
clone.transform.position = clonePosition.value;
|
||||
clone.transform.eulerAngles = cloneRotation.value;
|
||||
saveCloneAs.value = clone;
|
||||
EndAction();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 33393d9682842484ebbbc1e4c2e29149
|
||||
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/GameObject/InstantiateGameObject.cs
|
||||
uploadId: 704937
|
||||
@@ -0,0 +1,33 @@
|
||||
using NodeCanvas.Framework;
|
||||
using ParadoxNotion.Design;
|
||||
using UnityEngine;
|
||||
|
||||
|
||||
namespace NodeCanvas.Tasks.Actions
|
||||
{
|
||||
|
||||
[Category("GameObject")]
|
||||
public class LookAt : ActionTask<Transform>
|
||||
{
|
||||
|
||||
[RequiredField]
|
||||
public BBParameter<GameObject> lookTarget;
|
||||
public bool repeat = false;
|
||||
|
||||
protected override string info {
|
||||
get { return "LookAt " + lookTarget; }
|
||||
}
|
||||
|
||||
protected override void OnExecute() { DoLook(); }
|
||||
protected override void OnUpdate() { DoLook(); }
|
||||
|
||||
void DoLook() {
|
||||
var lookPos = lookTarget.value.transform.position;
|
||||
lookPos.y = agent.position.y;
|
||||
agent.LookAt(lookPos);
|
||||
|
||||
if ( !repeat )
|
||||
EndAction(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 50b2f3f7e383d0c41b18b2f57b9ce81a
|
||||
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/GameObject/LookAt.cs
|
||||
uploadId: 704937
|
||||
@@ -0,0 +1,35 @@
|
||||
using NodeCanvas.Framework;
|
||||
using ParadoxNotion.Design;
|
||||
using UnityEngine;
|
||||
|
||||
|
||||
namespace NodeCanvas.Tasks.Actions
|
||||
{
|
||||
|
||||
[Category("GameObject")]
|
||||
public class RemoveComponent<T> : ActionTask<Transform> where T : Component
|
||||
{
|
||||
|
||||
[Tooltip("DestroyImmediately is recomended if you are destroying objects in use of the framework.")]
|
||||
public bool immediately;
|
||||
|
||||
protected override string info {
|
||||
get { return string.Format("Remove '{0}'", typeof(T).Name); }
|
||||
}
|
||||
|
||||
protected override void OnExecute() {
|
||||
var o = agent.GetComponent<T>();
|
||||
if ( o != null ) {
|
||||
if ( immediately ) {
|
||||
Object.DestroyImmediate(o);
|
||||
} else {
|
||||
Object.Destroy(o);
|
||||
}
|
||||
EndAction(true);
|
||||
return;
|
||||
}
|
||||
|
||||
EndAction(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 56f7d28684dc9b946a4e1507c456a85f
|
||||
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/GameObject/RemoveComponent.cs
|
||||
uploadId: 704937
|
||||
@@ -0,0 +1,45 @@
|
||||
using NodeCanvas.Framework;
|
||||
using ParadoxNotion.Design;
|
||||
using UnityEngine;
|
||||
|
||||
|
||||
namespace NodeCanvas.Tasks.Actions
|
||||
{
|
||||
|
||||
[Name("Set Active")]
|
||||
[Category("GameObject")]
|
||||
[Description("Set the gameobject active state.")]
|
||||
public class SetObjectActive : ActionTask<Transform>
|
||||
{
|
||||
|
||||
public enum SetActiveMode
|
||||
{
|
||||
Deactivate = 0,
|
||||
Activate = 1,
|
||||
Toggle = 2
|
||||
}
|
||||
|
||||
public SetActiveMode setTo = SetActiveMode.Toggle;
|
||||
|
||||
protected override string info {
|
||||
get { return string.Format("{0} {1}", setTo, agentInfo); }
|
||||
}
|
||||
|
||||
protected override void OnExecute() {
|
||||
|
||||
bool value;
|
||||
|
||||
if ( setTo == SetActiveMode.Toggle ) {
|
||||
|
||||
value = !agent.gameObject.activeSelf;
|
||||
|
||||
} else {
|
||||
|
||||
value = (int)setTo == 1;
|
||||
}
|
||||
|
||||
agent.gameObject.SetActive(value);
|
||||
EndAction();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 34e89c5d7e11bc644961197ddd8d54a2
|
||||
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/GameObject/SetObjectActive.cs
|
||||
uploadId: 704937
|
||||
@@ -0,0 +1,44 @@
|
||||
using NodeCanvas.Framework;
|
||||
using ParadoxNotion.Design;
|
||||
using UnityEngine;
|
||||
|
||||
|
||||
namespace NodeCanvas.Tasks.Actions
|
||||
{
|
||||
|
||||
[Name("Set Enabled")]
|
||||
[Category("GameObject")]
|
||||
[Description("Set the monobehaviour's enabled state.")]
|
||||
public class SetObjectEnabled : ActionTask<MonoBehaviour>
|
||||
{
|
||||
public enum SetEnableMode
|
||||
{
|
||||
Disable = 0,
|
||||
Enable = 1,
|
||||
Toggle = 2
|
||||
}
|
||||
|
||||
public SetEnableMode setTo = SetEnableMode.Toggle;
|
||||
|
||||
protected override string info {
|
||||
get { return string.Format("{0} {1}", setTo, agentInfo); }
|
||||
}
|
||||
|
||||
protected override void OnExecute() {
|
||||
|
||||
bool value;
|
||||
|
||||
if ( setTo == SetEnableMode.Toggle ) {
|
||||
|
||||
value = !agent.enabled;
|
||||
|
||||
} else {
|
||||
|
||||
value = (int)setTo == 1;
|
||||
}
|
||||
|
||||
agent.enabled = value;
|
||||
EndAction();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 0b4555e2ab5235c49834062e7fd4c2b1
|
||||
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/GameObject/SetObjectEnabled.cs
|
||||
uploadId: 704937
|
||||
@@ -0,0 +1,45 @@
|
||||
using NodeCanvas.Framework;
|
||||
using ParadoxNotion.Design;
|
||||
using UnityEngine;
|
||||
|
||||
|
||||
namespace NodeCanvas.Tasks.Actions
|
||||
{
|
||||
|
||||
[Name("Set Visibility")]
|
||||
[Category("GameObject")]
|
||||
[Description("Set the Renderer active state, thus making the object visible or invisible.")]
|
||||
public class SetObjectVisibility : ActionTask<Renderer>
|
||||
{
|
||||
|
||||
public enum SetVisibleMode
|
||||
{
|
||||
Hide = 0,
|
||||
Show = 1,
|
||||
Toggle = 2
|
||||
}
|
||||
|
||||
public SetVisibleMode setTo = SetVisibleMode.Toggle;
|
||||
|
||||
protected override string info {
|
||||
get { return string.Format("{0} {1}", setTo, agentInfo); }
|
||||
}
|
||||
|
||||
protected override void OnExecute() {
|
||||
|
||||
bool value;
|
||||
|
||||
if ( setTo == SetVisibleMode.Toggle ) {
|
||||
|
||||
value = !agent.enabled;
|
||||
|
||||
} else {
|
||||
|
||||
value = (int)setTo == 1;
|
||||
}
|
||||
|
||||
agent.enabled = value;
|
||||
EndAction();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
fileFormatVersion: 2
|
||||
guid: b6a3d24f2d22d28489a768a32b002a10
|
||||
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/GameObject/SetObjectVisibility.cs
|
||||
uploadId: 704937
|
||||
Reference in New Issue
Block a user