Question by
tigres810 · Jul 25, 2017 at 06:42 PM ·
c#scripting problemunity5
I guys I have a really hard question
I made a json file in Application.datapath, but when the script starts and save the settings that file resets and when it load its all 0 how I check if that file exist in Application.datapath? or check another thing inside that json to make this working. void OnEnable ( ) { gameSettings = new GameSettings ( );
GraphicsDropDown.onValueChanged.AddListener ( delegate { OnGraphicsChange ( ); } );
AntiAliasingDropDown.onValueChanged.AddListener ( delegate { OnAntiAliasingChange ( ); } );
BrightnessSlider.onValueChanged.AddListener ( delegate { OnBrightnessChange ( ); } );
musicVolumeSlider.onValueChanged.AddListener ( delegate { OnMusicVo ( ); } );
PlayerBoxText.onValueChanged.AddListener ( delegate { OnNicknameChange ( ); } );
applybutton.onClick.AddListener ( delegate { OnApplyButtonClick ( ); } );
MusicPlayer = GameObject.FindGameObjectWithTag ( "Music" );
musicSource = MusicPlayer.GetComponent<AudioSource> ( );
//Here check if the file exists else load settings
}
Comment
Your answer
Follow this Question
Related Questions
Why does NetworkServer.ReplacePlayerForConnection not recognize the instantiated object parameter? 0 Answers
Can't Resources.Load ScriptableObject in Static class 0 Answers
How would you save anti aliasing or v-sync stuff that are like QualitySettings.antiAliasing = 2; 0 Answers
Unity 5.3 UI Button wont set Select state via script after the parent has been set inactive 0 Answers