Beispiel #1
0
    public void PlaySoundBackground(SoundBackground soundBackground)
    {
        AudioSource audioSource = GetAudioSource(soundBackground);

        audioSource.enabled = true;
        audioSource.Play();
    }
Beispiel #2
0
    public void StopSoundBackground(SoundBackground soundBackground)
    {
        AudioSource audioSource = GetAudioSource(soundBackground);

        audioSource.Stop();
        audioSource.enabled = false;
    }
 void Start()
 {
     MainCamera.cam.transform.position = new Vector3(0f, 0f, -10f);
     HpManager.Init();
     if (StoneManager.stone < 20)
     {
         StoneManager.stone = 20;
         StoneManager.ReloadStone(0);
     }
     delay = 2f;
     SoundBackground.Stop();
 }
Beispiel #4
0
    private AudioSource GetAudioSource(SoundBackground sound)
    {
        foreach (GameAssets.SoundBackgroundAudioSource soundBackgroundAudioSource in GameAssets.GetInstance().soundBackgroundAudioSourceArray)
        {
            if (soundBackgroundAudioSource.sound == sound)
            {
                return(soundBackgroundAudioSource.audioSource);
            }
        }

        Debug.Log("Sound: " + sound + "not found!");
        return(null);
    }
 void Update()
 {
     if (count < 0)
     {
         count++;
     }
     else if (count < max)
     {
         count++;
         playerController.minCam += offset;
         playerController.ReloadCamera();
         if (count == max)
         {
             Time.timeScale = 1f;
             if (Boss.boss != null)
             {
                 Boss.boss.GetComponent <Boss>().Enable();
             }
             SoundBackground.PlayBGMBoss();
             playerController.enabled = true;
             Destroy(gameObject);
         }
     }
 }
 void Start()
 {
     SoundBackground.PlayBGMStage(music);
     StageManager.stageNext = stageNext;
     Destroy(gameObject);
 }