// Use this for initialization void Start() { NPCDatabase = GameObject.Find("NPCS").GetComponent <NPCDatabase>(); controller = GetComponent <EnemyController>(); npc = NPCDatabase.FetchNPCByID(controller.ID); target = controller.Target; distanceFromTarget = controller.DistanceToTarget; }
void Start() { id = 4; NPCDatabase = GameObject.Find("NPCS").GetComponent <NPCDatabase>(); npc = NPCDatabase.FetchNPCByID(id); if (npc == null) { Destroy(gameObject); } //name = npc.Name; health = npc.Health; exp = npc.Exp; }
void Start() { NPCDatabase = GameObject.Find("NPCS").GetComponent <NPCDatabase>(); npc = NPCDatabase.FetchNPCByID(id); if (npc == null) { Destroy(gameObject); } //name = npc.Name; health = npc.Health; exp = npc.Exp; //Targets the player if (GameObject.FindWithTag("Player")) { target = GameObject.FindWithTag("Player"); targetController = (PlayerController)target.GetComponent(typeof(PlayerController)); } //Die(); }