예제 #1
0
 void UpdateSound()
 {
     foreach (ClipSound sound in sounds)
     {
         sound.source        = gameObject.AddComponent <AudioSource>();
         sound.source.clip   = sound.clip;
         sound.source.volume = sound.volume * SettingsScript.GetSoundEntry();
         sound.source.pitch  = sound.pitch;
         sound.source.loop   = sound.loop;
     }
 }
예제 #2
0
    // Start is called before the first frame update
    void Start()
    {
        lb.SetActive(false);
        shop.SetActive(false);
        options.SetActive(false);
        //Debug.Log("I: " + PlayerPrefs.GetString("items"));
        // Debug.Log("B: " + PlayerPrefs.GetString("bought"));

        FindObjectOfType <AudioManager>().Play("Stargazing");
        GameObject.Find("Main Camera").GetComponent <AudioSource>().volume = SettingsScript.GetSoundEntry();
    }
예제 #3
0
    void Awake()
    {
        if (instance == null)
        {
            instance = this;
        }
        else
        {
            Destroy(gameObject);
        }

        DontDestroyOnLoad(gameObject);

        foreach (ClipSound sound in sounds)
        {
            sound.source        = gameObject.AddComponent <AudioSource>();
            sound.source.clip   = sound.clip;
            sound.source.volume = sound.volume * SettingsScript.GetSoundEntry();
            sound.source.pitch  = sound.pitch;
            sound.source.loop   = sound.loop;
        }
    }
예제 #4
0
    void UpdateSound()
    {
        GameObject camera = GameObject.Find("Main Camera");

        camera.GetComponent <AudioSource>().volume *= SettingsScript.GetSoundEntry();
    }