Example #1
0
    //Destroy  The
    public void DestroyBGMSoundFunction()
    {
        isBGMSound
            isBGMSound =

            FindObjectOfType <isBGMSound>();

        if (isBGMSound)
        {
            Destroy(isBGMSound.gameObject);
        }
        else
        {
            Debug.LogWarning("This Object isn't have isBGMSound Objects");
        }
    }
Example #2
0
    public void PausingBGMSoundFunction()
    {
        isBGMSound
            isBGMSound =

            FindObjectOfType <isBGMSound>();


        if (isBGMSound)
        {
            AudioSource localAudioSources = isBGMSound.GetComponent <AudioSource>();

            if (localAudioSources.isPlaying)
            {
                localAudioSources.Pause();
            }
        }
    }
Example #3
0
    //Change BGM Sound
    public void ChangeBGMSoundFunction()
    {
        isBGMSound
            isBGMSound =

            FindObjectOfType <isBGMSound>();

        if (isBGMSound != null)
        {
            AudioSource localAudioSources = isBGMSound.GetComponent <AudioSource>();

            localAudioSources.Stop();

            localAudioSources.clip = newClip;

            localAudioSources.Play();
        }
        else
        {
            InstantiateNewObjectFunction(newClip);;
        }
    }
Example #4
0
    //PlayBGMSound

    public void PlayBGMSoundFunction()
    {
        isBGMSound
            isBGMSound =

            FindObjectOfType <isBGMSound>();

        if (isBGMSound != null)
        {
            AudioSource localAudioSources = isBGMSound.GetComponent <AudioSource>();


            if (!localAudioSources.isPlaying)
            {
                localAudioSources.Play();
            }
        }
        else
        {
            InstantiateNewObjectFunction(mainSoundAudioClip);
        }
    }