/// <summary> /// Creates a Bomb entity, bomb will explode after given time (fuse). /// </summary> public Entity CreateBomb(int x, int y, int size, int fuse, CPlayer owner) { Entity result = CreateBasicEntity(x, y, EntityType.Bomb); CBomb bomb = new CBomb(result, owner, size); result.AddComponent <CBomb>(bomb); result.AddComponent <CTimer>(new CTimer(result, fuse, bomb.onExplode)); result.AddComponent <CSolid>(new CSolid(result)); return(result); }
// 폭탄이 터지면 버블로 만들기 protected virtual void OnTriggerEnter2D(Collider2D other) { if (other.tag == "Bomb") { CBomb bomb = other.GetComponent <CBomb>(); if (bomb._canAttack) { bomb.AttackStateChange(); // 폭탄에 맞음 Hit(other); if (other.name == "AttackAlien(Cloen)") { other.GetComponent <CAttack>().StopAllCoroutines(); } } } }