mirror of
https://github.com/tym1116/BH3.git
synced 2025-12-12 22:44:35 +01:00
20 lines
495 B
C#
20 lines
495 B
C#
using BehaviorDesigner.Runtime;
|
|
using BehaviorDesigner.Runtime.Tasks;
|
|
using UnityEngine;
|
|
|
|
namespace MoleMole
|
|
{
|
|
public class GetLocalAvatarDistance : Action
|
|
{
|
|
public SharedFloat Distance;
|
|
|
|
public override TaskStatus OnUpdate()
|
|
{
|
|
Vector3 xZPosition = GetComponent<BaseMonoAvatar>().XZPosition;
|
|
Vector3 xZPosition2 = Singleton<AvatarManager>.Instance.GetLocalAvatar().XZPosition;
|
|
Distance.SetValue(Vector3.Distance(xZPosition, xZPosition2));
|
|
return TaskStatus.Success;
|
|
}
|
|
}
|
|
}
|