Scripted AI and Scripting Engines 脚本AI与脚本引擎 This chapter discusses some of the techniques you can use to apply a scripting system to the problem of game AI, and the benefits you can reap from doing this. At its most basic level, you can think of scri
游戏中,怪物会自动的往玩家所在地点走去,那需要创建一个C#脚本EnemyAI,包含两个功能: 1. 怪物旋转自己对准玩家 2. 怪物向前移动,追逐玩家 public class EnemyAI : MonoBehaviour { public Transform target; public int moveSpeed; public int rotateSpeed; private Transform myTransform; void Awake(){ myTransform = trans