mirror of
https://gitee.com/jisol/jisol-game/
synced 2025-09-27 10:46:17 +00:00
提交行为树
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
using JNGame.Math;
|
||||
|
||||
namespace BehaviorTreeSlayer
|
||||
{
|
||||
public class Log : ActionNode
|
||||
{
|
||||
[OutField]
|
||||
public string Text = "";
|
||||
|
||||
public Log()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public Log(string text)
|
||||
{
|
||||
Text = text;
|
||||
}
|
||||
|
||||
public override TaskResult Tick(LFloat dt, object args = null)
|
||||
{
|
||||
UnityEngine.Debug.Log(Text);
|
||||
return TaskResult.OK;
|
||||
}
|
||||
}
|
||||
}
|
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 12eb3d1ed40dd6841a70f69a5dbab9b5
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {fileID: -5442936267250999957, guid: 0000000000000000d000000000000000, type: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@@ -0,0 +1,38 @@
|
||||
using System.Xml.Serialization;
|
||||
using JNGame.Math;
|
||||
|
||||
namespace BehaviorTreeSlayer
|
||||
{
|
||||
public class Wait : ActionNode
|
||||
{
|
||||
[OutField]
|
||||
public LFloat time = 3;
|
||||
|
||||
LFloat t;
|
||||
|
||||
[ShowMe]
|
||||
private LFloat timer;
|
||||
|
||||
public Wait()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public Wait(LFloat time)
|
||||
{
|
||||
this.time = time;
|
||||
}
|
||||
|
||||
public override TaskResult Tick(LFloat dt, object args = null)
|
||||
{
|
||||
timer += dt;
|
||||
if (timer >= time)
|
||||
{
|
||||
UnityEngine.Debug.Log(timer);
|
||||
timer = 0;
|
||||
return TaskResult.OK;
|
||||
}
|
||||
return TaskResult.Running;
|
||||
}
|
||||
}
|
||||
}
|
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 8757ac0a11021a34da305a81f5b8b230
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {fileID: 3306451490063965843, guid: 0000000000000000d000000000000000, type: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
Reference in New Issue
Block a user