add missing & non updated files
This commit is contained in:
@@ -0,0 +1,45 @@
|
||||
using System;
|
||||
using DefaultNamespace;
|
||||
using DefaultNamespace.FSM;
|
||||
using Unity.Behavior;
|
||||
using UnityEngine;
|
||||
using Action = Unity.Behavior.Action;
|
||||
using Unity.Properties;
|
||||
|
||||
[Serializable, GeneratePropertyBag]
|
||||
[NodeDescription(name: "FindPlayerControllerByRaycast", story: "Find [Target] with racyast from [Agent]", category: "Action", id: "d762456f044989271ec06e8848cbfa15")]
|
||||
public partial class FindPlayerControllerByRaycastAction : Action
|
||||
{
|
||||
[SerializeReference] public BlackboardVariable<GameObject> Target;
|
||||
[SerializeReference] public BlackboardVariable<GameObject> Agent;
|
||||
[SerializeReference] public BlackboardVariable<float> MaxDistance = new(10);
|
||||
|
||||
protected override Status OnStart()
|
||||
{
|
||||
if (Agent.Value == null) return Status.Failure;
|
||||
|
||||
// setup your node
|
||||
|
||||
return Status.Running;
|
||||
}
|
||||
|
||||
protected override Status OnUpdate()
|
||||
{
|
||||
if (Physics.Raycast(Agent.Value.transform.position, Agent.Value.transform.forward, out RaycastHit hit, MaxDistance))
|
||||
{
|
||||
if (hit.transform.GetComponent<PlayerController>() != null)
|
||||
{
|
||||
Target.Value = hit.transform.gameObject;
|
||||
return Status.Success;
|
||||
}
|
||||
}
|
||||
|
||||
Target.Value = null;
|
||||
return Status.Failure;
|
||||
}
|
||||
|
||||
protected override void OnEnd()
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 9250f5d746bf949019e434d1373f0275
|
||||
@@ -0,0 +1,24 @@
|
||||
using System;
|
||||
using Unity.Behavior;
|
||||
using UnityEngine;
|
||||
|
||||
[Serializable, Unity.Properties.GeneratePropertyBag]
|
||||
[Condition(name: "GameObject Null", story: "[Object] is [IsNull] null", category: "Conditions", id: "0136a874fb9b9066a1c71f05e9b92e63")]
|
||||
public partial class ObjectNullCondition : Condition
|
||||
{
|
||||
[SerializeReference] public BlackboardVariable<GameObject> Object;
|
||||
[SerializeReference] public BlackboardVariable<bool> IsNull;
|
||||
|
||||
public override bool IsTrue()
|
||||
{
|
||||
return (Object.Value == null && IsNull) || (Object.Value != null && !IsNull);
|
||||
}
|
||||
|
||||
public override void OnStart()
|
||||
{
|
||||
}
|
||||
|
||||
public override void OnEnd()
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 5cc690ef45e0547ff930c67885e426c1
|
||||
Reference in New Issue
Block a user