void Start() { bgm = GS_Music.GetComponent <AudioSource>(); cs_music = GS_Music.GetComponent <music>(); cs_tw = UI_ESC_Text_.GetComponent <text_writer>(); Cursor.visible = false; }
private void AddFileM3U(music mc, object entry = null) { PlayList pl; if (entry == null) { pl = M3U.LoadM3U(mc.fileName, rootPath); } else { pl = M3U.LoadM3U(entry, mc.arcFileName); } if (pl == null) { return; } if (pl.lstMusic == null || pl.lstMusic.Count < 1) { return; } foreach (music m in pl.lstMusic) { AddFileLoop(m, entry); } }
public void Convert(music id) { targetFound = false; readyToExplode = false; converted = true; gameObject.transform.GetChild(0).tag = "Converted"; convertedID = id; gameObject.GetComponentInChildren <SpriteRenderer>().sprite = convertedSprite; musicID = id; switch (musicID) { case music.none: StartNone(); break; case music.follow: StartFollow(); break; case music.explode: StartExplode(); break; default: StartNone(); break; } }
protected void fbit_Click(object sender, EventArgs e) { if (FileUpload1.FileName == "" || FileUpload1.FileName == null) { return; } string[] fileArr = FileUpload1.FileName.Split('\\'); string fileNstr = fileArr[fileArr.Length - 1]; string webDir = Server.MapPath("/play/.") + "\\music\\"; if (!Directory.Exists(webDir)) { Directory.CreateDirectory(webDir); } FileUpload1.SaveAs(webDir + fileNstr); DataDataContext db = new DataDataContext(); var yy = new music { name = name.Text, who = who.Text, date = DateTime.Now, url = "/Play/Music/" + fileNstr }; db.music.InsertOnSubmit(yy); db.SubmitChanges(); GridView1.DataBind(); }
private void Awake() { Time.timeScale = timeScale; _options = GameObject.Find("Canvas").transform.Find("Options").gameObject; _currVolume = 0.5f; _musicInterpolation = 0; try { _musicManager = GameObject.Find("Music manager").GetComponent <music>(); } catch (NullReferenceException) { } isDebug = Application.isEditor; _redBar = GameObject.Find("Red_bar"); _sh = new StorageHandler(); ReadColors(); _pauseMenu = GameObject.Find("Canvas").GetComponentInChildren <PauseManager>(); _deathManager = GameObject.Find("Death manager").GetComponent <DeathManager>(); _cam = GameObject.Find("Main Camera").GetComponent <Camera>(); _pm = GameObject.Find("PlatformManager").GetComponent <PlatformManager>(); _rb = GetComponent <Rigidbody2D>(); _col = GetComponent <BoxCollider2D>(); transform.position = new Vector3(0, GetHeight() / 2, z: transform.position.z); _darkener = GameObject.Find("Canvas").transform.Find("Darkener").GetComponent <Image>(); }
public void playMusic(music m, bool loop) { musicSource.clip = musicClips[(int)m]; effectSource.volume = 0.5f; musicSource.loop = loop; musicSource.Play(); }
void Start() { musicAudioSource = GetComponent <AudioSource>(); StopAllCoroutines(); StartCoroutine(FadeIn()); musicPlayer = this; }
//返回music对象 private music generateMusic(dynamic d) { music t = new music(); t.bgMusic = util.generateImage(d["bgMusic"].ToString()); return(t); }
protected override void SetupSounds() { for (int i = 0; i < Enum.GetNames(typeof(music)).Length; i++) { music name = (music)i; AddSound2D(name.ToString()); } }
// Update is called once per frame void Update () { mainCamera = Camera.main.gameObject; print (mainCamera.GetComponent<CurrentLevelSong>().currentLevelMusic); if (mainCamera.GetComponent<CurrentLevelSong> ().currentLevelMusic != currentPlayingMusic) { playSong (mainCamera.GetComponent<CurrentLevelSong> ().currentLevelMusic); currentPlayingMusic = mainCamera.GetComponent<CurrentLevelSong> ().currentLevelMusic; } }
// Use this for initialization void Start () { // Make this persistant across all levels DontDestroyOnLoad (this); mainCamera = Camera.main.gameObject; currentPlayingMusic = mainCamera.GetComponent<CurrentLevelSong> ().currentLevelMusic; playSong (mainCamera.GetComponent<CurrentLevelSong> ().currentLevelMusic); }
private void Awake() { AudioListener.volume = 1; if (Instance != null) { Debug.LogError("2 or more examples of music!"); } Instance = this; }
void Awake() { if (instance != null && instance != this) { Destroy(this.gameObject); return; } else { instance = this; } DontDestroyOnLoad(this.gameObject); }
void Awake() { if(Instance){ DestroyImmediate(gameObject); }else { DontDestroyOnLoad(gameObject); Instance = this; } }
// Use this for initialization void Start() { Advertisement.Initialize("1453095"); musicManager = GameObject.Find("Music Manager").GetComponent <music>(); cashUpdate(PlayerPrefs.GetInt("money")); HelpToolsGameObject.transform.GetChild(0).transform.GetChild(5).GetComponent <TextMeshProUGUI>().text = "" + PlayerPrefs.GetInt("hayStackStock"); HelpToolsGameObject.transform.GetChild(1).transform.GetChild(5).GetComponent <TextMeshProUGUI>().text = "" + PlayerPrefs.GetInt("netStock"); HelpToolsGameObject.transform.GetChild(2).transform.GetChild(5).GetComponent <TextMeshProUGUI>().text = "" + PlayerPrefs.GetInt("loveStock"); settingShipStatus(); }
// Use this for initialization void Start() { // Make this persistant across all levels DontDestroyOnLoad(this); mainCamera = Camera.main.gameObject; currentPlayingMusic = mainCamera.GetComponent <CurrentLevelSong> ().currentLevelMusic; playSong(mainCamera.GetComponent <CurrentLevelSong> ().currentLevelMusic); }
void Start() { begee = GameObject.Find("bgm"); usr = GameObject.Find("character"); player = FindObjectOfType <controll>(); paused = FindObjectOfType <pause> (); ld = FindObjectOfType <LoadScene> (); sv = FindObjectOfType <GameScore> (); msc = FindObjectOfType <music> (); tutorial = GameObject.Find("tutor"); }
public void ChangeClip(music id) { if (musicPlayer.isPlaying) { musicPlayer.Stop(); } currentClip = Resources.Load <AudioClip>(songs.Get(id)); musicPlayer.clip = currentClip; musicPlayer.Play(); }
// Use this for initialization void Start() { PlayerPrefs.SetInt("netStock", 1); PlayerPrefs.SetInt("hayStackStock", 1); PlayerPrefs.SetInt("loveStock", 1); PlayerPrefs.GetString("Vibration", "True"); musicManager = GameObject.Find("Music Manager").GetComponent <music>(); musicManager.ObjectsSound(1); musicManager.UISFX(1); StartCoroutine(objectOpened(mainPanel)); }
private void StartAttack(music id) { if (id != music.none) { attackID = id; TakeControl(); attacking = true; pm.ChangeClip(id); mf.SetFieldType(attackID); } }
// Update is called once per frame void Update() { mainCamera = Camera.main.gameObject; print(mainCamera.GetComponent <CurrentLevelSong>().currentLevelMusic); if (mainCamera.GetComponent <CurrentLevelSong> ().currentLevelMusic != currentPlayingMusic) { playSong(mainCamera.GetComponent <CurrentLevelSong> ().currentLevelMusic); currentPlayingMusic = mainCamera.GetComponent <CurrentLevelSong> ().currentLevelMusic; } }
private void Awake() { if (instance != null) { Destroy(gameObject); } else { instance = this; GameObject.DontDestroyOnLoad(gameObject); } }
void Awake() { if (Instance) { DestroyImmediate(gameObject); } else { DontDestroyOnLoad(gameObject); Instance = this; } }
private void Awake() { if (!_instance) { _instance = this; } else { Destroy(this.gameObject); } DontDestroyOnLoad(this.gameObject); }
// Start is called before the first frame update void Start() { musiccs = GetComponent <music>(); setting = 1; Vector3 ruru = new Vector3(5000, 3700.5f, 0); rule.position = ruru; Vector3 Cube = new Vector3(0, -100, 0); cube.position = Cube; }
/// <summary> /// 获取点击的音乐 /// </summary> /// <param name="id"></param> /// <returns></returns> public ActionResult GetClickMusic(int id) { music model = service.FirstOrDefault(c => c.id == id); if (model != null) { return(Content(JsonConvert.SerializeObject(new { msg = 1, title = model.title, author = model.author, url = model.url, pic = model.pic }))); } else { return(Content(JsonConvert.SerializeObject(new { msg = 0 }))); } }
/// <summary> /// 获取第一条音乐 /// </summary> /// <returns></returns> public ActionResult GetFirstMusic() { music model = new music(); model = service.GetFirstMusic(); if (model != null) { return(Content(JsonConvert.SerializeObject(new { msg = 1, title = model.title, author = model.author, url = model.url, pic = model.pic }))); } else { return(Content(JsonConvert.SerializeObject(new { msg = 0 }))); } }
public void musicSounds(music s, bool playing) { musicPlayer.clip = music[(int)s]; Debug.Log("current s: " + s.ToString() + ", music player: " + musicPlayer.name); if (playing && !musicPlayer.isPlaying) { musicPlayer.Play(); Debug.Log("is playing"); } else if (!playing) { musicPlayer.Stop(); } }
public static async Task<music> get_kg_music(string hash) { try { var music = new music(); music.type = music_type.kuogu; music.kg_music = new kugou_music(); music.kg_music.url = await kugou.get_musicurl_by_hash(hash); return music; } catch (Exception) { return null; } }
public static async Task <music> get_kg_music(string hash) { try { var music = new music(); music.type = music_type.kuogu; music.kg_music = new kugou_music(); music.kg_music.url = await kugou.get_musicurl_by_hash(hash); return(music); } catch (Exception) { return(null); } }
private void Awake() { DontDestroyOnLoad(transform.gameObject); if (musicInstance == null) { musicInstance = this; } else { Destroy(gameObject); } _audioSource = GetComponent <AudioSource>(); PlayMusic(); }
public static string Get(music id) { switch (id) { case music.none: return("none"); case music.follow: return("Music/5th"); case music.explode: return("Music/Gnormenreigen"); default: return("none"); } }
public static async Task<music> get_local_music(string uri) { try { var music = new music(); music.type = music_type.local; music.l_music = new local_music(); music.l_music.file = await Windows.Storage.StorageFile.GetFileFromPathAsync(uri); music.l_music.data =await music.l_music.file.Properties.GetMusicPropertiesAsync(); return music; } catch (Exception) { return null; } }
public ActionResult SaveMusicMsg(music model) { string result = "ok"; try { if (model != null) { service.Insert(model); service.Save(); } } catch (Exception ext) { result = "no"; } return(Content(result)); }
public ActionResult DeleteMusic(int id) { string result = "ok"; music model = service.FirstOrDefault(c => c.id == id); try { if (model != null) { service.Delete(model); service.Save(); } } catch { result = "no"; } return(Content(result)); }
void playSong(music type) { GetComponent<AudioSource> ().clip = songList [(int)type]; GetComponent<AudioSource> ().Play (); }