// //解决人物站在炸弹上时,isTrigger为true,无法被fire引爆 // void OnTriggerEnter2D(Collider2D other) { if (other.tag == "fire") { BombExplosion(this.gameObject, gobj_fire); WhenBombExplosion -= new WhenBombExplosionEventHandler(StartBombExplosion); } }
void OnCollisionEnter2D(Collision2D collision) { //Debug.Log(collision.collider.tag); if (collision.collider.tag == "fire") { BombExplosion(this.gameObject, gobj_fire); WhenBombExplosion -= new WhenBombExplosionEventHandler(StartBombExplosion); } }
IEnumerator Bommm() { yield return(new WaitForSeconds(bombseconds)); BombExplosion(this.gameObject, gobj_fire); WhenBombExplosion -= new WhenBombExplosionEventHandler(StartBombExplosion); /* * Destroy(this.gameObject); * F_fire.InsFire (go_fire); * playerControl.CanBomb --; */ }
//private Fire fire_touch_bomb; // public GameObject bomb; private void Awake() { WhenBombExplosion += new WhenBombExplosionEventHandler(StartBombExplosion); FirPower = new playerControl(); }