Added Unity project files
This commit is contained in:
@ -0,0 +1,281 @@
|
||||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!114 &11400000
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 0}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: c333ccfdd0cbdbc4ca30cef2dd6e6b9b, type: 3}
|
||||
m_Name: CustomInspectorBehaviour
|
||||
m_EditorClassIdentifier:
|
||||
serializedUdonProgramAsset: {fileID: 11400000, guid: 6562611796b395d4fbdda11913a560e8,
|
||||
type: 2}
|
||||
udonAssembly:
|
||||
assemblyError:
|
||||
sourceCsScript: {fileID: 11500000, guid: d2dd5a191a6cf68419c3a1a422dd2141, type: 3}
|
||||
scriptVersion: 2
|
||||
compiledVersion: 2
|
||||
behaviourSyncMode: 0
|
||||
hasInteractEvent: 0
|
||||
scriptID: 4651369299460707795
|
||||
serializationData:
|
||||
SerializedFormat: 2
|
||||
SerializedBytes:
|
||||
ReferencedUnityObjects: []
|
||||
SerializedBytesString:
|
||||
Prefab: {fileID: 0}
|
||||
PrefabModificationsReferencedUnityObjects: []
|
||||
PrefabModifications: []
|
||||
SerializationNodes:
|
||||
- Name: fieldDefinitions
|
||||
Entry: 7
|
||||
Data: 0|System.Collections.Generic.Dictionary`2[[System.String, mscorlib],[UdonSharp.Compiler.FieldDefinition,
|
||||
UdonSharp.Editor]], mscorlib
|
||||
- Name: comparer
|
||||
Entry: 7
|
||||
Data: 1|System.Collections.Generic.GenericEqualityComparer`1[[System.String,
|
||||
mscorlib]], mscorlib
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
- Name:
|
||||
Entry: 12
|
||||
Data: 4
|
||||
- Name:
|
||||
Entry: 7
|
||||
Data:
|
||||
- Name: $k
|
||||
Entry: 1
|
||||
Data: stringVal
|
||||
- Name: $v
|
||||
Entry: 7
|
||||
Data: 2|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
||||
- Name: <Name>k__BackingField
|
||||
Entry: 1
|
||||
Data: stringVal
|
||||
- Name: <UserType>k__BackingField
|
||||
Entry: 7
|
||||
Data: 3|System.RuntimeType, mscorlib
|
||||
- Name:
|
||||
Entry: 1
|
||||
Data: System.String, mscorlib
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
- Name: <SystemType>k__BackingField
|
||||
Entry: 9
|
||||
Data: 3
|
||||
- Name: <SyncMode>k__BackingField
|
||||
Entry: 7
|
||||
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
|
||||
- Name:
|
||||
Entry: 6
|
||||
Data:
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
- Name: <IsSerialized>k__BackingField
|
||||
Entry: 5
|
||||
Data: true
|
||||
- Name: _fieldAttributes
|
||||
Entry: 7
|
||||
Data: 4|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
|
||||
- Name:
|
||||
Entry: 12
|
||||
Data: 0
|
||||
- Name:
|
||||
Entry: 13
|
||||
Data:
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
- Name:
|
||||
Entry: 7
|
||||
Data:
|
||||
- Name: $k
|
||||
Entry: 1
|
||||
Data: orbitOrigin
|
||||
- Name: $v
|
||||
Entry: 7
|
||||
Data: 5|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
||||
- Name: <Name>k__BackingField
|
||||
Entry: 1
|
||||
Data: orbitOrigin
|
||||
- Name: <UserType>k__BackingField
|
||||
Entry: 7
|
||||
Data: 6|System.RuntimeType, mscorlib
|
||||
- Name:
|
||||
Entry: 1
|
||||
Data: UnityEngine.Vector3, UnityEngine.CoreModule
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
- Name: <SystemType>k__BackingField
|
||||
Entry: 9
|
||||
Data: 6
|
||||
- Name: <SyncMode>k__BackingField
|
||||
Entry: 7
|
||||
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
|
||||
- Name:
|
||||
Entry: 6
|
||||
Data:
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
- Name: <IsSerialized>k__BackingField
|
||||
Entry: 5
|
||||
Data: true
|
||||
- Name: _fieldAttributes
|
||||
Entry: 7
|
||||
Data: 7|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
|
||||
- Name:
|
||||
Entry: 12
|
||||
Data: 0
|
||||
- Name:
|
||||
Entry: 13
|
||||
Data:
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
- Name:
|
||||
Entry: 7
|
||||
Data:
|
||||
- Name: $k
|
||||
Entry: 1
|
||||
Data: childBehaviours
|
||||
- Name: $v
|
||||
Entry: 7
|
||||
Data: 8|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
||||
- Name: <Name>k__BackingField
|
||||
Entry: 1
|
||||
Data: childBehaviours
|
||||
- Name: <UserType>k__BackingField
|
||||
Entry: 7
|
||||
Data: 9|System.RuntimeType, mscorlib
|
||||
- Name:
|
||||
Entry: 1
|
||||
Data: UdonSharp.Examples.Inspectors.CustomInspectorChildBehaviour[], Assembly-CSharp
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
- Name: <SystemType>k__BackingField
|
||||
Entry: 7
|
||||
Data: 10|System.RuntimeType, mscorlib
|
||||
- Name:
|
||||
Entry: 1
|
||||
Data: UnityEngine.Component[], UnityEngine.CoreModule
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
- Name: <SyncMode>k__BackingField
|
||||
Entry: 7
|
||||
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
|
||||
- Name:
|
||||
Entry: 6
|
||||
Data:
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
- Name: <IsSerialized>k__BackingField
|
||||
Entry: 5
|
||||
Data: true
|
||||
- Name: _fieldAttributes
|
||||
Entry: 7
|
||||
Data: 11|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
|
||||
- Name:
|
||||
Entry: 12
|
||||
Data: 0
|
||||
- Name:
|
||||
Entry: 13
|
||||
Data:
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
- Name:
|
||||
Entry: 7
|
||||
Data:
|
||||
- Name: $k
|
||||
Entry: 1
|
||||
Data: stations
|
||||
- Name: $v
|
||||
Entry: 7
|
||||
Data: 12|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
||||
- Name: <Name>k__BackingField
|
||||
Entry: 1
|
||||
Data: stations
|
||||
- Name: <UserType>k__BackingField
|
||||
Entry: 7
|
||||
Data: 13|System.RuntimeType, mscorlib
|
||||
- Name:
|
||||
Entry: 1
|
||||
Data: VRC.SDKBase.VRCStation[], VRCSDKBase
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
- Name: <SystemType>k__BackingField
|
||||
Entry: 7
|
||||
Data: 14|System.RuntimeType, mscorlib
|
||||
- Name:
|
||||
Entry: 1
|
||||
Data: VRC.SDK3.Components.VRCStation[], VRCSDK3
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
- Name: <SyncMode>k__BackingField
|
||||
Entry: 7
|
||||
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
|
||||
- Name:
|
||||
Entry: 6
|
||||
Data:
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
- Name: <IsSerialized>k__BackingField
|
||||
Entry: 5
|
||||
Data: true
|
||||
- Name: _fieldAttributes
|
||||
Entry: 7
|
||||
Data: 15|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
|
||||
- Name:
|
||||
Entry: 12
|
||||
Data: 0
|
||||
- Name:
|
||||
Entry: 13
|
||||
Data:
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
- Name:
|
||||
Entry: 13
|
||||
Data:
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 399f041c3cb27e246ab4aab3fc18dbc9
|
||||
NativeFormatImporter:
|
||||
externalObjects: {}
|
||||
mainObjectFileID: 11400000
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@ -0,0 +1,135 @@
|
||||
|
||||
using UnityEngine;
|
||||
using VRC.SDKBase;
|
||||
|
||||
#if !COMPILER_UDONSHARP && UNITY_EDITOR // These using statements must be wrapped in this check to prevent issues on builds
|
||||
using UnityEditor;
|
||||
using UdonSharpEditor;
|
||||
using System.Linq;
|
||||
#endif
|
||||
|
||||
namespace UdonSharp.Examples.Inspectors
|
||||
{
|
||||
/// <summary>
|
||||
/// Example behaviour that has a custom inspector
|
||||
/// </summary>
|
||||
[AddComponentMenu("Udon Sharp/Inspectors/Custom Inspector Behaviour")]
|
||||
public class CustomInspectorBehaviour : UdonSharpBehaviour
|
||||
{
|
||||
public string stringVal;
|
||||
|
||||
public Vector3 orbitOrigin = new Vector3(0, 3f, 0);
|
||||
|
||||
public CustomInspectorChildBehaviour[] childBehaviours;
|
||||
|
||||
public VRCStation[] stations;
|
||||
}
|
||||
|
||||
// Editor scripts must be wrapped in a UNITY_EDITOR check to prevent issues while uploading worlds. The !COMPILER_UDONSHARP check prevents UdonSharp from throwing errors about unsupported code here.
|
||||
#if !COMPILER_UDONSHARP && UNITY_EDITOR
|
||||
[CustomEditor(typeof(CustomInspectorBehaviour))]
|
||||
public class CustomInspectorEditor : Editor
|
||||
{
|
||||
SerializedProperty stationProperty;
|
||||
|
||||
private void OnEnable()
|
||||
{
|
||||
stationProperty = serializedObject.FindProperty("stations");
|
||||
}
|
||||
|
||||
public override void OnInspectorGUI()
|
||||
{
|
||||
// Draws the default convert to UdonBehaviour button, program asset field, sync settings, etc.
|
||||
if (UdonSharpGUI.DrawDefaultUdonSharpBehaviourHeader(target)) return;
|
||||
|
||||
CustomInspectorBehaviour inspectorBehaviour = (CustomInspectorBehaviour)target;
|
||||
|
||||
//EditorGUILayout.PropertyField(stationProperty, true);
|
||||
//serializedObject.ApplyModifiedProperties();
|
||||
|
||||
EditorGUI.BeginChangeCheck();
|
||||
|
||||
// A simple string field modification with Undo handling
|
||||
string newStrVal = EditorGUILayout.TextField("String Val", inspectorBehaviour.stringVal);
|
||||
|
||||
if (EditorGUI.EndChangeCheck())
|
||||
{
|
||||
Undo.RecordObject(inspectorBehaviour, "Modify string val");
|
||||
|
||||
inspectorBehaviour.stringVal = newStrVal;
|
||||
}
|
||||
|
||||
EditorGUI.BeginDisabledGroup(true);
|
||||
|
||||
EditorGUILayout.Vector3Field("Orbit Origin", inspectorBehaviour.orbitOrigin); // Set via handles in OnSceneGUI
|
||||
|
||||
EditorGUI.EndDisabledGroup();
|
||||
|
||||
EditorGUILayout.Space();
|
||||
|
||||
DrawChildBehaviourControls(inspectorBehaviour);
|
||||
}
|
||||
|
||||
void DrawChildBehaviourControls(CustomInspectorBehaviour inspectorBehaviour)
|
||||
{
|
||||
EditorGUILayout.LabelField($"Child count: {inspectorBehaviour.childBehaviours.Length}");
|
||||
|
||||
if (GUILayout.Button("Add child behaviour"))
|
||||
{
|
||||
GameObject newGameObject = new GameObject("Custom Inspector Child");
|
||||
Undo.RegisterCreatedObjectUndo(newGameObject, "Create child behaviour");
|
||||
newGameObject.transform.SetParent(inspectorBehaviour.transform);
|
||||
|
||||
CustomInspectorChildBehaviour newChild = newGameObject.AddUdonSharpComponent<CustomInspectorChildBehaviour>();
|
||||
|
||||
newChild.parentBehaviour = inspectorBehaviour;
|
||||
newChild.myIndex = inspectorBehaviour.childBehaviours.Length;
|
||||
|
||||
Undo.RecordObject(inspectorBehaviour, "Add child behaviour");
|
||||
inspectorBehaviour.childBehaviours = inspectorBehaviour.childBehaviours.Append(newChild).ToArray();
|
||||
|
||||
// Will recursively apply the child behaviour as well since it is referenced in the childBehaviours array
|
||||
UdonSharpEditorUtility.CopyProxyToUdon(inspectorBehaviour, ProxySerializationPolicy.All);
|
||||
}
|
||||
|
||||
if (GUILayout.Button("Remove child behaviour"))
|
||||
{
|
||||
if (inspectorBehaviour.childBehaviours.Length > 0)
|
||||
{
|
||||
CustomInspectorChildBehaviour child = inspectorBehaviour.childBehaviours.Last();
|
||||
|
||||
Undo.RecordObject(inspectorBehaviour, "Delete child object");
|
||||
inspectorBehaviour.childBehaviours = inspectorBehaviour.childBehaviours.Take(inspectorBehaviour.childBehaviours.Length - 1).ToArray();
|
||||
|
||||
Undo.DestroyObjectImmediate(child.gameObject);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void OnSceneGUI()
|
||||
{
|
||||
CustomInspectorBehaviour inspectorBehaviour = (CustomInspectorBehaviour)target;
|
||||
|
||||
EditorGUI.BeginChangeCheck();
|
||||
Vector3 newTarget = Handles.PositionHandle(inspectorBehaviour.orbitOrigin, Quaternion.identity);
|
||||
Handles.Label(newTarget, "Orbit Origin");
|
||||
|
||||
if (EditorGUI.EndChangeCheck())
|
||||
{
|
||||
Undo.RecordObject(inspectorBehaviour, "Move orbit origin");
|
||||
inspectorBehaviour.orbitOrigin = newTarget;
|
||||
}
|
||||
|
||||
Color oldColor = Handles.color;
|
||||
Handles.color = Color.red;
|
||||
|
||||
foreach (CustomInspectorChildBehaviour child in inspectorBehaviour.childBehaviours)
|
||||
{
|
||||
Handles.DrawWireDisc(child.transform.position, Vector3.up, 0.2f);
|
||||
}
|
||||
|
||||
Handles.color = oldColor;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: d2dd5a191a6cf68419c3a1a422dd2141
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@ -0,0 +1,221 @@
|
||||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!114 &11400000
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 0}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: c333ccfdd0cbdbc4ca30cef2dd6e6b9b, type: 3}
|
||||
m_Name: CustomInspectorChildBehaviour
|
||||
m_EditorClassIdentifier:
|
||||
serializedUdonProgramAsset: {fileID: 11400000, guid: c9c6637606d3059409b8b03a23f09066,
|
||||
type: 2}
|
||||
udonAssembly:
|
||||
assemblyError:
|
||||
sourceCsScript: {fileID: 11500000, guid: ce9257e0368df614686e37923b4f6434, type: 3}
|
||||
scriptVersion: 2
|
||||
compiledVersion: 2
|
||||
behaviourSyncMode: 0
|
||||
hasInteractEvent: 0
|
||||
scriptID: 1752308851656179567
|
||||
serializationData:
|
||||
SerializedFormat: 2
|
||||
SerializedBytes:
|
||||
ReferencedUnityObjects: []
|
||||
SerializedBytesString:
|
||||
Prefab: {fileID: 0}
|
||||
PrefabModificationsReferencedUnityObjects: []
|
||||
PrefabModifications: []
|
||||
SerializationNodes:
|
||||
- Name: fieldDefinitions
|
||||
Entry: 7
|
||||
Data: 0|System.Collections.Generic.Dictionary`2[[System.String, mscorlib],[UdonSharp.Compiler.FieldDefinition,
|
||||
UdonSharp.Editor]], mscorlib
|
||||
- Name: comparer
|
||||
Entry: 7
|
||||
Data: 1|System.Collections.Generic.GenericEqualityComparer`1[[System.String,
|
||||
mscorlib]], mscorlib
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
- Name:
|
||||
Entry: 12
|
||||
Data: 3
|
||||
- Name:
|
||||
Entry: 7
|
||||
Data:
|
||||
- Name: $k
|
||||
Entry: 1
|
||||
Data: parentBehaviour
|
||||
- Name: $v
|
||||
Entry: 7
|
||||
Data: 2|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
||||
- Name: <Name>k__BackingField
|
||||
Entry: 1
|
||||
Data: parentBehaviour
|
||||
- Name: <UserType>k__BackingField
|
||||
Entry: 7
|
||||
Data: 3|System.RuntimeType, mscorlib
|
||||
- Name:
|
||||
Entry: 1
|
||||
Data: UdonSharp.Examples.Inspectors.CustomInspectorBehaviour, Assembly-CSharp
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
- Name: <SystemType>k__BackingField
|
||||
Entry: 7
|
||||
Data: 4|System.RuntimeType, mscorlib
|
||||
- Name:
|
||||
Entry: 1
|
||||
Data: VRC.Udon.UdonBehaviour, VRC.Udon
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
- Name: <SyncMode>k__BackingField
|
||||
Entry: 7
|
||||
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
|
||||
- Name:
|
||||
Entry: 6
|
||||
Data:
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
- Name: <IsSerialized>k__BackingField
|
||||
Entry: 5
|
||||
Data: true
|
||||
- Name: _fieldAttributes
|
||||
Entry: 7
|
||||
Data: 5|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
|
||||
- Name:
|
||||
Entry: 12
|
||||
Data: 0
|
||||
- Name:
|
||||
Entry: 13
|
||||
Data:
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
- Name:
|
||||
Entry: 7
|
||||
Data:
|
||||
- Name: $k
|
||||
Entry: 1
|
||||
Data: myIndex
|
||||
- Name: $v
|
||||
Entry: 7
|
||||
Data: 6|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
||||
- Name: <Name>k__BackingField
|
||||
Entry: 1
|
||||
Data: myIndex
|
||||
- Name: <UserType>k__BackingField
|
||||
Entry: 7
|
||||
Data: 7|System.RuntimeType, mscorlib
|
||||
- Name:
|
||||
Entry: 1
|
||||
Data: System.Int32, mscorlib
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
- Name: <SystemType>k__BackingField
|
||||
Entry: 9
|
||||
Data: 7
|
||||
- Name: <SyncMode>k__BackingField
|
||||
Entry: 7
|
||||
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
|
||||
- Name:
|
||||
Entry: 6
|
||||
Data:
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
- Name: <IsSerialized>k__BackingField
|
||||
Entry: 5
|
||||
Data: true
|
||||
- Name: _fieldAttributes
|
||||
Entry: 7
|
||||
Data: 8|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
|
||||
- Name:
|
||||
Entry: 12
|
||||
Data: 0
|
||||
- Name:
|
||||
Entry: 13
|
||||
Data:
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
- Name:
|
||||
Entry: 7
|
||||
Data:
|
||||
- Name: $k
|
||||
Entry: 1
|
||||
Data: sinHeight
|
||||
- Name: $v
|
||||
Entry: 7
|
||||
Data: 9|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
||||
- Name: <Name>k__BackingField
|
||||
Entry: 1
|
||||
Data: sinHeight
|
||||
- Name: <UserType>k__BackingField
|
||||
Entry: 7
|
||||
Data: 10|System.RuntimeType, mscorlib
|
||||
- Name:
|
||||
Entry: 1
|
||||
Data: System.Single, mscorlib
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
- Name: <SystemType>k__BackingField
|
||||
Entry: 9
|
||||
Data: 10
|
||||
- Name: <SyncMode>k__BackingField
|
||||
Entry: 7
|
||||
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
|
||||
- Name:
|
||||
Entry: 6
|
||||
Data:
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
- Name: <IsSerialized>k__BackingField
|
||||
Entry: 5
|
||||
Data: false
|
||||
- Name: _fieldAttributes
|
||||
Entry: 7
|
||||
Data: 11|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
|
||||
- Name:
|
||||
Entry: 12
|
||||
Data: 0
|
||||
- Name:
|
||||
Entry: 13
|
||||
Data:
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
- Name:
|
||||
Entry: 13
|
||||
Data:
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: c74ec79e4ddf8e344a2fdaca72721d2d
|
||||
NativeFormatImporter:
|
||||
externalObjects: {}
|
||||
mainObjectFileID: 11400000
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@ -0,0 +1,43 @@
|
||||
|
||||
using UdonSharp;
|
||||
using UnityEngine;
|
||||
using VRC.SDKBase;
|
||||
using VRC.Udon;
|
||||
|
||||
#if !COMPILER_UDONSHARP && UNITY_EDITOR
|
||||
using UdonSharpEditor;
|
||||
#endif
|
||||
|
||||
namespace UdonSharp.Examples.Inspectors
|
||||
{
|
||||
[AddComponentMenu("")]
|
||||
public class CustomInspectorChildBehaviour : UdonSharpBehaviour
|
||||
{
|
||||
public CustomInspectorBehaviour parentBehaviour;
|
||||
public int myIndex;
|
||||
|
||||
float sinHeight;
|
||||
|
||||
private void Update()
|
||||
{
|
||||
int totalChildCount = parentBehaviour.childBehaviours.Length;
|
||||
|
||||
float orbitAmount = (myIndex / (float)totalChildCount) * Mathf.PI * 2 + Time.time * 0.4f; // 0.4 rotations per second
|
||||
|
||||
transform.position = parentBehaviour.orbitOrigin + new Vector3(Mathf.Sin(orbitAmount), 0f, Mathf.Cos(orbitAmount));
|
||||
|
||||
sinHeight = Mathf.Sin(orbitAmount);
|
||||
}
|
||||
|
||||
#if !COMPILER_UDONSHARP && UNITY_EDITOR
|
||||
private void OnDrawGizmosSelected()
|
||||
{
|
||||
// RootOnly update will only copy the data for this behaviour from Udon to the proxy
|
||||
UdonSharpEditorUtility.CopyUdonToProxy(this, ProxySerializationPolicy.RootOnly);
|
||||
|
||||
Gizmos.DrawLine(transform.position, transform.position + Vector3.up * sinHeight * 0.6f);
|
||||
Gizmos.DrawCube(transform.position, Vector3.one * 0.2f);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: ce9257e0368df614686e37923b4f6434
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Reference in New Issue
Block a user