public static void PlaySound(string soundEffectName, float pitch, float pan, float volume, bool stopMusic)
        {
            soundEffectName = soundEffectName.Replace("\\", "|");

            Logger.Debug($"SoundEffect [{soundEffectName}]");
            SoundEffectTrack.Play(soundEffectName, pitch, pan, volume, stopMusic);
        }
예제 #2
0
        public void Test_New()
        {
            var track = new SoundEffectTrack ("PinPon.wav");

            Assert.AreEqual ("PinPon.wav", track.FileName);
            Assert.AreEqual (1.0f, track.Volume);
            Assert.AreEqual (1520, track.Duration);
        }
예제 #3
0
        public void Test_SetVolume()
        {
            var track = new SoundEffectTrack ("PinPon.wav");

            track.Volume = 0.1f;
            Assert.AreEqual (0.1f, track.Volume, 0.1f);

            track.Volume = 0.2f;
            Assert.AreEqual (0.2f, track.Volume, 0.1f);
        }
예제 #4
0
        public void Test_Play_and_Stop()
        {
            var track = new SoundEffectTrack ("PinPon.wav");

            track.Play();
            Assert.AreEqual (true, track.IsPlaying);

            track.Stop ();
            Assert.AreEqual (false, track.IsPlaying);
        }
예제 #5
0
        public static Node Create(string name, Vector3 pos)
        {
            var cmp = new MyCharacterButton (name);

            var spr = new Sprite (128, 64);
            spr.AddTexture (Resource.GetDefaultTexture ());

            var label1 = new Label ();
            label1.Text = cmp.dbCharacter.FullName;
            label1.SetOffset (10, 10);
            label1.Color = Color.Black;

            var label2 = new Label ();
            label2.Text = cmp.dbCharacter.FullNameYomi;
            label2.SetOffset (10, 30);
            label2.Color = Color.Black;

            var col = new CollisionObject ();
            col.Shape = new BoxShape (64, 32, 100);
            col.SetOffset (64, 32, 0);

            var snd = new SoundEffectTrack ("media/PinPon.wav");
            var clip = new SoundClip ("クリック音");
            clip.AddTrack (snd);

            var node = new Node ("Button(" + name + ")");
            node.Attach (cmp);
            node.Attach (spr);
            node.Attach (label1);
            node.Attach (label2);
            node.Attach (col);

            node.UserData.Add (clip.Name, clip);

            node.Translation = pos;
            node.DrawPriority = -1;

            return node;
        }
 public static void ReloadSounds() => SoundEffectTrack.ReloadSoundEffects();
 public static void Mute(bool mute) => SoundEffectTrack.Mute(mute);
 public static void PlayPokemonCry(int number, float pitch, float pan, float volume)
 {
     Logger.Debug($"SoundEffect Cry:{number}");
     SoundEffectTrack.PlayCry(number, pitch, pan, volume);
 }
 public static void LoadSounds(bool forceReplace = false) => SoundEffectTrack.LoadSounds(forceReplace);