Example #1
0
 private void InitLink(SoundSetting.SoundGroup sg, SoundData sd, bool isSliderEvent)
 {
     this.LinkToggle(sg.toggle, (Action <bool>)(isOn => sd.Mute = isOn));
     ObservableExtensions.Subscribe <bool>(UnityEventExtensions.AsObservable <bool>((UnityEvent <M0>)sg.toggle.onValueChanged), (Action <M0>)(isOn => ((Behaviour)sg.image).set_enabled(!isOn)));
     UnityUIComponentExtensions.SubscribeToInteractable((IObservable <bool>)Observable.Select <bool, bool>((IObservable <M0>)UnityUIComponentExtensions.OnValueChangedAsObservable(sg.toggle), (Func <M0, M1>)(b => !b)), (Selectable)sg.slider);
     if (isSliderEvent)
     {
         this.LinkSlider(sg.slider, (Action <float>)(value => sd.Volume = (int)value));
     }
     else
     {
         ObservableExtensions.Subscribe <PointerEventData>(Observable.Where <PointerEventData>((IObservable <M0>)ObservableTriggerExtensions.OnPointerDownAsObservable((UIBehaviour)sg.slider), (Func <M0, bool>)(_ => Input.GetMouseButtonDown(0))), (Action <M0>)(_ => this.EnterSE()));
     }
 }
Example #2
0
 private void InitSet(SoundSetting.SoundGroup sg, SoundData sd)
 {
     sg.toggle.set_isOn(sd.Mute);
     sg.slider.set_value((float)sd.Volume);
 }