迁移敌人模型到新素材上并加入动画
This commit is contained in:
@@ -32,18 +32,5 @@ namespace SepCore.Entity
|
||||
public float SpeedBase => Config.Speed;
|
||||
|
||||
public float DropPercent => Config.DropPercent;
|
||||
|
||||
public float Scale => Config.Scale;
|
||||
|
||||
public Color Color
|
||||
{
|
||||
get
|
||||
{
|
||||
// 空/非法颜色值视为无染色(乘以白色)。
|
||||
return ColorUtility.TryParseHtmlString(Config.Color, out Color color)
|
||||
? color
|
||||
: Color.white;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,7 +15,7 @@ namespace SepCore.Definition
|
||||
/// 伤害类型
|
||||
/// </summary>
|
||||
[System.Flags]
|
||||
public enum DamageType : int
|
||||
public enum DamageType : byte
|
||||
{
|
||||
/// <summary>
|
||||
/// 无
|
||||
|
||||
@@ -25,8 +25,6 @@ public sealed partial class EnemyConfig : Luban.BeanBase
|
||||
AttackRange = _buf.ReadFloat();
|
||||
Speed = _buf.ReadFloat();
|
||||
DropPercent = _buf.ReadFloat();
|
||||
Scale = _buf.ReadFloat();
|
||||
Color = _buf.ReadString();
|
||||
Prefab = _buf.ReadString();
|
||||
Prefab_Ref = null;
|
||||
}
|
||||
@@ -73,14 +71,6 @@ public sealed partial class EnemyConfig : Luban.BeanBase
|
||||
/// </summary>
|
||||
public readonly float DropPercent;
|
||||
/// <summary>
|
||||
/// 缩放
|
||||
/// </summary>
|
||||
public readonly float Scale;
|
||||
/// <summary>
|
||||
/// 颜色
|
||||
/// </summary>
|
||||
public readonly string Color;
|
||||
/// <summary>
|
||||
/// 预制体
|
||||
/// </summary>
|
||||
public readonly string Prefab;
|
||||
@@ -100,8 +90,6 @@ public sealed partial class EnemyConfig : Luban.BeanBase
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Prefab_Ref = tables.TbEntityConfig.GetOrDefault(Prefab);
|
||||
}
|
||||
|
||||
@@ -117,8 +105,6 @@ public sealed partial class EnemyConfig : Luban.BeanBase
|
||||
+ "attackRange:" + AttackRange + ","
|
||||
+ "speed:" + Speed + ","
|
||||
+ "dropPercent:" + DropPercent + ","
|
||||
+ "scale:" + Scale + ","
|
||||
+ "color:" + Color + ","
|
||||
+ "prefab:" + Prefab + ","
|
||||
+ "}";
|
||||
}
|
||||
|
||||
@@ -21,13 +21,13 @@ namespace SepCore.Definition
|
||||
/// </summary>
|
||||
None = 0,
|
||||
/// <summary>
|
||||
/// 近战敌人
|
||||
/// 外星人
|
||||
/// </summary>
|
||||
MeleeEnemy = 1,
|
||||
AlienEnemy = 1,
|
||||
/// <summary>
|
||||
/// 远程敌人
|
||||
/// 恶魔
|
||||
/// </summary>
|
||||
RemoteEnemy = 2,
|
||||
DemonEnemy = 2,
|
||||
/// <summary>
|
||||
/// 蝙蝠
|
||||
/// </summary>
|
||||
@@ -35,19 +35,19 @@ namespace SepCore.Definition
|
||||
/// <summary>
|
||||
/// 骷髅兵
|
||||
/// </summary>
|
||||
SkeletonEnemy = 4,
|
||||
SkullEnemy = 4,
|
||||
/// <summary>
|
||||
/// 骷髅巨人
|
||||
/// 企鹅
|
||||
/// </summary>
|
||||
SkeletonGiantEnemy = 5,
|
||||
PenguinEnemy = 5,
|
||||
/// <summary>
|
||||
/// 幽灵
|
||||
/// </summary>
|
||||
GhostEnemy = 6,
|
||||
/// <summary>
|
||||
/// 火焰法师
|
||||
/// 雪人
|
||||
/// </summary>
|
||||
FireMageEnemy = 7,
|
||||
YetiEnemy = 7,
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,102 @@
|
||||
using SepCore.Debugger;
|
||||
using SepCore.Entity;
|
||||
using UnityEngine;
|
||||
|
||||
#if UNITY_EDITOR
|
||||
using UnityEditor;
|
||||
#endif
|
||||
|
||||
namespace SepCore.Components
|
||||
{
|
||||
public class EnemyMovementComponent : MonoBehaviour
|
||||
{
|
||||
[SerializeField] private float _enemyBodyRadius;
|
||||
|
||||
private bool _isMoving;
|
||||
private Vector3 _direction;
|
||||
private bool _avoidEnemyOverlap;
|
||||
private int _separationIterations;
|
||||
private float _speedBase;
|
||||
|
||||
private EnemyBase _enemy;
|
||||
|
||||
public float Speed => _speedBase;
|
||||
public bool AvoidEnemyOverlap => _avoidEnemyOverlap;
|
||||
public float EnemyBodyRadius => _enemyBodyRadius;
|
||||
public int SeparationIterations => _separationIterations;
|
||||
public bool IsMoving => _isMoving;
|
||||
public Vector3 Direction => _direction;
|
||||
|
||||
public void OnInit(float speed, bool avoidEnemyOverlap = false,
|
||||
float? enemyBodyRadius = null, int? separationIterations = null)
|
||||
{
|
||||
_speedBase = speed;
|
||||
_direction = Vector3.forward;
|
||||
_avoidEnemyOverlap = avoidEnemyOverlap;
|
||||
_enemyBodyRadius = enemyBodyRadius ?? GameEntry.Luban.Global.EnemyBodyRadius;
|
||||
_separationIterations = separationIterations ?? GameEntry.Luban.Global.EnemySeparationIterations;
|
||||
_enemy = GetComponentInParent<EnemyBase>();
|
||||
|
||||
SyncToSimulationWorld();
|
||||
}
|
||||
|
||||
public void OnUpdate(float elapseSeconds, float realElapseSeconds)
|
||||
{
|
||||
SyncToSimulationWorld();
|
||||
}
|
||||
|
||||
public void OnReset()
|
||||
{
|
||||
_enemyBodyRadius = GameEntry.Luban.Global.EnemyBodyRadius;
|
||||
_separationIterations = GameEntry.Luban.Global.EnemySeparationIterations;
|
||||
_speedBase = 0f;
|
||||
_direction = Vector3.zero;
|
||||
_isMoving = false;
|
||||
_avoidEnemyOverlap = false;
|
||||
_enemy = null;
|
||||
}
|
||||
|
||||
public void SetMove(bool isMoving)
|
||||
{
|
||||
_isMoving = isMoving;
|
||||
SyncToSimulationWorld();
|
||||
}
|
||||
|
||||
public void SetDirection(Vector3 direction)
|
||||
{
|
||||
_direction = direction;
|
||||
SyncToSimulationWorld();
|
||||
}
|
||||
|
||||
private void SyncToSimulationWorld()
|
||||
{
|
||||
using (CustomProfilerMarker.Movement_Update.Auto())
|
||||
{
|
||||
Vector3 direction = _direction;
|
||||
direction.y = 0f;
|
||||
if (direction.sqrMagnitude > Mathf.Epsilon)
|
||||
{
|
||||
direction.Normalize();
|
||||
}
|
||||
|
||||
GameEntry.SimulationWorld.SyncEnemyMovementInput(_enemy.Id, _isMoving, direction, Speed,
|
||||
_avoidEnemyOverlap, _enemyBodyRadius, _separationIterations);
|
||||
}
|
||||
}
|
||||
|
||||
#if UNITY_EDITOR
|
||||
private void OnDrawGizmosSelected()
|
||||
{
|
||||
if (_enemyBodyRadius <= 0f)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
Color previousColor = Handles.color;
|
||||
Handles.color = Color.cyan;
|
||||
Handles.DrawWireDisc(transform.position, Vector3.up, _enemyBodyRadius);
|
||||
Handles.color = previousColor;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
@@ -1,140 +0,0 @@
|
||||
using System;
|
||||
using SepCore.Definition;
|
||||
using SepCore.Entity;
|
||||
using SepCore.Simulation;
|
||||
using UnityEngine;
|
||||
using SepCore.Debugger;
|
||||
|
||||
namespace SepCore.Components
|
||||
{
|
||||
public class MovementComponent : MonoBehaviour
|
||||
{
|
||||
[SerializeField] private bool _isMoving;
|
||||
[SerializeField] private Vector3 _direction;
|
||||
[SerializeField] private Transform _cachedTransform;
|
||||
[SerializeField] private bool _avoidEnemyOverlap;
|
||||
[SerializeField] private float _enemyBodyRadius;
|
||||
[SerializeField] private int _separationIterations;
|
||||
|
||||
public float Speed => _statComponent != null ? _statComponent.GetStatValue(StatType.MoveSpeed) : _speedBase;
|
||||
public bool AvoidEnemyOverlap => _avoidEnemyOverlap;
|
||||
public float EnemyBodyRadius => _enemyBodyRadius;
|
||||
public int SeparationIterations => _separationIterations;
|
||||
public bool IsMoving => _isMoving;
|
||||
public Vector3 Direction => _direction;
|
||||
public Transform CachedTransform => _cachedTransform;
|
||||
[SerializeField] private float _speedBase;
|
||||
|
||||
private StatComponent _statComponent;
|
||||
private Player _player;
|
||||
private EnemyBase _enemy;
|
||||
private Action<StatType, float> _onStatChangedAction;
|
||||
|
||||
public void OnInit(float speed, Transform target, StatComponent statComponent = null,
|
||||
bool avoidEnemyOverlap = false, float? enemyBodyRadius = null, int? separationIterations = null)
|
||||
{
|
||||
_speedBase = speed;
|
||||
_cachedTransform = target;
|
||||
_direction = Vector3.forward;
|
||||
_avoidEnemyOverlap = avoidEnemyOverlap;
|
||||
_enemyBodyRadius = enemyBodyRadius ?? GameEntry.Luban.Global.EnemyBodyRadius;
|
||||
_separationIterations = separationIterations ?? GameEntry.Luban.Global.EnemySeparationIterations;
|
||||
|
||||
TryGetComponent(out _player);
|
||||
TryGetComponent(out _enemy);
|
||||
|
||||
_statComponent = statComponent;
|
||||
if (_statComponent != null)
|
||||
{
|
||||
_statComponent.Pipeline.SetBaseValue(StatType.MoveSpeed, speed);
|
||||
_onStatChangedAction = OnStatChanged;
|
||||
_statComponent.Pipeline.OnStatChanged += _onStatChangedAction;
|
||||
}
|
||||
|
||||
SyncToSimulationWorld();
|
||||
}
|
||||
|
||||
public void OnUpdate(float elapseSeconds, float realElapseSeconds)
|
||||
{
|
||||
SyncToSimulationWorld();
|
||||
}
|
||||
|
||||
public void OnReset()
|
||||
{
|
||||
Transform transformToUnregister = _cachedTransform;
|
||||
|
||||
_enemyBodyRadius = GameEntry.Luban.Global.EnemyBodyRadius;
|
||||
_separationIterations = GameEntry.Luban.Global.EnemySeparationIterations;
|
||||
_speedBase = 0;
|
||||
_cachedTransform = null;
|
||||
_direction = Vector3.zero;
|
||||
_isMoving = false;
|
||||
_avoidEnemyOverlap = false;
|
||||
_player = null;
|
||||
_enemy = null;
|
||||
|
||||
if (_statComponent != null && _onStatChangedAction != null)
|
||||
{
|
||||
_statComponent.Pipeline.OnStatChanged -= _onStatChangedAction;
|
||||
_onStatChangedAction = null;
|
||||
}
|
||||
|
||||
_statComponent = null;
|
||||
|
||||
if (transformToUnregister != null && GameEntry.SimulationWorld != null)
|
||||
{
|
||||
GameEntry.SimulationWorld.UnregisterPlayerMovement(transformToUnregister);
|
||||
}
|
||||
}
|
||||
|
||||
public void SetMove(bool isMoving)
|
||||
{
|
||||
_isMoving = isMoving;
|
||||
SyncToSimulationWorld();
|
||||
}
|
||||
|
||||
public void SetDirection(Vector3 direction)
|
||||
{
|
||||
_direction = direction;
|
||||
SyncToSimulationWorld();
|
||||
}
|
||||
|
||||
private void SyncToSimulationWorld()
|
||||
{
|
||||
using (CustomProfilerMarker.Movement_Update.Auto())
|
||||
{
|
||||
if (_cachedTransform == null || GameEntry.SimulationWorld == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
Vector3 direction = _direction;
|
||||
direction.y = 0f;
|
||||
if (direction.sqrMagnitude > Mathf.Epsilon)
|
||||
{
|
||||
direction.Normalize();
|
||||
}
|
||||
|
||||
if (_player != null)
|
||||
{
|
||||
GameEntry.SimulationWorld.SyncPlayerMovementInput(_cachedTransform, _isMoving, direction, Speed);
|
||||
return;
|
||||
}
|
||||
|
||||
if (_enemy != null)
|
||||
{
|
||||
GameEntry.SimulationWorld.SyncEnemyMovementInput(_enemy.Id, _isMoving, direction, Speed,
|
||||
_avoidEnemyOverlap, _enemyBodyRadius, _separationIterations);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void OnStatChanged(StatType statType, float newValue)
|
||||
{
|
||||
if (statType == StatType.MoveSpeed)
|
||||
{
|
||||
SyncToSimulationWorld();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
+8
-2
@@ -251,8 +251,14 @@ namespace SepCore.Simulation
|
||||
return Mathf.Max(0f, _enemies.MoveConfig[enemyIndex].BodyRadius);
|
||||
}
|
||||
|
||||
MovementComponent movementComponent = target.GetComponent<MovementComponent>();
|
||||
return movementComponent != null ? Mathf.Max(0f, movementComponent.EnemyBodyRadius) : 0f;
|
||||
if (target is EnemyBase enemy)
|
||||
{
|
||||
EnemyMovementComponent movementComponent =
|
||||
enemy.ChildrenMap.Get("Movement").GetComponent<EnemyMovementComponent>();
|
||||
return Mathf.Max(0f, movementComponent.EnemyBodyRadius);
|
||||
}
|
||||
|
||||
return 0f;
|
||||
}
|
||||
|
||||
private static bool IsAreaTargetInsidePreciseShape(in CollisionQueryData query, TargetableObject target,
|
||||
|
||||
+2
-1
@@ -12,7 +12,8 @@ namespace SepCore.Simulation
|
||||
private static EnemySimData CreateEnemyInitialSimData(EnemyBase enemy, EnemyData enemyData)
|
||||
{
|
||||
Transform enemyTransform = enemy.CachedTransform;
|
||||
MovementComponent movementComponent = enemy.GetComponent<MovementComponent>();
|
||||
EnemyMovementComponent movementComponent =
|
||||
enemy.ChildrenMap.Get("Movement").GetComponent<EnemyMovementComponent>();
|
||||
|
||||
float speed = 0f;
|
||||
if (enemyData != null)
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
namespace SepCore.Entity
|
||||
{
|
||||
public class AlienEnemy : MeleeEnemy
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
namespace SepCore.Entity
|
||||
{
|
||||
public class BatEnemy : MeleeEnemy
|
||||
public class BatEnemy : RemoteEnemy
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
namespace SepCore.Entity
|
||||
{
|
||||
public class DemonEnemy : RemoteEnemy
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: d1f8bb00c5199f34ab19ed75f1a5c471
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -8,11 +8,13 @@ namespace SepCore.Entity
|
||||
{
|
||||
public abstract class EnemyBase : TargetableObject
|
||||
{
|
||||
public ChildrenMap ChildrenMap;
|
||||
|
||||
protected Transform _target;
|
||||
|
||||
public EnemyData EnemyData { get; private set; }
|
||||
|
||||
public MovementComponent Movement { get; private set; }
|
||||
protected EnemyMovementComponent _movementComponent { get; private set; }
|
||||
|
||||
protected override TargetableObjectData _targetableObjectData => EnemyData;
|
||||
|
||||
@@ -35,8 +37,9 @@ namespace SepCore.Entity
|
||||
{
|
||||
base.OnInit(userData);
|
||||
|
||||
Movement = GetComponent<MovementComponent>();
|
||||
_healthComponent = GetComponent<HealthComponent>();
|
||||
ChildrenMap = GetComponent<ChildrenMap>();
|
||||
_movementComponent = ChildrenMap.Get("Movement").GetComponent<EnemyMovementComponent>();
|
||||
_healthComponent = ChildrenMap.Get("Health").GetComponent<HealthComponent>();
|
||||
}
|
||||
|
||||
protected override void OnShow(object userData)
|
||||
@@ -47,12 +50,11 @@ namespace SepCore.Entity
|
||||
{
|
||||
EnemyData = enemyData;
|
||||
_healthComponent.OnInit(enemyData.MaxHealthBase);
|
||||
Movement.OnInit(enemyData.SpeedBase, CachedTransform, null, true);
|
||||
Movement.SetMove(true);
|
||||
_movementComponent.OnInit(enemyData.SpeedBase, true);
|
||||
_movementComponent.SetMove(true);
|
||||
|
||||
StartAttackCooldown(enemyData.AttackCooldown);
|
||||
CachedTransform.position = enemyData.Position;
|
||||
ApplyVisualParams(enemyData);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -62,7 +64,7 @@ namespace SepCore.Entity
|
||||
|
||||
protected override void OnHide(bool isShutdown, object userData)
|
||||
{
|
||||
Movement.OnReset();
|
||||
_movementComponent.OnReset();
|
||||
_healthComponent.OnReset();
|
||||
CancelAttackCooldown();
|
||||
_target = null;
|
||||
@@ -95,16 +97,6 @@ namespace SepCore.Entity
|
||||
_target.position.z - CachedTransform.position.z
|
||||
).normalized;
|
||||
}
|
||||
|
||||
private void ApplyVisualParams(EnemyData data)
|
||||
{
|
||||
CachedTransform.localScale = Vector3.one * data.Scale;
|
||||
|
||||
var renderer = GetComponentInChildren<Renderer>();
|
||||
var block = new MaterialPropertyBlock();
|
||||
block.SetColor("_BaseColor", data.Color);
|
||||
renderer.SetPropertyBlock(block);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +0,0 @@
|
||||
namespace SepCore.Entity
|
||||
{
|
||||
public class FireMageEnemy : RemoteEnemy
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -50,7 +50,7 @@ namespace SepCore.Entity
|
||||
switch (enemyState)
|
||||
{
|
||||
case EnemyStateType.Idle:
|
||||
Movement.SetMove(false);
|
||||
_movementComponent.SetMove(false);
|
||||
if (HasValidTarget())
|
||||
{
|
||||
TransitionTo(EnemyStateType.Seek);
|
||||
@@ -70,8 +70,8 @@ namespace SepCore.Entity
|
||||
return;
|
||||
}
|
||||
|
||||
Movement.SetMove(true);
|
||||
Movement.SetDirection(GetTargetDirection());
|
||||
_movementComponent.SetMove(true);
|
||||
_movementComponent.SetDirection(GetTargetDirection());
|
||||
break;
|
||||
case EnemyStateType.Chase:
|
||||
if (!HasValidTarget())
|
||||
@@ -80,7 +80,7 @@ namespace SepCore.Entity
|
||||
return;
|
||||
}
|
||||
|
||||
Movement.SetMove(false);
|
||||
_movementComponent.SetMove(false);
|
||||
if (!IsTargetInRange())
|
||||
{
|
||||
TransitionTo(EnemyStateType.Seek);
|
||||
@@ -103,12 +103,12 @@ namespace SepCore.Entity
|
||||
|
||||
if (enemyState == EnemyStateType.Chase)
|
||||
{
|
||||
Movement.SetMove(false);
|
||||
_movementComponent.SetMove(false);
|
||||
}
|
||||
|
||||
if (enemyState == EnemyStateType.Attack)
|
||||
{
|
||||
Movement.SetMove(false);
|
||||
_movementComponent.SetMove(false);
|
||||
ExecuteAttack();
|
||||
TransitionTo(EnemyStateType.Chase);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
namespace SepCore.Entity
|
||||
{
|
||||
public class PenguinEnemy : MeleeEnemy
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -24,7 +24,7 @@ namespace SepCore.Entity
|
||||
|
||||
if (_target == null)
|
||||
{
|
||||
Movement.SetMove(false);
|
||||
_movementComponent.SetMove(false);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -33,7 +33,7 @@ namespace SepCore.Entity
|
||||
float distanceSquared = toTarget.sqrMagnitude;
|
||||
if (distanceSquared <= _attackRangeSquared)
|
||||
{
|
||||
Movement.SetMove(false);
|
||||
_movementComponent.SetMove(false);
|
||||
if (_canAttack)
|
||||
{
|
||||
TryFireProjectile();
|
||||
@@ -42,8 +42,8 @@ namespace SepCore.Entity
|
||||
}
|
||||
else
|
||||
{
|
||||
Movement.SetMove(true);
|
||||
Movement.SetDirection(GetTargetDirection());
|
||||
_movementComponent.SetMove(true);
|
||||
_movementComponent.SetDirection(GetTargetDirection());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +0,0 @@
|
||||
namespace SepCore.Entity
|
||||
{
|
||||
public class SkeletonEnemy : MeleeEnemy
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -1,6 +0,0 @@
|
||||
namespace SepCore.Entity
|
||||
{
|
||||
public class SkeletonGiantEnemy : MeleeEnemy
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
namespace SepCore.Entity
|
||||
{
|
||||
public class SkullEnemy : MeleeEnemy
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 781d68b4bd8d55b4284c010bd67d2fc6
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,6 @@
|
||||
namespace SepCore.Entity
|
||||
{
|
||||
public class YetiEnemy : RemoteEnemy
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -154,8 +154,14 @@ namespace SepCore.Entity
|
||||
return 0f;
|
||||
}
|
||||
|
||||
MovementComponent movementComponent = targetable.GetComponent<MovementComponent>();
|
||||
return movementComponent != null ? Mathf.Max(0f, movementComponent.EnemyBodyRadius) : 0f;
|
||||
if (targetable is not EnemyBase enemy)
|
||||
{
|
||||
return 0f;
|
||||
}
|
||||
|
||||
EnemyMovementComponent movementComponent =
|
||||
enemy.ChildrenMap.Get("Movement").GetComponent<EnemyMovementComponent>();
|
||||
return Mathf.Max(0f, movementComponent.EnemyBodyRadius);
|
||||
}
|
||||
|
||||
private float ResolveStrikePlaneY()
|
||||
|
||||
Reference in New Issue
Block a user