자 이제 행위를 구현 해볼 것이다. 먼저 해볼 행위는 추격과 회피이다.
추격과 회피는 가장 기본적인 행위에 의존 하고 추후 확장을 할 수 있기 때문입니다. 먼저 Seek(추격) 코드를 시작하겠습니다. using System.Collections; using System.Collections.Generic; using UnityEngine; /// /// 추격하는 Class /// public class Seek : AgentBehaviour { public override Steering GetSteering() { Steering steering = new Steering(); steering.linear = target.transform.position - transform.position; steering.linear.Normalize(); //방향만 남기기 steering.linear = steering.linear * agent.maxA...
#
AI
#
Unity
#
유니티
원문 링크 : 02.[Unity AI]추격과 회피 행위 구현하기