// XMLSerializerは配列にデフォルト値をつけると、指定値とデフォルト値の両方を含む配列にしてしまうので public static HS2VRSettings Load(string path) { HS2VRSettings settings = VRSettings.Load <HS2VRSettings>(path); if (settings.KeySets.Count == 0) { settings.KeySets = new List <KeySet> { new KeySet() }; } return(settings); }
public ConfigurableContext() { // We'll keep those always the same _Materials = new DefaultMaterialPalette(); _Settings = HS2VRSettings.Load("VRSettings.xml"); // Set defaults ConfineMouse = true; EnforceDefaultGUIMaterials = false; GUIAlternativeSortingMode = false; GuiLayer = "Default"; GuiFarClipPlane = 1000f; GuiNearClipPlane = -1000f; IgnoreMask = 0; InvisibleLayer = "Ignore Raycast"; PrimaryColor = Color.cyan; SimulateCursor = true; UILayer = "UI"; UILayerMask = LayerMask.GetMask(UILayer); UnitToMeter = 1f; NearClipPlane = 0.1f; PreferredGUI = GUIType.uGUI; }
protected override void OnAwake() { base.OnAwake(); _Settings = (VR.Context.Settings as HS2VRSettings); }