public void SetMusic(AudioClip newMusic, MUSIC type) { switch (type) { case MUSIC.GEN_BG: genBG = newMusic; break; case MUSIC.BOSS_BG: bossBG = newMusic; break; case MUSIC.BOSS_DEATH: bossDeadBG = newMusic; break; case MUSIC.BOSS_NEARDEATH: bossNearDeathBG = newMusic; break; case MUSIC.PLAYER_DEATH: playerDeadBG = newMusic; break; case MUSIC.PLAYER_NEARDEATH: playerNearDeathBG = newMusic; break; } }
public void CrossFade(MUSIC transitionTo) { if (CheckPriority(currentMusicSnapshot, transitionTo)) { CrossFade(transitionTo, defaultTransitionTime); } }
public bool CheckPriority(MUSIC currentState, MUSIC toCheck) { /* * Check Special Cases * (Menu -> GenBG, Changing Biome -> Menu) */ if (currentState == MUSIC.MENU_BG && toCheck == MUSIC.GEN_BG) { return(true); } else if (currentState == MUSIC.CHANGING_BIOME && toCheck == MUSIC.MENU_BG) { return(true); } else if (currentState == MUSIC.CHANGING_BIOME && toCheck == MUSIC.GEN_BG) { return(true); } /* * Special Cases Checked * Move to Normal Cases */ if (toCheck < currentState) { return(true); } else { return(false); } }
public void SetMusicIntoSource(AudioClip music, MUSIC type) { switch (type) { case MUSIC.MENU_BG: menuBG.clip = music; break; case MUSIC.GEN_BG: genBG.clip = music; break; case MUSIC.BOSS_BG: bossBG.clip = music; break; case MUSIC.BOSS_NEARDEATH: bossNearDeathBG.clip = music; break; case MUSIC.BOSS_DEATH: bossDeadBG.clip = music; break; case MUSIC.PLAYER_DEATH: playerDeadBG.clip = music; break; case MUSIC.PLAYER_NEARDEATH: playerNearDeathBG.clip = music; break; } }
//================================================================================================================// public void PlayMusic(MUSIC music) { if (currentMusic == music) { return; } switch (music) { case MUSIC.JUNGLE: masterMixer.TransitionToSnapshots(musicSnapshots, new [] { 1f, 0f, 0f, 0f, 0f }, 2f); break; case MUSIC.DESERT: masterMixer.TransitionToSnapshots(musicSnapshots, new [] { 0f, 1f, 0f, 0f, 0f }, 2f); break; case MUSIC.MENU: masterMixer.TransitionToSnapshots(musicSnapshots, new [] { 0f, 0f, 1f, 0f, 0f }, 2f); break; case MUSIC.NONE: masterMixer.TransitionToSnapshots(musicSnapshots, new [] { 0f, 0f, 0f, 1f, 0f }, 2f); break; case MUSIC.HOME: masterMixer.TransitionToSnapshots(musicSnapshots, new [] { 0f, 0f, 0f, 0f, 1f }, 2f); break; default: throw new ArgumentOutOfRangeException(nameof(music), music, null); } currentMusic = music; }
/// <summary> /// Plays a music audio clip. /// </summary> /// <param name="clip">The music to play</param> /// <param name="onFinish">Callback on clip finished</param> public void PlayAudioClip(MUSIC clip, UnityAction onFinish = null) { if (!getMusicClip.ContainsKey(clip)) { Awake(); } getChannel[CHANNEL.MUSIC].PlayClip(getMusicClip[clip].GetClip()); }
public ActionResult DeleteConfirmed(string id) { MUSIC mUSIC = db.MUSIC.Find(id); db.MUSIC.Remove(mUSIC); db.SaveChanges(); return(RedirectToAction("Index")); }
public void PlayMusic(MUSIC music) { int m = (int)music; if (m >= 0 && m < audioClips_Music.Length) { audioSource_Music.clip = audioClips_Music [m]; audioSource_Music.Play(); } }
private AudioClip FindClip(MUSIC music) { foreach (MusicClip m in musicClips) { if (m.name == music) { return(m.clip[Random.Range(0, m.clip.Count - 1)]); } } Debug.LogError("NO CLIP FOUND"); return(null); }
public ActionResult Edit([Bind(Include = "MUSICID,MUSICNAME,SINGERID,PUBLISHER,PUBLISHTIME,ALBUMID,DURATION,PRICE,LIKES,PLAYTIMES,MUSICCOVER,MUSICPATH,LYRICS")] MUSIC mUSIC) { if (ModelState.IsValid) { db.Entry(mUSIC).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.ALBUMID = new SelectList(db.ALBUM, "ALBUMID", "ALBUMNAME", mUSIC.ALBUMID); ViewBag.SINGERID = new SelectList(db.SINGER, "SINGERID", "SINGERNAME", mUSIC.SINGERID); return(View(mUSIC)); }
public void PlayMusic(MUSIC music) { foreach (AudioSource s in sourcesMusic) { if (!s.isPlaying) { s.PlayOneShot(FindClip(music)); return; } } Debug.LogError("NO AUDIOSOURCE AVAILABLE!"); }
public void CrossFade(MUSIC transitionTo, float transitionTime) { switch (transitionTo) { case MUSIC.CHANGING_BIOME: //nextSnap = changingBiomeSnap; changingBiomeSnap.TransitionTo(transitionTime); currentMusicSnapshot = MUSIC.CHANGING_BIOME; break; case MUSIC.MENU_BG: menuBGSnap.TransitionTo(transitionTime); currentMusicSnapshot = MUSIC.MENU_BG; break; case MUSIC.GEN_BG: //nextSnap = genBGSnap; genBGSnap.TransitionTo(transitionTime); currentMusicSnapshot = MUSIC.GEN_BG; break; case MUSIC.BOSS_BG: //nextSnap = bossBGSnap; bossBGSnap.TransitionTo(transitionTime); currentMusicSnapshot = MUSIC.BOSS_BG; break; case MUSIC.BOSS_NEARDEATH: //nextSnap = bossNearDeathBGSnap; bossNearDeathBGSnap.TransitionTo(transitionTime); currentMusicSnapshot = MUSIC.BOSS_NEARDEATH; break; case MUSIC.BOSS_DEATH: //nextSnap = bossNearDeathBGSnap; bossDeadBGSnap.TransitionTo(transitionTime); currentMusicSnapshot = MUSIC.BOSS_DEATH; break; case MUSIC.PLAYER_NEARDEATH: //nextSnap = playerNearDeathBGSnap; playerNearDeathBGSnap.TransitionTo(transitionTime); currentMusicSnapshot = MUSIC.PLAYER_NEARDEATH; break; case MUSIC.PLAYER_DEATH: //nextSnap = playerDeadBGSnap; playerDeadBGSnap.TransitionTo(transitionTime); currentMusicSnapshot = MUSIC.PLAYER_DEATH; break; } }
// GET: MUSICs/Details/5 public ActionResult Details(string id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } MUSIC mUSIC = db.MUSIC.Find(id); if (mUSIC == null) { return(HttpNotFound()); } return(View(mUSIC)); }
// GET: MUSICs/Edit/5 public ActionResult Edit(string id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } MUSIC mUSIC = db.MUSIC.Find(id); if (mUSIC == null) { return(HttpNotFound()); } ViewBag.ALBUMID = new SelectList(db.ALBUM, "ALBUMID", "ALBUMNAME", mUSIC.ALBUMID); ViewBag.SINGERID = new SelectList(db.SINGER, "SINGERID", "SINGERNAME", mUSIC.SINGERID); return(View(mUSIC)); }
public void SetMusicIntoSource(MUSIC type) { switch (type) { case MUSIC.GEN_BG: audioManager.instance.SetMusicIntoSource( genBG, MUSIC.GEN_BG ); break; case MUSIC.BOSS_BG: audioManager.instance.SetMusicIntoSource( bossBG, MUSIC.BOSS_BG ); break; case MUSIC.BOSS_NEARDEATH: audioManager.instance.SetMusicIntoSource( bossNearDeathBG, MUSIC.BOSS_NEARDEATH ); break; case MUSIC.BOSS_DEATH: audioManager.instance.SetMusicIntoSource( bossDeadBG, MUSIC.BOSS_DEATH ); break; case MUSIC.PLAYER_DEATH: audioManager.instance.SetMusicIntoSource( playerDeadBG, MUSIC.PLAYER_DEATH ); break; case MUSIC.PLAYER_NEARDEATH: audioManager.instance.SetMusicIntoSource( playerNearDeathBG, MUSIC.PLAYER_NEARDEATH ); break; } }
//AudioController Functions //====================================================================================================================// public void PlayMusic(MUSIC music) { switch (music) { case MUSIC.MENU: musicMixer.TransitionToSnapshots(new[] { menuMusicSnapshot, gameMusicSnapshot }, new[] { 1f, 0f }, 2f); break; case MUSIC.GAME: musicMixer.TransitionToSnapshots(new[] { menuMusicSnapshot, gameMusicSnapshot }, new[] { 0f, 1f }, 2f); break; default: throw new ArgumentOutOfRangeException(nameof(music), music, null); } }
//指定した音楽でスタート public void startMusic(MUSIC musicKind, int numLebel) { Music.Play(musicKind.ToString()); rhythmText = ReadFile.readFile("MusicTempo/" + musicKind.ToString() + numLebel + ".txt"); //タイミング取得 nextTiming = int.Parse(rhythmText[cnt].Split(',')[0]); //初回タイミング pushRingScript.ResetPosition(); //出現場所のリセット switch (musicKind) { case MUSIC.Melt: barSpace = 3; break; case MUSIC.FlightSound: barSpace = 2; pushRingScript.SetLength(1500); break; } }
public void SetMusic(MUSIC music, float time) { switch (music) { case MUSIC.NONE: masterMixer.TransitionToSnapshots(_snapshots, new[] { 1f, 0f, 0f }, time); break; case MUSIC.MENU: masterMixer.TransitionToSnapshots(_snapshots, new[] { 0f, 1f, 0f }, time); break; case MUSIC.GAME: masterMixer.TransitionToSnapshots(_snapshots, new[] { 0f, 0f, 1f }, time); break; default: throw new ArgumentOutOfRangeException(nameof(music), music, null); } }
/// <summary> /// Sets the music to be played. /// </summary> public void SetMusic(MUSIC musicType) { switch (musicType) { case MUSIC.START: SetMusic(startMusic); break; case MUSIC.LEVEL: SetMusic(levelMusic); break; case MUSIC.BOSS: SetMusic(bossMusic); break; default: break; } }
public ActionResult Createproduct(MycreateSender msg) { int mid = 0; var file = Request.Files["file1"]; //var hy = Request.Form[""]; if (msg == null) { ViewBag.result = "上传失败"; } else { var iss = from t in db.SINGER where t.SINGERNAME == msg.singername select t.SINGERID; var issinger = iss.FirstOrDefault(); // var issinger = db.Database.SqlQuery<int>("select SINGERID from SINGER where SINGERNAME=" + msg.singername).FirstOrDefault(); //var issinger = db.Database.SqlQuery<int>("select SINGERID from SINGER where SINGERID=1").FirstOrDefault(); if (issinger == 0) { //写入singer var singer = new SINGER(); var maxid = db.Database.SqlQuery <int>("select max(SINGERID) from SINGER").FirstOrDefault(); maxid++; singer.SINGERID = maxid; singer.SINGERNAME = msg.singername; db.SINGER.Add(singer); db.SaveChanges(); //写入music var music = new MUSIC(); var maxid1 = db.Database.SqlQuery <int>("select max(MUSICID) from MUSIC").FirstOrDefault(); maxid1++;//新的user的ID mid = maxid1; music.MUSICID = maxid1; music.MUSICNAME = msg.songname; music.SINGERID = maxid; music.DURATION = msg.duration; db.MUSIC.Add(music); db.SaveChanges(); //写入MUISCTAG var musictag = new MUSICTAG(); musictag.MUSICID = maxid1; musictag.TAGNAME = msg.style; db.MUSICTAG.Add(musictag); db.SaveChanges(); ViewBag.result = "success"; } else { //写入music var music = new MUSIC(); var maxid = db.Database.SqlQuery <int>("select max(MUSICID) from MUSIC").FirstOrDefault(); maxid++;//新的user的ID mid = maxid; music.MUSICID = maxid; music.MUSICNAME = msg.songname; music.SINGERID = issinger; music.DURATION = msg.duration; db.MUSIC.Add(music); db.SaveChanges(); //写入MUISCTAG var musictag = new MUSICTAG(); musictag.MUSICID = maxid; musictag.TAGNAME = msg.style; db.MUSICTAG.Add(musictag); db.SaveChanges(); ViewBag.result = "success"; } } var name = mid.ToString(); //上传文件 var file1 = Request.Files["file1"]; if (file1 != null) { var fileName1 = name + ".mp3"; //var filePath = "C:\\Users\\16214\\Desktop"; var filePath1 = Server.MapPath("../save_audio"); if (!System.IO.Directory.Exists(filePath1)) { System.IO.Directory.CreateDirectory(filePath1); //若没有路径就创建新的路径 } // file.SaveAs(filePath+fileName); file1.SaveAs(System.IO.Path.Combine(filePath1, fileName1)); } var file2 = Request.Files["file2"]; if (file2 != null) { var fileName2 = name + ".txt"; //var filePath = "C:\\Users\\16214\\Desktop"; var filePath2 = Server.MapPath("../save_lyric"); if (!System.IO.Directory.Exists(filePath2)) { System.IO.Directory.CreateDirectory(filePath2); //若没有路径就创建新的路径 } // file.SaveAs(filePath+fileName); file2.SaveAs(System.IO.Path.Combine(filePath2, fileName2)); } var file3 = Request.Files["file3"]; if (file3 != null) { var fileName3 = name + ".jpg"; //var filePath = "C:\\Users\\16214\\Desktop"; var filePath3 = Server.MapPath("../save_cover"); if (!System.IO.Directory.Exists(filePath3)) { System.IO.Directory.CreateDirectory(filePath3); //若没有路径就创建新的路径 } // file.SaveAs(filePath+fileName); file3.SaveAs(System.IO.Path.Combine(filePath3, fileName3)); } return(View()); }
//================================================================================================================// public void SetMusic(MUSIC music) { SetMusic(music, fadeTime); }
public void PlayMusic(MUSIC music) { if (MusicSource.isPlaying) { MusicSource.Stop(); } switch (music) { case MUSIC.TitleScreen: MusicSource.clip = TitleScreenMusic; MusicSource.Play(); break; case MUSIC.LevelMusic: MusicSource.clip = LevelMusic[(int)Random.Range(0f, LevelMusic.Length-0.00001f)]; MusicSource.Play(); break; } }
partial void DeleteMUSIC(MUSIC instance);
partial void UpdateMUSIC(MUSIC instance);
partial void InsertMUSIC(MUSIC instance);
private void detach_MUSICs(MUSIC entity) { this.SendPropertyChanging(); entity.UNIT = null; }
private void attach_MUSICs(MUSIC entity) { this.SendPropertyChanging(); entity.UNIT = this; }