42 lines
1.0 KiB
C#
42 lines
1.0 KiB
C#
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;
|
|
public override string ToString()
|
|
{
|
|
return $"{command}";
|
|
}
|
|
|
|
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();
|
|
}
|
|
}
|
|
} |