Beispiel #1
0
    // 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;
    }
Beispiel #2
0
    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;
    }
Beispiel #3
0
    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();
    }