This commit is contained in:
CortexCore
2024-03-29 00:58:24 +08:00
parent 967ad8eacf
commit 05315ef4a8
232 changed files with 53368 additions and 8539 deletions

View File

@@ -1,7 +1,9 @@
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using BITFALL.Player.Movement;
using BITFALL.Props;
using BITKit;
using BITKit.Entities;
using BITKit.Sensors;
@@ -9,9 +11,11 @@ using UnityEngine;
namespace BITFALL.AI
{
public class AIBehavour : EntityBehavior
public class AIBehavour : EntityBehavior,IStunObject
{
[SerializeReference,SubclassSelector] private ISensor sensor;
[SerializeReference, SubclassSelector] private IReference stunAnimation;
private readonly Optional<IEntityMovement> grabTarget=new();
@@ -62,6 +66,14 @@ namespace BITFALL.AI
break;
}
}
public float Weight { get; set; }
public event Action<float> OnWeightChanged;
public void Stun(float distance, float duration)
{
if (stunAnimation is null) return;
UnityEntity.Invoke(Constant.Animation.Play,stunAnimation.Value);
}
}
}