-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
15 changed files
with
339 additions
and
135 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
using Innoactive.Creator.XRInteraction; | ||
using Innoactive.CreatorEditor.UI; | ||
using Innoactive.CreatorEditor.XRInteraction; | ||
using UnityEditor; | ||
using UnityEngine; | ||
using UnityEngine.UIElements; | ||
|
||
internal class SnapZoneSettingsProvider : SettingsProvider | ||
{ | ||
const string Path = "Project/Creator/Snap Zones"; | ||
|
||
private Editor editor; | ||
|
||
public SnapZoneSettingsProvider() : base(Path, SettingsScope.Project) {} | ||
|
||
public override void OnGUI(string searchContext) | ||
{ | ||
EditorGUILayout.Space(); | ||
GUIStyle labelStyle = CreatorEditorStyles.ApplyPadding(CreatorEditorStyles.Paragraph, 0); | ||
GUILayout.Label("These settings help you to configure Snap Zones within your scenes. You can define colors and other values that will be set to Snap Zones created by clicking the 'Create Snap Zone' button of a Snappable Property.", labelStyle); | ||
EditorGUILayout.Space(); | ||
|
||
editor.OnInspectorGUI(); | ||
|
||
EditorGUILayout.Space(20f); | ||
|
||
if (GUILayout.Button("Apply settings in current scene")) | ||
{ | ||
SnapZone[] snapZones = Resources.FindObjectsOfTypeAll<SnapZone>(); | ||
|
||
foreach (SnapZone snapZone in snapZones) | ||
{ | ||
SnapZoneSettings.Instance.ApplySettingsToSnapZone(snapZone); | ||
} | ||
} | ||
} | ||
|
||
public override void OnActivate(string searchContext, VisualElement rootElement) | ||
{ | ||
editor = Editor.CreateEditor(SnapZoneSettings.Instance); | ||
} | ||
|
||
[SettingsProvider] | ||
public static SettingsProvider Provider() | ||
{ | ||
SettingsProvider provider = new SnapZoneSettingsProvider(); | ||
return provider; | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
using System.Runtime.CompilerServices; | ||
|
||
[assembly: InternalsVisibleTo("Innoactive.CreatorEditor.XRInteraction")] |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.