临时提交

This commit is contained in:
PC-20230316NUNE\Administrator
2024-08-17 14:12:46 +08:00
parent 98bead1a7c
commit 3afb2e3b86
279 changed files with 20594 additions and 285 deletions

View File

@@ -0,0 +1,29 @@
using System;
namespace BehaviorTreeSlayer
{
public class EventCaller : ConditionalNode
{
[OutField]
public string Event;
public override void Enter(object args)
{
BehaviorTree tree = (BehaviorTree)args;
if (!string.IsNullOrEmpty(Event))
tree.Regist(Event, OnEvent);
}
public override void Exit(object args)
{
}
private void OnEvent(object obj)
{
IsConditionOK = true;
}
public override TaskResult Tick(double dt, object args = null)
{
return IsConditionOK ? TaskResult.Running : TaskResult.None;
}
}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 034fc570e45c74342bba94a7887014bf
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,28 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace BehaviorTreeSlayer
{
public class RandomCall : ConditionalNode
{
[OutField]
public double Rand=0.2;
[OutField]
public double Freq=1;
[ShowMe]
double timer;
public override bool Check(double dt, object args)
{
timer += dt;
if (timer > Freq)
{
timer = 0;
IsConditionOK = (args as BehaviorTree).MyRandom.NextDouble() < Rand;
}
return base.Check(dt, args);
}
}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 98c39464e2b77524492cfbcf228305fa
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant: