private void OnTriggerEnter2D(Collider2D collision)
    {
        BaseStandardEnemy enemy = collision.gameObject.GetComponent <BaseStandardEnemy>();

        if (enemy)
        {
            enemy.Damage(false);
        }
        else if (collision.gameObject.GetComponent <BaseEnemy>())
        {
            collision.gameObject.GetComponent <BaseEnemy>().Damage(true);
        }
    }
Beispiel #2
0
    void OnCollisionExit2D(Collision2D collision)
    {
        PlayerPawn playerPawn = collision.gameObject.GetComponent(typeof(PlayerPawn)) as PlayerPawn;

        if (playerPawn != null)
        {
            playerPawn.transform.SetParent(null);
        }

        BaseStandardEnemy basestandardEnemy = collision.gameObject.GetComponent(typeof(BaseStandardEnemy)) as BaseStandardEnemy;

        if (basestandardEnemy != null)
        {
            basestandardEnemy.Parent.transform.SetParent(null);
        }
    }
Beispiel #3
0
    void OnTriggerEnter2D(Collider2D collider)
    {
        PlayerPawn playerPawn = collider.GetComponent(typeof(PlayerPawn)) as PlayerPawn;

        if (playerPawn != null)
        {
        }

        BaseStandardEnemy basestandardEnemy = collider.GetComponent(typeof(BaseStandardEnemy)) as BaseStandardEnemy;

        if (basestandardEnemy != null)
        {
            basestandardEnemy.currentaction = basestandardEnemy.Die;
            basestandardEnemy.Health        = 0;
        }
    }