Example #1
0
    public void SpawnNPC2()
    {
        Vector3 posNPC2  = new Vector3(339.9f, -16.65f, 0);
        Scr_NPC tempNPC2 = Instantiate(modeleNPC2, posNPC2, modeleNPC2.transform.rotation);

        tempNPC2.besoinAtteint = false;
        tempNPC2.name          = modeleNPC2.name;
    }
Example #2
0
    public void SpawnNPC()
    {
        Vector3 posNPC  = new Vector3(-300, -44, 0);
        Scr_NPC tempNPC = Instantiate(modeleNPC, posNPC, modeleNPC.transform.rotation);

        tempNPC.besoinAtteint = false;
        tempNPC.name          = modeleNPC.name;
    }
    // Fonctions
    private void OnTriggerEnter2D(Collider2D other)
    {
        if (other.CompareTag("Avatar") && !this.CompareTag("DropOff"))
        {
            pickUpAllowed = true;
        }
        if (other.CompareTag("Avatar") && this.CompareTag("DropOff"))
        {
            //manager.SpawnNPC();

            dropOffAllowed = true;
        }
        if (other.CompareTag("NPC"))
        {
            Scr_NPC newNpc = other.gameObject.GetComponent <Scr_NPC>();
            npc = newNpc;
        }
    }