August 2018
Beginner
334 pages
10h 19m
English
Pursue and Evade are essentially the same algorithm, but differ in terms of the base class they derive from:
using UnityEngine;
using System.Collections;
public class Pursue : Seek
{
public float maxPrediction;
private GameObject targetAux;
private Agent targetAgent;
}
public override void Awake() { base.Awake(); targetAgent = target.GetComponent<Agent>(); targetAux = target; target = new GameObject(); }
void OnDestroy ()
{
Destroy(targetAux);
}
Read now
Unlock full access