Example #1
0
    private void OnTriggerEnter2D(Collider2D other)
    {
        if (other.CompareTag("Templar")) //Faudra mettre le tag "Enemy" sur tous les ennemis
        {
            dormantEnemyScript = other.gameObject.GetComponent <DormantEnemy>();

            dormantEnemyScript.Spell1AndPot2();

            Destroy(this.gameObject);
        }
    }
Example #2
0
    private void Start()
    {
        enemy = GameObject.FindGameObjectWithTag("Enemy").transform;

        target = new Vector2(enemy.position.x, enemy.position.y);

        rb2d = GetComponent <Rigidbody2D>();
        fwd  = transform.TransformDirection(Vector3.up);

        DorEnemy = GetComponent <DormantEnemy>();

        StartCoroutine(TicTac());
    }
Example #3
0
    private void OnTriggerEnter2D(Collider2D other)
    {
        if (other.tag == "EnemyHitBox")
        {
            //applique effet
            //rb.AddForce(transform.right * forceAmount, ForceMode2D.Impulse);
            print("Enemy touched");

            dormantEnemy = other.GetComponent <DormantEnemy>();
            dormantEnemy.Spell2Effect();
        }
        else
        {
            //se detruit contre murs/autres
        }
    }
Example #4
0
    private void OnTriggerEnter2D(Collider2D other)
    {
        if (other.CompareTag("Templar")) //Faudra mettre le tag "Enemy" sur tous les ennemis
        {
            dormantEnemyScript = other.gameObject.GetComponent <DormantEnemy>();

            dormantEnemyScript.Spell2Effect();
        }

        if (other.CompareTag("Potion1") || other.CompareTag("Potion2"))
        {
            Destroy(gameObject);
        }

        //Si un jour on y arrive, faut stopper le collider contre les murs (pas le détruire mais faire en sorte qu'il aille pas plus loin)
    }
Example #5
0
    public void OnTriggerEnter2D(Collider2D other)
    {
        if (other.tag == "EnemyHitBox")
        {
            print("Enemy touched");



            dormantEnemy = other.GetComponent <DormantEnemy>();
            dormantEnemy.Spell1Effect();
            Destroy(gameObject);

            //other.GetComponent<DormantEnemy>();
            //GameObject dormantEnemy = other.GetComponent<DormantEnemy>();
            //dormantEnemy.Spell1Effect();
            //DormantEnemy dormantEnemy = gameObject.GetComponent<DormantEnemy>();
        }
        else
        {
            //se detruit contre murs/autres
        }
    }