public IEnumerator when_shoot_should_using_the_default_ammo() { Linear_gun gun = weapon.GetComponent <Linear_gun>(); var bullet = gun.shot(); yield return(new WaitForSeconds(1)); target.assert_collision_enter(bullet); MonoBehaviour.DestroyImmediate(bullet); }
public IEnumerator when_hit_should_destroy_the_bullet() { Linear_gun gun = weapon.GetComponent <Linear_gun>(); var bullet = gun.shot(); yield return(new WaitForSeconds(1)); helper.game_object.comp.is_null(bullet); target.assert_not_collision_enter(); }
public IEnumerator when_stop_to_shotting_should_no_made_more_shots() { Linear_gun gun = weapon.GetComponent <Linear_gun>(); gun.continue_shotting = true; float shot_time = 1 / gun.stat.rate_fire; shot_time *= 3; yield return(new WaitForSeconds(shot_time)); gun.continue_shotting = false; yield return(new WaitForSeconds(2f)); target.assert_collision_enter_less_that( (int)gun.stat.rate_fire * 3); }