-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #70 from SideQuestVR/dev-merge
Dev merge
Showing
28 changed files
with
2,097 additions
and
416 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
using UnityEditor; | ||
using UnityEngine; | ||
using UnityEngine.UIElements; | ||
using Banter.SDK; | ||
|
||
namespace Banter.SDKEditor | ||
{ | ||
[CustomEditor(typeof(BanterGrabHandle))] | ||
public class BanterGrabHandleEditor : Editor | ||
{ | ||
void OnEnable() | ||
{ | ||
if (target is BanterGrabHandle) | ||
{ | ||
var script = (BanterGrabHandle)target; | ||
// script.gameObject.GetComponent<MeshFilter>().hideFlags = HideFlags.HideInInspector; | ||
var path = AssetDatabase.GetAssetPath(script); | ||
} | ||
} | ||
public override bool UseDefaultMargins() => false; | ||
public override VisualElement CreateInspectorGUI() | ||
{ | ||
var script = (BanterGrabHandle)target; | ||
Editor editor = Editor.CreateEditor(script); | ||
// script.gameObject.GetComponent<MeshFilter>().hideFlags = HideFlags.HideInInspector; | ||
VisualElement myInspector = new VisualElement(); | ||
|
||
var _mainWindowStyleSheet = Resources.Load<StyleSheet>("BanterCustomInspector"); | ||
myInspector.styleSheets.Add(_mainWindowStyleSheet); | ||
|
||
var title = new Label("PROPERTIES SEEN BY JS"); | ||
title.style.fontSize = 14; | ||
myInspector.Add(title); | ||
var seeFields = new Label("grabType, grabRadius, "); | ||
seeFields.style.unityFontStyleAndWeight = FontStyle.Bold; | ||
seeFields.style.flexWrap = Wrap.Wrap; | ||
seeFields.style.whiteSpace = WhiteSpace.Normal; | ||
seeFields.style.marginBottom = 10; | ||
seeFields.style.marginTop = 10; | ||
seeFields.style.color = Color.gray; | ||
myInspector.Add(seeFields); | ||
|
||
//#if BANTER_EDITOR | ||
var foldout = new Foldout(); | ||
foldout.text = "Available Properties"; | ||
IMGUIContainer inspectorIMGUI = new IMGUIContainer(() => { editor.OnInspectorGUI(); }); | ||
foldout.value = false; | ||
foldout.Add(inspectorIMGUI); | ||
myInspector.Add(foldout); | ||
//#endif | ||
|
||
return myInspector; | ||
} | ||
} | ||
} |
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,55 @@ | ||
using UnityEditor; | ||
using UnityEngine; | ||
using UnityEngine.UIElements; | ||
using Banter.SDK; | ||
|
||
namespace Banter.SDKEditor | ||
{ | ||
[CustomEditor(typeof(BanterHeldEvents))] | ||
public class BanterHeldEventsEditor : Editor | ||
{ | ||
void OnEnable() | ||
{ | ||
if (target is BanterHeldEvents) | ||
{ | ||
var script = (BanterHeldEvents)target; | ||
// script.gameObject.GetComponent<MeshFilter>().hideFlags = HideFlags.HideInInspector; | ||
var path = AssetDatabase.GetAssetPath(script); | ||
} | ||
} | ||
public override bool UseDefaultMargins() => false; | ||
public override VisualElement CreateInspectorGUI() | ||
{ | ||
var script = (BanterHeldEvents)target; | ||
Editor editor = Editor.CreateEditor(script); | ||
// script.gameObject.GetComponent<MeshFilter>().hideFlags = HideFlags.HideInInspector; | ||
VisualElement myInspector = new VisualElement(); | ||
|
||
var _mainWindowStyleSheet = Resources.Load<StyleSheet>("BanterCustomInspector"); | ||
myInspector.styleSheets.Add(_mainWindowStyleSheet); | ||
|
||
var title = new Label("PROPERTIES SEEN BY JS"); | ||
title.style.fontSize = 14; | ||
myInspector.Add(title); | ||
var seeFields = new Label("sensitivity, fireRate, auto, blockThumbstick, blockPrimary, blockSecondary, blockThumbstickClick, "); | ||
seeFields.style.unityFontStyleAndWeight = FontStyle.Bold; | ||
seeFields.style.flexWrap = Wrap.Wrap; | ||
seeFields.style.whiteSpace = WhiteSpace.Normal; | ||
seeFields.style.marginBottom = 10; | ||
seeFields.style.marginTop = 10; | ||
seeFields.style.color = Color.gray; | ||
myInspector.Add(seeFields); | ||
|
||
//#if BANTER_EDITOR | ||
var foldout = new Foldout(); | ||
foldout.text = "Available Properties"; | ||
IMGUIContainer inspectorIMGUI = new IMGUIContainer(() => { editor.OnInspectorGUI(); }); | ||
foldout.value = false; | ||
foldout.Add(inspectorIMGUI); | ||
myInspector.Add(foldout); | ||
//#endif | ||
|
||
return myInspector; | ||
} | ||
} | ||
} |
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,44 @@ | ||
using UnityEditor; | ||
using UnityEngine; | ||
using UnityEngine.UIElements; | ||
using Banter.SDK; | ||
|
||
namespace Banter.SDKEditor | ||
{ | ||
[CustomEditor(typeof(BanterWorldObject))] | ||
public class BanterWorldObjectEditor : Editor | ||
{ | ||
void OnEnable() | ||
{ | ||
if (target is BanterWorldObject) | ||
{ | ||
var script = (BanterWorldObject)target; | ||
// script.gameObject.GetComponent<MeshFilter>().hideFlags = HideFlags.HideInInspector; | ||
var path = AssetDatabase.GetAssetPath(script); | ||
} | ||
} | ||
public override bool UseDefaultMargins() => false; | ||
public override VisualElement CreateInspectorGUI() | ||
{ | ||
var script = (BanterWorldObject)target; | ||
Editor editor = Editor.CreateEditor(script); | ||
// script.gameObject.GetComponent<MeshFilter>().hideFlags = HideFlags.HideInInspector; | ||
VisualElement myInspector = new VisualElement(); | ||
|
||
var _mainWindowStyleSheet = Resources.Load<StyleSheet>("BanterCustomInspector"); | ||
myInspector.styleSheets.Add(_mainWindowStyleSheet); | ||
|
||
|
||
//#if BANTER_EDITOR | ||
var foldout = new Foldout(); | ||
foldout.text = "Available Properties"; | ||
IMGUIContainer inspectorIMGUI = new IMGUIContainer(() => { editor.OnInspectorGUI(); }); | ||
foldout.value = false; | ||
foldout.Add(inspectorIMGUI); | ||
myInspector.Add(foldout); | ||
//#endif | ||
|
||
return myInspector; | ||
} | ||
} | ||
} |
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
Oops, something went wrong.