(client) feat:完成实体生成函数,修复行为树加载错误,改进Define打印缩进
This commit is contained in:
@ -7,12 +7,13 @@ using UnityEngine.Serialization;
|
||||
|
||||
namespace Entity
|
||||
{
|
||||
public abstract class Entity:MonoBehaviour,ITick
|
||||
public class Entity:MonoBehaviour,ITick
|
||||
{
|
||||
public AIBase aiTree;
|
||||
public JobBase currentJob;
|
||||
public AttributesDef runtimeAttributes;
|
||||
public AttributesDef attributes;
|
||||
public Vector3 direction;
|
||||
public GameObject body;
|
||||
|
||||
public bool canSelect = true;
|
||||
public bool IsChase { set; get; } = true;
|
||||
@ -53,15 +54,15 @@ namespace Entity
|
||||
/// </summary>
|
||||
public virtual void TryMove()
|
||||
{
|
||||
transform.position+=direction * (runtimeAttributes.moveSpeed * Time.deltaTime * (IsChase ? 1 : 0.5f));
|
||||
transform.position+=direction * (attributes.moveSpeed * Time.deltaTime * (IsChase ? 1 : 0.5f));
|
||||
}
|
||||
|
||||
public virtual void OnHit(Entity from)
|
||||
{
|
||||
var hit = from.runtimeAttributes.attack - runtimeAttributes.defense;
|
||||
var hit = from.attributes.attack - attributes.defense;
|
||||
if (hit < 0)
|
||||
hit = from.runtimeAttributes.attack / 100;
|
||||
runtimeAttributes.health -= hit;
|
||||
hit = from.attributes.attack / 100;
|
||||
attributes.health -= hit;
|
||||
|
||||
currentJob.StopJob();
|
||||
}
|
||||
|
Reference in New Issue
Block a user