static void DrawEnemyInfo(NpcActor npc, GizmoType gizmoType) { if (!npc.hasTarget) { return; } Vector3 goal = new Vector3(npc._target.x, npc._target.y, npc._target.z); Gizmos.color = Color.yellow; Gizmos.DrawLine(npc.transform.position, goal); }
protected virtual void SpawnNpcAndMove(Vector3 pSpawnPoint, StoreInfo store, int type) { GameObject prefab = _npcPrefabs[type + GetNPCGender()]; pSpawnPoint += new Vector3(UnityEngine.Random.Range(-0.5f, 1.0f), 0.0f, 0.0f); GameObject npc = Instantiate(prefab, pSpawnPoint, prefab.transform.rotation); NpcActor actor = npc.GetComponent <NpcActor>(); actor.SetTarget(store.position, store.building); if (store.building != null) { print(prefab.name + " is going to " + store.building.ToString()); } else { print(prefab.name + " is going to the exit"); } }