1
This commit is contained in:
38
Src/UnityPluginsSupport/NodeCanvas/InvokeEntityCommand.cs
Normal file
38
Src/UnityPluginsSupport/NodeCanvas/InvokeEntityCommand.cs
Normal file
@@ -0,0 +1,38 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using BITKit.Entities;
|
||||
using UnityEngine;
|
||||
using NodeCanvas.Tasks;
|
||||
using NodeCanvas.Framework;
|
||||
using BITKit.SubSystems;
|
||||
using BITKit.SubSystems.Quest;
|
||||
namespace BITKit
|
||||
{
|
||||
public class InvokeEntityCommand : ActionTask
|
||||
{
|
||||
public BBParameter<Entity> entity;
|
||||
public BBParameter<string> command;
|
||||
public BBParameter<int> intParameter;
|
||||
public BBParameter<int> floatParameter;
|
||||
public BBParameter<string> stringParameter;
|
||||
|
||||
protected override void OnExecute()
|
||||
{
|
||||
var cmd = command.isNoneOrNull ? Constant.System.Internal : command.value;
|
||||
if (intParameter.isNoneOrNull is false)
|
||||
{
|
||||
entity.value.Invoke<int>(cmd, intParameter.value);
|
||||
}
|
||||
if (floatParameter.isNoneOrNull is false)
|
||||
{
|
||||
entity.value.Invoke<float>(cmd, floatParameter.value);
|
||||
}
|
||||
if(stringParameter.isNoneOrNull is false)
|
||||
{
|
||||
entity.value.Invoke<string>(cmd, stringParameter.value);
|
||||
}
|
||||
entity.value.Invoke(cmd);
|
||||
EndAction();
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user