first commit
This commit is contained in:
@@ -0,0 +1,40 @@
|
||||
using NodeCanvas.Framework;
|
||||
using ParadoxNotion.Design;
|
||||
using UnityEngine;
|
||||
|
||||
|
||||
namespace NodeCanvas.Tasks.Actions
|
||||
{
|
||||
|
||||
[Category("Input (Legacy System)")]
|
||||
public class GetInputAxis : ActionTask
|
||||
{
|
||||
|
||||
public BBParameter<string> xAxisName = "Horizontal";
|
||||
public BBParameter<string> yAxisName;
|
||||
public BBParameter<string> zAxisName = "Vertical";
|
||||
public BBParameter<float> multiplier = 1;
|
||||
[BlackboardOnly] public BBParameter<Vector3> saveAs;
|
||||
[BlackboardOnly] public BBParameter<float> saveXAs;
|
||||
[BlackboardOnly] public BBParameter<float> saveYAs;
|
||||
[BlackboardOnly] public BBParameter<float> saveZAs;
|
||||
|
||||
public bool repeat;
|
||||
|
||||
protected override void OnExecute() { Do(); }
|
||||
protected override void OnUpdate() { Do(); }
|
||||
|
||||
void Do() {
|
||||
|
||||
var x = string.IsNullOrEmpty(xAxisName.value) ? 0 : Input.GetAxis(xAxisName.value);
|
||||
var y = string.IsNullOrEmpty(yAxisName.value) ? 0 : Input.GetAxis(yAxisName.value);
|
||||
var z = string.IsNullOrEmpty(zAxisName.value) ? 0 : Input.GetAxis(zAxisName.value);
|
||||
|
||||
saveXAs.value = x * multiplier.value;
|
||||
saveYAs.value = y * multiplier.value;
|
||||
saveZAs.value = z * multiplier.value;
|
||||
saveAs.value = new Vector3(x, y, z) * multiplier.value;
|
||||
if ( !repeat ) { EndAction(); }
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
fileFormatVersion: 2
|
||||
guid: e13f759b2619828498833acc2efc724b
|
||||
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/Input/GetInputAxis.cs
|
||||
uploadId: 704937
|
||||
@@ -0,0 +1,24 @@
|
||||
using NodeCanvas.Framework;
|
||||
using ParadoxNotion.Design;
|
||||
using UnityEngine;
|
||||
|
||||
|
||||
namespace NodeCanvas.Tasks.Actions
|
||||
{
|
||||
|
||||
[Category("Input (Legacy System)")]
|
||||
public class GetMousePosition : ActionTask
|
||||
{
|
||||
|
||||
[BlackboardOnly] public BBParameter<Vector3> saveAs;
|
||||
public bool repeat;
|
||||
|
||||
protected override void OnExecute() { Do(); }
|
||||
protected override void OnUpdate() { Do(); }
|
||||
|
||||
void Do() {
|
||||
saveAs.value = Input.mousePosition;
|
||||
if ( !repeat ) { EndAction(); }
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 5aaa2458b8267fe4ebd8e89d8c36c146
|
||||
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/Input/GetMousePosition.cs
|
||||
uploadId: 704937
|
||||
@@ -0,0 +1,28 @@
|
||||
using NodeCanvas.Framework;
|
||||
using ParadoxNotion.Design;
|
||||
using UnityEngine;
|
||||
|
||||
|
||||
namespace NodeCanvas.Tasks.Actions
|
||||
{
|
||||
|
||||
[Category("Input (Legacy System)")]
|
||||
public class GetMouseScrollDelta : ActionTask
|
||||
{
|
||||
|
||||
[BlackboardOnly] public BBParameter<float> saveAs;
|
||||
public bool repeat = false;
|
||||
|
||||
protected override string info {
|
||||
get { return "Get Scroll Delta as " + saveAs; }
|
||||
}
|
||||
|
||||
protected override void OnExecute() { Do(); }
|
||||
protected override void OnUpdate() { Do(); }
|
||||
|
||||
void Do() {
|
||||
saveAs.value = Input.GetAxis("Mouse ScrollWheel");
|
||||
if ( !repeat ) { EndAction(); }
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
fileFormatVersion: 2
|
||||
guid: ad219d91993d6a543a69cf2701c30dcf
|
||||
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/Input/GetMouseScrollDelta.cs
|
||||
uploadId: 704937
|
||||
@@ -0,0 +1,45 @@
|
||||
using NodeCanvas.Framework;
|
||||
using ParadoxNotion.Design;
|
||||
using UnityEngine;
|
||||
|
||||
|
||||
namespace NodeCanvas.Tasks.Actions
|
||||
{
|
||||
|
||||
[Category("Input (Legacy System)")]
|
||||
public class WaitMousePick : ActionTask
|
||||
{
|
||||
|
||||
public enum ButtonKeys
|
||||
{
|
||||
Left = 0,
|
||||
Right = 1,
|
||||
Middle = 2
|
||||
}
|
||||
|
||||
public ButtonKeys buttonKey;
|
||||
public LayerMask mask = -1;
|
||||
[BlackboardOnly] public BBParameter<GameObject> saveObjectAs;
|
||||
[BlackboardOnly] public BBParameter<float> saveDistanceAs;
|
||||
[BlackboardOnly] public BBParameter<Vector3> savePositionAs;
|
||||
|
||||
private int buttonID;
|
||||
private RaycastHit hit;
|
||||
|
||||
protected override string info {
|
||||
get { return string.Format("Wait Object '{0}' Click. Save As {1}", buttonKey, saveObjectAs); }
|
||||
}
|
||||
|
||||
protected override void OnUpdate() {
|
||||
buttonID = (int)buttonKey;
|
||||
if ( Input.GetMouseButtonDown(buttonID) ) {
|
||||
if ( Physics.Raycast(Camera.main.ScreenPointToRay(Input.mousePosition), out hit, Mathf.Infinity, mask) ) {
|
||||
savePositionAs.value = hit.point;
|
||||
saveObjectAs.value = hit.collider.gameObject;
|
||||
saveDistanceAs.value = hit.distance;
|
||||
EndAction(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
fileFormatVersion: 2
|
||||
guid: d8c6a493b4a07f74da46667203de8fe4
|
||||
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/Input/WaitMousePick.cs
|
||||
uploadId: 704937
|
||||
@@ -0,0 +1,47 @@
|
||||
using NodeCanvas.Framework;
|
||||
using ParadoxNotion.Design;
|
||||
using UnityEngine;
|
||||
|
||||
|
||||
namespace NodeCanvas.Tasks.Actions
|
||||
{
|
||||
|
||||
[Category("Input (Legacy System)")]
|
||||
public class WaitMousePick2D : ActionTask
|
||||
{
|
||||
|
||||
public enum ButtonKeys
|
||||
{
|
||||
Left = 0,
|
||||
Right = 1,
|
||||
Middle = 2
|
||||
}
|
||||
|
||||
public ButtonKeys buttonKey;
|
||||
public LayerMask mask = -1;
|
||||
[BlackboardOnly] public BBParameter<GameObject> saveObjectAs;
|
||||
[BlackboardOnly] public BBParameter<float> saveDistanceAs;
|
||||
[BlackboardOnly] public BBParameter<Vector3> savePositionAs;
|
||||
|
||||
private int buttonID;
|
||||
private RaycastHit2D hit;
|
||||
|
||||
protected override string info {
|
||||
get { return string.Format("Wait Object '{0}' Click. Save As {1}", buttonKey, saveObjectAs); }
|
||||
}
|
||||
|
||||
protected override void OnUpdate() {
|
||||
buttonID = (int)buttonKey;
|
||||
if ( Input.GetMouseButtonDown(buttonID) ) {
|
||||
var ray = Camera.main.ScreenPointToRay(Input.mousePosition);
|
||||
hit = Physics2D.Raycast(ray.origin, ray.direction, Mathf.Infinity, mask);
|
||||
if ( hit.collider != null ) {
|
||||
savePositionAs.value = hit.point;
|
||||
saveObjectAs.value = hit.collider.gameObject;
|
||||
saveDistanceAs.value = hit.distance;
|
||||
EndAction(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 8d38a0de36906f74d959ac781416dbd8
|
||||
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/Input/WaitMousePick2D.cs
|
||||
uploadId: 704937
|
||||
Reference in New Issue
Block a user