Example #1
0
        private static void AddUixActions()
        {
            ExpansionKitApi.GetExpandedMenu(ExpandedMenu.SettingsMenu).AddSimpleButton("More IKTweaks...", ShowIKTweaksMenu);

            var settingNameList = new[]
            {
                nameof(IkTweaksSettings.StraightSpineAngle),
                nameof(IkTweaksSettings.StraightSpinePower),
                nameof(IkTweaksSettings.DoHipShifting),
                nameof(IkTweaksSettings.PreStraightenSpine),
                nameof(IkTweaksSettings.StraightenNeck),
                nameof(IkTweaksSettings.PinHipRotation),
                nameof(IkTweaksSettings.NeckPriority),
                nameof(IkTweaksSettings.SpineRelaxIterations),
                nameof(IkTweaksSettings.MaxNeckAngleBack),
                nameof(IkTweaksSettings.MaxNeckAngleFwd),
                nameof(IkTweaksSettings.MaxSpineAngleBack),
                nameof(IkTweaksSettings.MaxSpineAngleFwd),
            };
            var updateCallbacks = new List <Action>();

            foreach (var s in settingNameList)
            {
                updateCallbacks.Add(ExpansionKitApi.RegisterSettingsVisibilityCallback(
                                        IkTweaksSettings.IkTweaksCategory, s, () => IkTweaksSettings.FullBodyVrIk.Value));
            }

            IkTweaksSettings.FullBodyVrIk.OnValueChangedUntyped += () =>
            {
                foreach (var it in updateCallbacks)
                {
                    it();
                }
            };
        }