Esempio n. 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();
        }
    }