Restore Defaults button to restore the default settings.
This commit is contained in:
@@ -1154,6 +1154,7 @@ GameObject:
|
||||
- component: {fileID: 1310480035629572623}
|
||||
- component: {fileID: 1510780549024052800}
|
||||
- component: {fileID: 4307275810096043329}
|
||||
- component: {fileID: 143507707063213418}
|
||||
m_Layer: 12
|
||||
m_Name: Settings
|
||||
m_TagString: Untagged
|
||||
@@ -1262,6 +1263,25 @@ MonoBehaviour:
|
||||
m_EditorClassIdentifier:
|
||||
target: 1
|
||||
slider: {fileID: 512852062931003448}
|
||||
--- !u!114 &143507707063213418
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1647071810007517722}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 1ebe1a3f8ef35a041a8ef39da672dd49, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
valueControllers:
|
||||
- {fileID: 18611445735460691}
|
||||
- {fileID: 8343075384873062513}
|
||||
- {fileID: 5285357331933866282}
|
||||
- {fileID: 1310480035629572623}
|
||||
- {fileID: 1510780549024052800}
|
||||
- {fileID: 4307275810096043329}
|
||||
--- !u!1 &1694677102371321062
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
@@ -2952,6 +2972,153 @@ MonoBehaviour:
|
||||
m_FillOrigin: 0
|
||||
m_UseSpriteMesh: 0
|
||||
m_PixelsPerUnitMultiplier: 1
|
||||
--- !u!1 &4399914816600051466
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 3664260978476899140}
|
||||
- component: {fileID: 7108608958374546862}
|
||||
- component: {fileID: 2424293117796193332}
|
||||
- component: {fileID: 5839269911837038846}
|
||||
- component: {fileID: 8403009779207699600}
|
||||
m_Layer: 5
|
||||
m_Name: Restore Defaults Button
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!224 &3664260978476899140
|
||||
RectTransform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 4399914816600051466}
|
||||
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: -5.9}
|
||||
m_LocalScale: {x: 0.05, y: 0.05, z: 0.05}
|
||||
m_ConstrainProportionsScale: 1
|
||||
m_Children: []
|
||||
m_Father: {fileID: 4738851406616228330}
|
||||
m_RootOrder: -1
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0.5, y: 0.5}
|
||||
m_AnchorMax: {x: 0.5, y: 0.5}
|
||||
m_AnchoredPosition: {x: 399.3, y: 266.8}
|
||||
m_SizeDelta: {x: 2155, y: 1076}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!222 &7108608958374546862
|
||||
CanvasRenderer:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 4399914816600051466}
|
||||
m_CullTransparentMesh: 1
|
||||
--- !u!114 &2424293117796193332
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 4399914816600051466}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
m_Material: {fileID: 0}
|
||||
m_Color: {r: 1, g: 1, b: 1, a: 1}
|
||||
m_RaycastTarget: 1
|
||||
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
|
||||
m_Maskable: 1
|
||||
m_OnCullStateChanged:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
m_Sprite: {fileID: 21300000, guid: ab1a16880e37cfa499309fc8fd4250ba, type: 3}
|
||||
m_Type: 0
|
||||
m_PreserveAspect: 0
|
||||
m_FillCenter: 1
|
||||
m_FillMethod: 4
|
||||
m_FillAmount: 1
|
||||
m_FillClockwise: 1
|
||||
m_FillOrigin: 0
|
||||
m_UseSpriteMesh: 0
|
||||
m_PixelsPerUnitMultiplier: 1
|
||||
--- !u!114 &5839269911837038846
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 4399914816600051466}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 4e29b1a8efbd4b44bb3f3716e73f07ff, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
m_Navigation:
|
||||
m_Mode: 0
|
||||
m_WrapAround: 0
|
||||
m_SelectOnUp: {fileID: 0}
|
||||
m_SelectOnDown: {fileID: 0}
|
||||
m_SelectOnLeft: {fileID: 0}
|
||||
m_SelectOnRight: {fileID: 0}
|
||||
m_Transition: 2
|
||||
m_Colors:
|
||||
m_NormalColor: {r: 1, g: 1, b: 1, a: 1}
|
||||
m_HighlightedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1}
|
||||
m_PressedColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 1}
|
||||
m_SelectedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1}
|
||||
m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608}
|
||||
m_ColorMultiplier: 1
|
||||
m_FadeDuration: 0.1
|
||||
m_SpriteState:
|
||||
m_HighlightedSprite: {fileID: 21300000, guid: 261e77f9774b3224b9f61ebaff302284,
|
||||
type: 3}
|
||||
m_PressedSprite: {fileID: 21300000, guid: 261e77f9774b3224b9f61ebaff302284, type: 3}
|
||||
m_SelectedSprite: {fileID: 21300000, guid: ab1a16880e37cfa499309fc8fd4250ba, type: 3}
|
||||
m_DisabledSprite: {fileID: 0}
|
||||
m_AnimationTriggers:
|
||||
m_NormalTrigger: Normal
|
||||
m_HighlightedTrigger: Highlighted
|
||||
m_PressedTrigger: Pressed
|
||||
m_SelectedTrigger: Selected
|
||||
m_DisabledTrigger: Disabled
|
||||
m_Interactable: 1
|
||||
m_TargetGraphic: {fileID: 2424293117796193332}
|
||||
m_OnClick:
|
||||
m_PersistentCalls:
|
||||
m_Calls:
|
||||
- m_Target: {fileID: 143507707063213418}
|
||||
m_TargetAssemblyTypeName: RestoreDefaultsController, Assembly-CSharp
|
||||
m_MethodName: OnRestoreDefaults
|
||||
m_Mode: 1
|
||||
m_Arguments:
|
||||
m_ObjectArgument: {fileID: 0}
|
||||
m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine
|
||||
m_IntArgument: 0
|
||||
m_FloatArgument: 0
|
||||
m_StringArgument:
|
||||
m_BoolArgument: 0
|
||||
m_CallState: 2
|
||||
--- !u!114 &8403009779207699600
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 4399914816600051466}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 9c648a319c5c6aa47b3ef152a10657bf, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
--- !u!1 &4745390056551288905
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
@@ -5454,6 +5621,7 @@ RectTransform:
|
||||
m_LocalScale: {x: 0.15, y: 0.15, z: 0.15}
|
||||
m_ConstrainProportionsScale: 1
|
||||
m_Children:
|
||||
- {fileID: 3664260978476899140}
|
||||
- {fileID: 3355479367658290507}
|
||||
- {fileID: 4818343909123725175}
|
||||
m_Father: {fileID: 1774211016983706491}
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
[Serializable]
|
||||
abstract public class AbstractValueController : MonoBehaviour
|
||||
{
|
||||
abstract public void RestoreFromConfig();
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: dfd6e172b2a79944788029ce9d4220dd
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -3,9 +3,10 @@ using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
//using UnityEngine.UIElements;
|
||||
using UnityEngine.XR.Interaction.Toolkit;
|
||||
|
||||
public class ContinuoslocomotionConfigurator : MonoBehaviour
|
||||
public class ContinuoslocomotionConfigurator : AbstractValueController
|
||||
{
|
||||
public Button turnOffButton;
|
||||
public Button turnOnButton;
|
||||
@@ -21,9 +22,16 @@ public class ContinuoslocomotionConfigurator : MonoBehaviour
|
||||
turnOnButton.onClick.AddListener(enableLocomotion);
|
||||
turnOffButton.onClick.AddListener(disableLocomotion);
|
||||
|
||||
RestoreFromConfig();
|
||||
}
|
||||
|
||||
override public void RestoreFromConfig()
|
||||
{
|
||||
bool isContinuousLocomotion = ConfigManager.instance.GetIsContinuousLocomotion();
|
||||
turnOffButton.gameObject.SetActive(isContinuousLocomotion);
|
||||
turnOnButton.gameObject.SetActive(!isContinuousLocomotion);
|
||||
locomotion.enabled = isContinuousLocomotion;
|
||||
OnLocomotionToggled?.Invoke(isContinuousLocomotion);
|
||||
|
||||
float continuousLocomotionSpeed = ConfigManager.instance.GetContinuousLocomotionSpeed();
|
||||
moveSpeedSlider.SetHandleValue(continuousLocomotionSpeed);
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using UnityEngine.EventSystems;
|
||||
|
||||
public class RegularButtonView : MonoBehaviour, IPointerEnterHandler, IPointerClickHandler
|
||||
{
|
||||
|
||||
public void OnPointerEnter(PointerEventData eventData)
|
||||
{
|
||||
AudioManager.Instance.PlayAttachedInstance(FMODEvents.Instance.Hover, this.gameObject);
|
||||
}
|
||||
public void OnPointerClick(PointerEventData eventData)
|
||||
{
|
||||
AudioManager.Instance.PlayAttachedInstance(FMODEvents.Instance.Click, this.gameObject);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 9c648a319c5c6aa47b3ef152a10657bf
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,20 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using Unity.Burst;
|
||||
using UnityEngine;
|
||||
|
||||
public class RestoreDefaultsController : MonoBehaviour
|
||||
{
|
||||
[SerializeField]
|
||||
public List<AbstractValueController> valueControllers = new List<AbstractValueController>();
|
||||
|
||||
public void OnRestoreDefaults()
|
||||
{
|
||||
ConfigManager.instance.RestoreDefaultConfig();
|
||||
|
||||
foreach (AbstractValueController avc in valueControllers)
|
||||
{
|
||||
avc.RestoreFromConfig();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 1ebe1a3f8ef35a041a8ef39da672dd49
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -1,6 +1,6 @@
|
||||
using UnityEngine;
|
||||
|
||||
public class SliderToVCA : MonoBehaviour
|
||||
public class SliderToVCA : AbstractValueController
|
||||
{
|
||||
public enum VCATarget
|
||||
{
|
||||
@@ -20,12 +20,16 @@ public class SliderToVCA : MonoBehaviour
|
||||
slider.OnValueChanged += ApplyVolume;
|
||||
}
|
||||
private void Start()
|
||||
{
|
||||
RestoreFromConfig();
|
||||
}
|
||||
|
||||
override public void RestoreFromConfig()
|
||||
{
|
||||
float initialValue = GetInitialValue();
|
||||
slider.SetHandleValue(initialValue);
|
||||
}
|
||||
|
||||
|
||||
private float GetInitialValue()
|
||||
{
|
||||
switch (target)
|
||||
|
||||
Reference in New Issue
Block a user