Unity 2018 Artificial Intelligence Cookbook by Jorge Palacios

Unity 2018 Artificial Intelligence Cookbook by Jorge Palacios

Author:Jorge Palacios
Language: eng
Format: epub
Tags: COM051300 - COMPUTERS / Programming / Algorithms, COM012040 - COMPUTERS / Programming / Games, COM051310 - COMPUTERS / Programming Languages / C#
Publisher: Packt Publishing
Published: 2018-08-28T06:22:01+00:00


public void UpdateSlots() { GameObject leader = pattern.leader; Vector3 anchor = leader.transform.position; Vector3 slotPos; Quaternion rotation; rotation = leader.transform.rotation; foreach (SlotAssignment sa in slotAssignments) { // next step } }

Finally, implement the foreach loop:

Vector3 relPos; slotPos = pattern.GetSlotLocation(sa.slotIndex); relPos = anchor; relPos += leader.transform.TransformDirection(slotPos); Location charDrift = new Location(relPos, rotation); Character character = sa.character.GetComponent<Character>(); character.SetTarget(charDrift);



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.