添加bd
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
#if GRAPH_DESIGNER
|
||||
/// ---------------------------------------------
|
||||
/// Behavior Designer
|
||||
/// Copyright (c) Opsive. All Rights Reserved.
|
||||
/// https://www.opsive.com
|
||||
/// ---------------------------------------------
|
||||
namespace Opsive.BehaviorDesigner.Runtime.Tasks.Actions.Math
|
||||
{
|
||||
using Opsive.GraphDesigner.Runtime;
|
||||
using Opsive.GraphDesigner.Runtime.Variables;
|
||||
using UnityEngine;
|
||||
|
||||
[Opsive.Shared.Utility.Description("Flips the value of the boolean.")]
|
||||
[Shared.Utility.Category("Math")]
|
||||
public class BoolFlip : Action
|
||||
{
|
||||
[Tooltip("The bool that should be flipped.")]
|
||||
[SerializeField] protected SharedVariable<bool> m_Bool;
|
||||
|
||||
/// <summary>
|
||||
/// Executes the task.
|
||||
/// </summary>
|
||||
/// <returns>The execution status of the task.</returns>
|
||||
public override TaskStatus OnUpdate()
|
||||
{
|
||||
m_Bool.Value = !m_Bool.Value;
|
||||
return TaskStatus.Success;
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: a6654554de66a1340bff69fd22ffcacf
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,61 @@
|
||||
#if GRAPH_DESIGNER
|
||||
/// ---------------------------------------------
|
||||
/// Behavior Designer
|
||||
/// Copyright (c) Opsive. All Rights Reserved.
|
||||
/// https://www.opsive.com
|
||||
/// ---------------------------------------------
|
||||
namespace Opsive.BehaviorDesigner.Runtime.Tasks.Actions.Math
|
||||
{
|
||||
using Opsive.GraphDesigner.Runtime;
|
||||
using Opsive.GraphDesigner.Runtime.Variables;
|
||||
using UnityEngine;
|
||||
|
||||
[Opsive.Shared.Utility.Description("Performs a math operation on the two booleans.")]
|
||||
[Shared.Utility.Category("Math")]
|
||||
public class BoolOperator : Action
|
||||
{
|
||||
/// <summary>
|
||||
/// Specifies the type of bool operation that should be performed.
|
||||
/// </summary>
|
||||
protected enum Operation
|
||||
{
|
||||
AND, // Returns the AND between two booleans.
|
||||
OR, // Returns the OR between two booleans.
|
||||
NAND, // Returns the NAND between two booleans.
|
||||
XOR, // Returns the XOR between two booleans.
|
||||
}
|
||||
|
||||
[Tooltip("The operation to perform.")]
|
||||
[SerializeField] protected SharedVariable<Operation> m_Operation;
|
||||
[Tooltip("The first boolean.")]
|
||||
[SerializeField] protected SharedVariable<bool> m_Bool1;
|
||||
[Tooltip("The second boolean.")]
|
||||
[SerializeField] protected SharedVariable<bool> m_Bool2;
|
||||
[Tooltip("The variable to store the result.")]
|
||||
[RequireShared] [SerializeField] protected SharedVariable<bool> m_StoreResult;
|
||||
|
||||
/// <summary>
|
||||
/// Executes the task.
|
||||
/// </summary>
|
||||
/// <returns>The execution status of the task.</returns>
|
||||
public override TaskStatus OnUpdate()
|
||||
{
|
||||
switch (m_Operation.Value) {
|
||||
case Operation.AND:
|
||||
m_StoreResult.Value = m_Bool1.Value && m_Bool2.Value;
|
||||
break;
|
||||
case Operation.OR:
|
||||
m_StoreResult.Value = m_Bool1.Value || m_Bool2.Value;
|
||||
break;
|
||||
case Operation.NAND:
|
||||
m_StoreResult.Value = !(m_Bool1.Value && m_Bool2.Value);
|
||||
break;
|
||||
case Operation.XOR:
|
||||
m_StoreResult.Value = (m_Bool1.Value ^ m_Bool2.Value);
|
||||
break;
|
||||
}
|
||||
return TaskStatus.Success;
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: bf243997f53145143915ba48268817b4
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,73 @@
|
||||
#if GRAPH_DESIGNER
|
||||
/// ---------------------------------------------
|
||||
/// Behavior Designer
|
||||
/// Copyright (c) Opsive. All Rights Reserved.
|
||||
/// https://www.opsive.com
|
||||
/// ---------------------------------------------
|
||||
namespace Opsive.BehaviorDesigner.Runtime.Tasks.Actions.Math
|
||||
{
|
||||
using Opsive.GraphDesigner.Runtime;
|
||||
using Opsive.GraphDesigner.Runtime.Variables;
|
||||
using UnityEngine;
|
||||
|
||||
[Opsive.Shared.Utility.Description("Performs a math operation on the two floats.")]
|
||||
[Shared.Utility.Category("Math")]
|
||||
public class FloatOperator : Action
|
||||
{
|
||||
/// <summary>
|
||||
/// Specifies the type of float operation that should be performed.
|
||||
/// </summary>
|
||||
protected enum Operation
|
||||
{
|
||||
Add, // Returns the addition between two floats.
|
||||
Subtract, // Returns the division between two floats.
|
||||
Multiply, // Returns the multiplication between two floats.
|
||||
Divide, // Returns the division between two floats.
|
||||
Modulo, // Returns the modulo between two floats.
|
||||
Min, // Returns the minimum of two floats.
|
||||
Max, // Returns the maximum of two floats.
|
||||
}
|
||||
|
||||
[Tooltip("The operation to perform.")]
|
||||
[SerializeField] protected SharedVariable<Operation> m_Operation;
|
||||
[Tooltip("The first float.")]
|
||||
[SerializeField] protected SharedVariable<float> m_Float1;
|
||||
[Tooltip("The second float.")]
|
||||
[SerializeField] protected SharedVariable<float> m_Float2;
|
||||
[Tooltip("The variable to store the result.")]
|
||||
[RequireShared] [SerializeField] protected SharedVariable<float> m_StoreResult;
|
||||
|
||||
/// <summary>
|
||||
/// Executes the task.
|
||||
/// </summary>
|
||||
/// <returns>The execution status of the task.</returns>
|
||||
public override TaskStatus OnUpdate()
|
||||
{
|
||||
switch (m_Operation.Value) {
|
||||
case Operation.Add:
|
||||
m_StoreResult.Value = m_Float1.Value + m_Float2.Value;
|
||||
break;
|
||||
case Operation.Subtract:
|
||||
m_StoreResult.Value = m_Float1.Value - m_Float2.Value;
|
||||
break;
|
||||
case Operation.Multiply:
|
||||
m_StoreResult.Value = m_Float1.Value * m_Float2.Value;
|
||||
break;
|
||||
case Operation.Divide:
|
||||
m_StoreResult.Value = m_Float1.Value / m_Float2.Value;
|
||||
break;
|
||||
case Operation.Modulo:
|
||||
m_StoreResult.Value = m_Float1.Value % m_Float2.Value;
|
||||
break;
|
||||
case Operation.Min:
|
||||
m_StoreResult.Value = Mathf.Min(m_Float1.Value, m_Float2.Value);
|
||||
break;
|
||||
case Operation.Max:
|
||||
m_StoreResult.Value = Mathf.Max(m_Float1.Value, m_Float2.Value);
|
||||
break;
|
||||
}
|
||||
return TaskStatus.Success;
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: fd85a074520c85b4aac9a2e02a37fe47
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,73 @@
|
||||
#if GRAPH_DESIGNER
|
||||
/// ---------------------------------------------
|
||||
/// Behavior Designer
|
||||
/// Copyright (c) Opsive. All Rights Reserved.
|
||||
/// https://www.opsive.com
|
||||
/// ---------------------------------------------
|
||||
namespace Opsive.BehaviorDesigner.Runtime.Tasks.Actions.Math
|
||||
{
|
||||
using Opsive.GraphDesigner.Runtime;
|
||||
using Opsive.GraphDesigner.Runtime.Variables;
|
||||
using UnityEngine;
|
||||
|
||||
[Opsive.Shared.Utility.Description("Performs a math operation on the two integers.")]
|
||||
[Shared.Utility.Category("Math")]
|
||||
public class IntOperator : Action
|
||||
{
|
||||
/// <summary>
|
||||
/// Specifies the type of int operation that should be performed.
|
||||
/// </summary>
|
||||
protected enum Operation
|
||||
{
|
||||
Add, // Returns the addition between two integers.
|
||||
Subtract, // Returns the division between two integers.
|
||||
Multiply, // Returns the multiplication between two integers.
|
||||
Divide, // Returns the division between two integers.
|
||||
Modulo, // Returns the modulo between two integers.
|
||||
Min, // Returns the minimum of two integers.
|
||||
Max, // Returns the maximum of two integers.
|
||||
}
|
||||
|
||||
[Tooltip("The operation to perform.")]
|
||||
[SerializeField] protected SharedVariable<Operation> m_Operation;
|
||||
[Tooltip("The first integer.")]
|
||||
[SerializeField] protected SharedVariable<int> m_Integer1;
|
||||
[Tooltip("The second integer.")]
|
||||
[SerializeField] protected SharedVariable<int> m_Integer2;
|
||||
[Tooltip("The variable to store the result.")]
|
||||
[RequireShared] [SerializeField] protected SharedVariable<int> m_StoreResult;
|
||||
|
||||
/// <summary>
|
||||
/// Executes the task.
|
||||
/// </summary>
|
||||
/// <returns>The execution status of the task.</returns>
|
||||
public override TaskStatus OnUpdate()
|
||||
{
|
||||
switch (m_Operation.Value) {
|
||||
case Operation.Add:
|
||||
m_StoreResult.Value = m_Integer1.Value + m_Integer2.Value;
|
||||
break;
|
||||
case Operation.Subtract:
|
||||
m_StoreResult.Value = m_Integer1.Value - m_Integer2.Value;
|
||||
break;
|
||||
case Operation.Multiply:
|
||||
m_StoreResult.Value = m_Integer1.Value * m_Integer2.Value;
|
||||
break;
|
||||
case Operation.Divide:
|
||||
m_StoreResult.Value = m_Integer1.Value / m_Integer2.Value;
|
||||
break;
|
||||
case Operation.Modulo:
|
||||
m_StoreResult.Value = m_Integer1.Value % m_Integer2.Value;
|
||||
break;
|
||||
case Operation.Min:
|
||||
m_StoreResult.Value = Mathf.Min(m_Integer1.Value, m_Integer2.Value);
|
||||
break;
|
||||
case Operation.Max:
|
||||
m_StoreResult.Value = Mathf.Max(m_Integer1.Value, m_Integer2.Value);
|
||||
break;
|
||||
}
|
||||
return TaskStatus.Success;
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 77d11b9520f296b43a19d4a987844d73
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,45 @@
|
||||
#if GRAPH_DESIGNER
|
||||
/// ---------------------------------------------
|
||||
/// Behavior Designer
|
||||
/// Copyright (c) Opsive. All Rights Reserved.
|
||||
/// https://www.opsive.com
|
||||
/// ---------------------------------------------
|
||||
namespace Opsive.BehaviorDesigner.Tasks.Actions.Math
|
||||
{
|
||||
using Opsive.BehaviorDesigner.Runtime.Tasks;
|
||||
using Opsive.BehaviorDesigner.Runtime.Tasks.Actions;
|
||||
using Opsive.GraphDesigner.Runtime.Variables;
|
||||
using UnityEngine;
|
||||
|
||||
[Tooltip("Returns a random bool value.")]
|
||||
[Shared.Utility.Category("Math")]
|
||||
public class RandomBool : Action
|
||||
{
|
||||
[Tooltip("The stored random bool value.")]
|
||||
[RequireShared] [SerializeField] protected SharedVariable<bool> m_StoreResult;
|
||||
[Tooltip("The seed of the random number generator. Set to 0 to disable.")]
|
||||
[SerializeField] protected int m_Seed;
|
||||
|
||||
/// <summary>
|
||||
/// Callback when the behavior tree is initialized.
|
||||
/// </summary>
|
||||
public override void OnAwake()
|
||||
{
|
||||
if (m_Seed != 0) {
|
||||
Random.InitState(m_Seed);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Executes the task logic.
|
||||
/// </summary>
|
||||
/// <returns>The status of the task.</returns>
|
||||
public override TaskStatus OnUpdate()
|
||||
{
|
||||
m_StoreResult.Value = Random.value > 0.5;
|
||||
return base.OnUpdate();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
#endif
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: e39f6d31610d07b4ca1c977ce86198bd
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,49 @@
|
||||
#if GRAPH_DESIGNER
|
||||
/// ---------------------------------------------
|
||||
/// Behavior Designer
|
||||
/// Copyright (c) Opsive. All Rights Reserved.
|
||||
/// https://www.opsive.com
|
||||
/// ---------------------------------------------
|
||||
namespace Opsive.BehaviorDesigner.Tasks.Actions.Math
|
||||
{
|
||||
using Opsive.BehaviorDesigner.Runtime.Tasks;
|
||||
using Opsive.BehaviorDesigner.Runtime.Tasks.Actions;
|
||||
using Opsive.GraphDesigner.Runtime.Variables;
|
||||
using UnityEngine;
|
||||
|
||||
[Tooltip("Returns a random float between the specified values (inclusive).")]
|
||||
[Shared.Utility.Category("Math")]
|
||||
public class RandomFloat : Action
|
||||
{
|
||||
[Tooltip("The minimum float value (inclusive).")]
|
||||
[SerializeField] protected SharedVariable<float> m_MinimumFloat;
|
||||
[Tooltip("The maximum float value (inclusive).")]
|
||||
[SerializeField] protected SharedVariable<float> m_MaximumFloat;
|
||||
[Tooltip("The stored random float value.")]
|
||||
[RequireShared] [SerializeField] protected SharedVariable<float> m_StoreResult;
|
||||
[Tooltip("The seed of the random number generator. Set to 0 to disable.")]
|
||||
[SerializeField] protected int m_Seed;
|
||||
|
||||
/// <summary>
|
||||
/// Callback when the behavior tree is initialized.
|
||||
/// </summary>
|
||||
public override void OnAwake()
|
||||
{
|
||||
if (m_Seed != 0) {
|
||||
Random.InitState(m_Seed);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Executes the task logic.
|
||||
/// </summary>
|
||||
/// <returns>The status of the task.</returns>
|
||||
public override TaskStatus OnUpdate()
|
||||
{
|
||||
m_StoreResult.Value = Random.Range(m_MinimumFloat.Value, m_MaximumFloat.Value);
|
||||
return base.OnUpdate();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
#endif
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: e4cd0328bf01f2a46a89268dcaf0cd26
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,49 @@
|
||||
#if GRAPH_DESIGNER
|
||||
/// ---------------------------------------------
|
||||
/// Behavior Designer
|
||||
/// Copyright (c) Opsive. All Rights Reserved.
|
||||
/// https://www.opsive.com
|
||||
/// ---------------------------------------------
|
||||
namespace Opsive.BehaviorDesigner.Tasks.Actions.Math
|
||||
{
|
||||
using Opsive.BehaviorDesigner.Runtime.Tasks;
|
||||
using Opsive.BehaviorDesigner.Runtime.Tasks.Actions;
|
||||
using Opsive.GraphDesigner.Runtime.Variables;
|
||||
using UnityEngine;
|
||||
|
||||
[Tooltip("Returns a random integer between the specified values (inclusive).")]
|
||||
[Shared.Utility.Category("Math")]
|
||||
public class RandomInteger : Action
|
||||
{
|
||||
[Tooltip("The minimum integer value (inclusive).")]
|
||||
[SerializeField] protected SharedVariable<int> m_MinimumInteger;
|
||||
[Tooltip("The maximum integer value (inclusive).")]
|
||||
[SerializeField] protected SharedVariable<int> m_MaximumInteger;
|
||||
[Tooltip("The stored random integer value.")]
|
||||
[RequireShared] [SerializeField] protected SharedVariable<int> m_StoreResult;
|
||||
[Tooltip("The seed of the random number generator. Set to 0 to disable.")]
|
||||
[SerializeField] protected int m_Seed;
|
||||
|
||||
/// <summary>
|
||||
/// Callback when the behavior tree is initialized.
|
||||
/// </summary>
|
||||
public override void OnAwake()
|
||||
{
|
||||
if (m_Seed != 0) {
|
||||
Random.InitState(m_Seed);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Executes the task logic.
|
||||
/// </summary>
|
||||
/// <returns>The status of the task.</returns>
|
||||
public override TaskStatus OnUpdate()
|
||||
{
|
||||
m_StoreResult.Value = Random.Range(m_MinimumInteger.Value, m_MaximumInteger.Value);
|
||||
return base.OnUpdate();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
#endif
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: bf8b675bf82b06f44a19056eedc9e3f6
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,33 @@
|
||||
#if GRAPH_DESIGNER
|
||||
/// ---------------------------------------------
|
||||
/// Behavior Designer
|
||||
/// Copyright (c) Opsive. All Rights Reserved.
|
||||
/// https://www.opsive.com
|
||||
/// ---------------------------------------------
|
||||
namespace Opsive.BehaviorDesigner.Runtime.Tasks.Actions.Math
|
||||
{
|
||||
using Opsive.GraphDesigner.Runtime;
|
||||
using Opsive.GraphDesigner.Runtime.Variables;
|
||||
using UnityEngine;
|
||||
|
||||
[Opsive.Shared.Utility.Description("Set the boolean value.")]
|
||||
[Shared.Utility.Category("Math")]
|
||||
public class SetBool : Action
|
||||
{
|
||||
[Tooltip("The bool value to set.")]
|
||||
[SerializeField] protected SharedVariable<bool> m_Value;
|
||||
[Tooltip("The variable that should be set.")]
|
||||
[RequireShared] [SerializeField] protected SharedVariable<bool> m_StoreResult;
|
||||
|
||||
/// <summary>
|
||||
/// Executes the task.
|
||||
/// </summary>
|
||||
/// <returns>The execution status of the task.</returns>
|
||||
public override TaskStatus OnUpdate()
|
||||
{
|
||||
m_StoreResult.Value = m_Value.Value;
|
||||
return TaskStatus.Success;
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 77b177a61d9c7c94889fe58326045014
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,33 @@
|
||||
#if GRAPH_DESIGNER
|
||||
/// ---------------------------------------------
|
||||
/// Behavior Designer
|
||||
/// Copyright (c) Opsive. All Rights Reserved.
|
||||
/// https://www.opsive.com
|
||||
/// ---------------------------------------------
|
||||
namespace Opsive.BehaviorDesigner.Runtime.Tasks.Actions.Math
|
||||
{
|
||||
using Opsive.GraphDesigner.Runtime;
|
||||
using Opsive.GraphDesigner.Runtime.Variables;
|
||||
using UnityEngine;
|
||||
|
||||
[Opsive.Shared.Utility.Description("Set the float value.")]
|
||||
[Shared.Utility.Category("Math")]
|
||||
public class SetFloat : Action
|
||||
{
|
||||
[Tooltip("The float value to set.")]
|
||||
[SerializeField] protected SharedVariable<float> m_Value;
|
||||
[Tooltip("The variable that should be set.")]
|
||||
[RequireShared] [SerializeField] protected SharedVariable<float> m_StoreResult;
|
||||
|
||||
/// <summary>
|
||||
/// Executes the task.
|
||||
/// </summary>
|
||||
/// <returns>The execution status of the task.</returns>
|
||||
public override TaskStatus OnUpdate()
|
||||
{
|
||||
m_StoreResult.Value = m_Value.Value;
|
||||
return TaskStatus.Success;
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 7114039f3b7a3ff439a901637ba04235
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,32 @@
|
||||
#if GRAPH_DESIGNER
|
||||
/// ---------------------------------------------
|
||||
/// Behavior Designer
|
||||
/// Copyright (c) Opsive. All Rights Reserved.
|
||||
/// https://www.opsive.com
|
||||
/// ---------------------------------------------
|
||||
namespace Opsive.BehaviorDesigner.Runtime.Tasks.Actions.Math
|
||||
{
|
||||
using Opsive.GraphDesigner.Runtime.Variables;
|
||||
using UnityEngine;
|
||||
|
||||
[Opsive.Shared.Utility.Description("Set the integer value.")]
|
||||
[Shared.Utility.Category("Math")]
|
||||
public class SetInt : Action
|
||||
{
|
||||
[Tooltip("The int value to set.")]
|
||||
[SerializeField] protected SharedVariable<int> m_Value;
|
||||
[Tooltip("The variable that should be set.")]
|
||||
[RequireShared] [SerializeField] protected SharedVariable<int> m_StoreResult;
|
||||
|
||||
/// <summary>
|
||||
/// Executes the task.
|
||||
/// </summary>
|
||||
/// <returns>The execution status of the task.</returns>
|
||||
public override TaskStatus OnUpdate()
|
||||
{
|
||||
m_StoreResult.Value = m_Value.Value;
|
||||
return TaskStatus.Success;
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: eed961f4064f9024f8e51b3ddb69020a
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,33 @@
|
||||
#if GRAPH_DESIGNER
|
||||
/// ---------------------------------------------
|
||||
/// Behavior Designer
|
||||
/// Copyright (c) Opsive. All Rights Reserved.
|
||||
/// https://www.opsive.com
|
||||
/// ---------------------------------------------
|
||||
namespace Opsive.BehaviorDesigner.Runtime.Tasks.Actions.Math
|
||||
{
|
||||
using Opsive.GraphDesigner.Runtime;
|
||||
using Opsive.GraphDesigner.Runtime.Variables;
|
||||
using UnityEngine;
|
||||
|
||||
[Opsive.Shared.Utility.Description("Set the string value.")]
|
||||
[Shared.Utility.Category("Math")]
|
||||
public class SetString : Action
|
||||
{
|
||||
[Tooltip("The string value to set.")]
|
||||
[SerializeField] protected SharedVariable<string> m_Value;
|
||||
[Tooltip("The variable that should be set.")]
|
||||
[RequireShared] [SerializeField] protected SharedVariable<string> m_StoreResult;
|
||||
|
||||
/// <summary>
|
||||
/// Executes the task.
|
||||
/// </summary>
|
||||
/// <returns>The execution status of the task.</returns>
|
||||
public override TaskStatus OnUpdate()
|
||||
{
|
||||
m_StoreResult.Value = m_Value.Value;
|
||||
return TaskStatus.Success;
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 450ec74688a332e42a42173708a621c1
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,33 @@
|
||||
#if GRAPH_DESIGNER
|
||||
/// ---------------------------------------------
|
||||
/// Behavior Designer
|
||||
/// Copyright (c) Opsive. All Rights Reserved.
|
||||
/// https://www.opsive.com
|
||||
/// ---------------------------------------------
|
||||
namespace Opsive.BehaviorDesigner.Runtime.Tasks.Actions.Math
|
||||
{
|
||||
using Opsive.GraphDesigner.Runtime;
|
||||
using Opsive.GraphDesigner.Runtime.Variables;
|
||||
using UnityEngine;
|
||||
|
||||
[Opsive.Shared.Utility.Description("Set the Vector2 value.")]
|
||||
[Shared.Utility.Category("Math")]
|
||||
public class SetVector2 : Action
|
||||
{
|
||||
[Tooltip("The Vector2 value to set.")]
|
||||
[SerializeField] protected SharedVariable<Vector2> m_Value;
|
||||
[Tooltip("The variable that should be set.")]
|
||||
[RequireShared] [SerializeField] protected SharedVariable<Vector2> m_StoreResult;
|
||||
|
||||
/// <summary>
|
||||
/// Executes the task.
|
||||
/// </summary>
|
||||
/// <returns>The execution status of the task.</returns>
|
||||
public override TaskStatus OnUpdate()
|
||||
{
|
||||
m_StoreResult.Value = m_Value.Value;
|
||||
return TaskStatus.Success;
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 1507af45b59e2d642a8372f952ef5bec
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,33 @@
|
||||
#if GRAPH_DESIGNER
|
||||
/// ---------------------------------------------
|
||||
/// Behavior Designer
|
||||
/// Copyright (c) Opsive. All Rights Reserved.
|
||||
/// https://www.opsive.com
|
||||
/// ---------------------------------------------
|
||||
namespace Opsive.BehaviorDesigner.Runtime.Tasks.Actions.Math
|
||||
{
|
||||
using Opsive.GraphDesigner.Runtime;
|
||||
using Opsive.GraphDesigner.Runtime.Variables;
|
||||
using UnityEngine;
|
||||
|
||||
[Opsive.Shared.Utility.Description("Set the Vector3 value.")]
|
||||
[Shared.Utility.Category("Math")]
|
||||
public class SetVector3 : Action
|
||||
{
|
||||
[Tooltip("The Vector3 value to set.")]
|
||||
[SerializeField] protected SharedVariable<Vector3> m_Value;
|
||||
[Tooltip("The variable that should be set.")]
|
||||
[RequireShared] [SerializeField] protected SharedVariable<Vector3> m_StoreResult;
|
||||
|
||||
/// <summary>
|
||||
/// Executes the task.
|
||||
/// </summary>
|
||||
/// <returns>The execution status of the task.</returns>
|
||||
public override TaskStatus OnUpdate()
|
||||
{
|
||||
m_StoreResult.Value = m_Value.Value;
|
||||
return TaskStatus.Success;
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 8fd35c62b935e674da0ed3b7d450a049
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Reference in New Issue
Block a user