Files

65 lines
1.5 KiB
C#
Raw Permalink Normal View History

2024-08-23 15:49:34 +08:00
/********************************************************************************
* BaseAI.cs
* \Script\Player\BaseAI.cs
*
* 2013-11-18
*
* AI基础类
*
*
*********************************************************************************/
using UnityEngine;
using System.Collections;
using Games.GlobeDefine;
namespace Games.AI_Logic
{
public class BaseAI : MonoBehaviour
{
//AI的具体类型
protected CharacterDefine.AI_TYPE m_AIType;
public CharacterDefine.AI_TYPE AIType
{
get { return m_AIType; }
set { m_AIType = value; }
}
public CharacterDefine.AI_STATE_TYPE AIStateType;
public BaseAI()
{
m_AIType = CharacterDefine.AI_TYPE.AI_TYPE_INVALID;
}
//将AI装载到OBJ的AIController中
public void LoadAI()
{
AIController aiController = this.gameObject.GetComponent<AIController>();
if (aiController)
{
aiController.AddAIByStateType(this);
}
}
//销毁AI
public virtual void Destroy()
{
}
//激活AI
public virtual void OnActive()
{
}
//关闭AI
public virtual void OnDeactive()
{
}
//更新AI
public virtual void UpdateAI()
{
}
}
}