(client):feat:添加对列表定义读取的支持,ui管理器将对没有键的窗口也进行统一管理
This commit is contained in:
35
Client/Assets/Scripts/Entity/AIBase.cs
Normal file
35
Client/Assets/Scripts/Entity/AIBase.cs
Normal file
@ -0,0 +1,35 @@
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Entity
|
||||
{
|
||||
public abstract class AIBase
|
||||
{
|
||||
public virtual bool Run(Entity target)
|
||||
{
|
||||
foreach (var aiBase in children)
|
||||
{
|
||||
if (aiBase.Run(target))
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
public List<AIBase> children=new();
|
||||
}
|
||||
|
||||
public class ContinuousMove : AIBase
|
||||
{
|
||||
override public bool Run(Entity target)
|
||||
{
|
||||
target.gameObject.transform.position +=
|
||||
Time.deltaTime * target.runtimeAttributes.moveSpeed * target.direction;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
public class TrackPlayer : AIBase
|
||||
{
|
||||
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user