void CoverShootCycle(BehaviourAI ai, SenseMemoryFactory.SMData data) { Transform enemyTarget = data.targets[0]; // get cover point coverPoint = ai.GetAvoidanceWaypoint(data.targets[0].position); // move to cover point ai.agent.SetDestination(coverPoint); // fire while moving ai.ShootAt(enemyTarget); }
public override void UpdatePattern(BehaviourAI ai, SenseMemoryFactory.SMData data) { if (data.targets.Count != 0) { retreatPoint = ai.GetAvoidanceWaypoint(data.targets[0].position); ai.agent.SetDestination(retreatPoint); } if (ai.DestinationReached(0.1f)) { if (!rotated) { retreatPoint = ai.transform.position + (data.targetLastSeen - ai.transform.position).normalized; ai.agent.SetDestination(retreatPoint); rotated = true; } else { KillPattern(ai); rotated = false; return; } } }
public override void StartPatternWith(BehaviourAI ai, SenseMemoryFactory.SMData data) { base.StartPatternWith(ai, data); retreatPoint = ai.GetAvoidanceWaypoint(data.targets[0].position); ai.agent.SetDestination(retreatPoint); }