protected override void PreInitialization() { base.PreInitialization(); repo = this.GetComponent <SoundRepo>(); if (repo.effect.source == null) { Debug.LogError("Error: Sound Manager has no effect audio source\n"); return; } // Initialize effects source component repo.effect.source.loop = false; repo.effect.source.playOnAwake = false; if (repo.music.source == null) { Debug.LogError("Error: Sound Manager has no music audio source\n"); return; } sourceMusicVolume = repo.music.source.volume; // Initialize musics source component repo.music.source.loop = true; repo.music.source.playOnAwake = false; }
// Start is called before the first frame update void Start() { equippedItem = ItemInfo.ItemType.None; audioSource = this.gameObject.GetComponent <AudioSource>(); soundRepo = GameObject.FindObjectOfType <SoundRepo>(); }
// Start is called before the first frame update void Start() { line = this.gameObject.GetComponent <LineRenderer>(); line.enabled = false; audioSource = this.gameObject.GetComponent <AudioSource>(); soundRepo = GameObject.FindObjectOfType <SoundRepo>(); }