예제 #1
0
        public IEnumerator when_set_the_owner_of_the_gun_should_be_seted_to_each_bullet()
        {
            var rol = npc.GetComponent <rol_sheet.Rol_sheet>();

            gun.owner = rol;
            var bullet = gun.shot();

            yield return(new WaitForSeconds(1));

            var damage = bullet.GetComponent <Damage>();

            Assert.AreEqual(damage.owner, rol);
        }
예제 #2
0
파일: Gun.cs 프로젝트: dem4ply/kabuki_3V
        public IEnumerator when_shot_should_create_a_bullet()
        {
            var bullet = gun.shot();

            yield return(new WaitForSeconds(1));

            tests_tool.assert.game_object.is_not_null(bullet);
        }
예제 #3
0
        public void throw_net(Vector3 position)
        {
            gun.aim_to(position);
            var bullet     = (Controller_bullet_net)gun.shot();
            var target_net = helper.instantiate._(prefab_target_net, position);

            bullet.target = target_net.transform;
            bullet.origin = transform;
            bullet.owner  = this;
        }
예제 #4
0
 protected virtual void do_automatic_shot(
     float delta_time, chibi.weapon.gun.Gun gun)
 {
     gun.last_automatic_shot += delta_time;
     if (gun.last_automatic_shot > gun.rate_fire)
     {
         gun.last_automatic_shot -= gun.rate_fire;
         gun.shot();
     }
 }