Ejemplo n.º 1
0
 void Start()
 {
     bgm            = GS_Music.GetComponent <AudioSource>();
     cs_music       = GS_Music.GetComponent <music>();
     cs_tw          = UI_ESC_Text_.GetComponent <text_writer>();
     Cursor.visible = false;
 }
Ejemplo n.º 2
0
        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);
            }
        }
Ejemplo n.º 3
0
    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;
        }
    }
Ejemplo n.º 4
0
    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();
    }
Ejemplo n.º 5
0
    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>();
    }
Ejemplo n.º 6
0
 public void playMusic(music m, bool loop)
 {
     musicSource.clip    = musicClips[(int)m];
     effectSource.volume = 0.5f;
     musicSource.loop    = loop;
     musicSource.Play();
 }
Ejemplo n.º 7
0
 void Start()
 {
     musicAudioSource = GetComponent <AudioSource>();
     StopAllCoroutines();
     StartCoroutine(FadeIn());
     musicPlayer = this;
 }
Ejemplo n.º 8
0
        //返回music对象
        private music generateMusic(dynamic d)
        {
            music t = new music();

            t.bgMusic = util.generateImage(d["bgMusic"].ToString());

            return(t);
        }
Ejemplo n.º 9
0
 protected override void SetupSounds()
 {
     for (int i = 0; i < Enum.GetNames(typeof(music)).Length; i++)
     {
         music name = (music)i;
         AddSound2D(name.ToString());
     }
 }
Ejemplo n.º 10
0
	// 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;
		}
	}
Ejemplo n.º 11
0
	// 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);
	}
Ejemplo n.º 12
0
 private void Awake()
 {
     AudioListener.volume = 1;
     if (Instance != null)
     {
         Debug.LogError("2 or more examples of music!");
     }
     Instance = this;
 }
Ejemplo n.º 13
0
 void Awake()
 {
     if (instance != null && instance != this) {
         Destroy(this.gameObject);
         return;
     } else {
         instance = this;
     }
     DontDestroyOnLoad(this.gameObject);
 }
Ejemplo n.º 14
0
 void Awake()
 {
     if(Instance){
         DestroyImmediate(gameObject);
     }else
     {
         DontDestroyOnLoad(gameObject);
         Instance = this;
     }
 }
Ejemplo n.º 15
0
 // 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();
 }
Ejemplo n.º 16
0
    // 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);
    }
Ejemplo n.º 17
0
 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");
 }
Ejemplo n.º 18
0
    public void ChangeClip(music id)
    {
        if (musicPlayer.isPlaying)
        {
            musicPlayer.Stop();
        }

        currentClip      = Resources.Load <AudioClip>(songs.Get(id));
        musicPlayer.clip = currentClip;
        musicPlayer.Play();
    }
Ejemplo n.º 19
0
 // 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));
 }
Ejemplo n.º 20
0
 private void StartAttack(music id)
 {
     if (id != music.none)
     {
         attackID = id;
         TakeControl();
         attacking = true;
         pm.ChangeClip(id);
         mf.SetFieldType(attackID);
     }
 }
Ejemplo n.º 21
0
    // 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;
        }
    }
Ejemplo n.º 22
0
 private void Awake()
 {
     if (instance != null)
     {
         Destroy(gameObject);
     }
     else
     {
         instance = this;
         GameObject.DontDestroyOnLoad(gameObject);
     }
 }
Ejemplo n.º 23
0
 void Awake()
 {
     if (Instance)
     {
         DestroyImmediate(gameObject);
     }
     else
     {
         DontDestroyOnLoad(gameObject);
         Instance = this;
     }
 }
Ejemplo n.º 24
0
    private void Awake()
    {
        if (!_instance)
        {
            _instance = this;
        }
        else
        {
            Destroy(this.gameObject);
        }

        DontDestroyOnLoad(this.gameObject);
    }
Ejemplo n.º 25
0
 void Awake()
 {
     if (instance != null && instance != this)
     {
         Destroy(this.gameObject);
         return;
     }
     else
     {
         instance = this;
     }
     DontDestroyOnLoad(this.gameObject);
 }
Ejemplo n.º 26
0
    // 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;
    }
Ejemplo n.º 27
0
        /// <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 })));
            }
        }
Ejemplo n.º 28
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 })));
            }
        }
Ejemplo n.º 29
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();
     }
 }
Ejemplo n.º 30
0
 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;
     }
 }
Ejemplo n.º 31
0
        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);
            }
        }
Ejemplo n.º 32
0
    private void Awake()
    {
        DontDestroyOnLoad(transform.gameObject);

        if (musicInstance == null)
        {
            musicInstance = this;
        }
        else
        {
            Destroy(gameObject);
        }

        _audioSource = GetComponent <AudioSource>();
        PlayMusic();
    }
Ejemplo n.º 33
0
    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");
        }
    }
Ejemplo n.º 34
0
        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;
            }

        }
Ejemplo n.º 35
0
        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));
        }
Ejemplo n.º 36
0
        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));
        }
Ejemplo n.º 37
0
	void playSong(music type) {
		GetComponent<AudioSource> ().clip = songList [(int)type];
		GetComponent<AudioSource> ().Play ();
	}