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