using UnityEngine;
using System.Collections;
public class onClick : MonoBehaviour {
public void Options(string optionMenu){
DontDestroyOnLoad(gameObject.GetComponent());
Application.LoadLevel (optionMenu);
}
public void Back(string mainMenu){
Application.LoadLevel (mainMenu);
DontDestroyOnLoad(gameObject.GetComponent<AudioSource>());
}
public void Highscores(string highscore){
Application.LoadLevel (highscore);
DontDestroyOnLoad(gameObject.GetComponent<AudioSource>());
}
public void VolumeControl(float volume)
{
GetComponent<AudioSource>().volume = volume;
}
i have my audiosource attached to canvas, onclick script attached to it n i wish that on changing scenes(main menu to options) audio should’nt be effected . here audio is not effected but my buttons on main menu are also displayed on options menu but according to my understanding only audiosource should remain rest everything should get destroyed…main menu buttons uses this script functions like option button uses option method…i also used awake function but all went in vein.also m using unity5.3.3
plz help