protected override void OnPlayerBulletTriggerEnter2D(Collider2D collision) { if (CollisionUtil.IsEnemyBullet(collision)) { var enemyBullet = collision.GetComponent <EnemyBullet>(); if (IsExploding && ShouldEraseBullet) { enemyBullet.DeactivateSelf(); } else { ManagedEnemyBullets.Add(enemyBullet); } } else if (CollisionUtil.IsPlayerBullet(collision)) { var playerBullet = collision.GetComponent <PlayerBullet>(); ManagedPlayerBullets.Add(playerBullet); } else if (CollisionUtil.IsPickup(collision)) { var pickup = collision.GetComponent <Pickup>(); ManagedPickups.Add(pickup); } // Enemy is handled in OnCollideWithEnemy() }
protected override void OnActivate() { Color color = Sprite.color; color.a = 1.0f; Sprite.color = color; IsExploding = true; //ShouldEraseBullet = true; //ManagedMiscSprites.Clear(); ManagedEnemies.Clear(); ManagedEnemyBullets.Clear(); ManagedPlayerBullets.Clear(); ManagedPickups.Clear(); Sequence.ResetSelf(); }