void RandomNewNPC(NPCSO npcSO) { //Debug.Log("Random a npc"); GlobalControl.Instance.npcPos = new Vector3(0, 0, 0); GlobalControl.Instance.npcDir = Random.insideUnitCircle; npcSO.timeLimit = timerSO.round; }
public void AddNewNPC(int npc_id, Vector3 location) { if (npc_id < 0 || npc_id >= npc_db.npcs.Length) { return; } NPCSO npc = npc_db.npcs[npc_id]; npc_list.Add(Instantiate(npc.npc_prefab, location, Quaternion.identity).GetComponent <NPC>()); npc_list[npc_list.Count - 1].encounter = this; npc_list[npc_list.Count - 1].name = npc.name; npc_list[npc_list.Count - 1].InitTable(raid_manager.unit_list); }