Beispiel #1
0
    void OnCollisionEnter2D(Collision2D other)
    {
        EnemyController e = other.collider.GetComponent<EnemyController>();
        if (e != null)
        {
            e.Fix();
            r = FindObjectOfType(typeof(RubyController)) as RubyController;
            r.IncreaseCount();
        }

        Destroy(gameObject);

        HardEnemyController h = other.collider.GetComponent<HardEnemyController>();
        if (h != null)
        {
            h.Fix();
            r = FindObjectOfType(typeof(RubyController)) as RubyController;
            r.IncreaseCount();
        }

        HardestEnemy he = other.collider.GetComponent<HardestEnemy>();
        if(he != null)
        {
            r = FindObjectOfType(typeof(RubyController)) as RubyController;
            r.controlhardestenemy();
        }
    }
Beispiel #2
0
    void OnCollisionEnter2D(Collision2D other)
    {
        EnemyController e = other.collider.GetComponent <EnemyController>();

        if (e != null)
        {
            e.Fix();
        }
        HardEnemyController d = other.collider.GetComponent <HardEnemyController>();

        if (d != null)
        {
            d.Fix();
        }

        Destroy(gameObject);
    }
Beispiel #3
0
    void OnCollisionEnter2D(Collision2D other)
    {
        EnemyController e = other.collider.GetComponent <EnemyController>();

        if (e != null)
        {
            e.Fix();
        }

        HardEnemyController h = other.collider.GetComponent <HardEnemyController>();

        if (h != null)
        {
            h.Fix();
        }
        HardestEnemyController s = other.collider.GetComponent <HardestEnemyController>();

        if (s != null)
        {
            s.Fix();
        }

        Destroy(gameObject);
    }