IEnumerator Start() { Destroy(GetComponent <CircleCollider2D>()); gameObject.AddComponent <CircleCollider2D>().isTrigger = true; gameObject.GetComponent <Rigidbody2D>().collisionDetectionMode = CollisionDetectionMode2D.Continuous; gameObject.AddComponent <DamageHero>(); gameObject.layer = 17; _aud = gameObject.AddComponent <AudioSource>(); PropFight.SetSoundSettings(_aud); yield return(new WaitForSeconds(0.5f)); start = true; }
IEnumerator Start() { _anim = GetComponent <Animator>(); _aud = gameObject.AddComponent <AudioSource>(); PropFight.SetSoundSettings(_aud); bombExist = true; yield return(new WaitForSeconds(0.5f)); gameObject.AddComponent <BoxCollider2D>().isTrigger = true; gameObject.AddComponent <DamageHero>().damageDealt = 1; gameObject.layer = 17; start = true; }