Hello How to program setting class and what type of information we can store in setting class. Can we store vector 3 , bools , Strings int ? How to store these ?
I give you an example, how I saved haptics feedback settings into settings class. This is code for on/off button: Code: function init(){ if(Settings.haptic == undefined){ Settings.haptic = 1; } if(Settings.switched == undefined){ Settings.switched = false; } } function start(){ if (Settings.haptic == 0) { this.emitSignal('off', true); this.emitSignal('on', false); } else { this.emitSignal('off', false); this.emitSignal('on', true); } } function update(dt){ } function signal(name, value) { if (name =='Trigger' && value) { if (Settings.switched == false && Settings.haptic == 1) { Settings.haptic = 0; this.emitSignal('off', true); this.emitSignal('on', false); } else { Settings.haptic = 1; this.emitSignal('off', false); this.emitSignal('on', true); } Settings.switched = !Settings.switched; } } And to call this Settings.haptic value in add point node, I used this code: Code: function init(){ } function update(dt){ } function signal(name, value){ if(value){ let amount = this.attribute('Amount'); this.scene().addScorePoint( amount ); if (Settings.haptic==1) { System.sendHapticFeedback(2); } } }