Skip to content

Commit

Permalink
Refactor & integrate documentation links to inspector
Browse files Browse the repository at this point in the history
  • Loading branch information
JLChnToZ committed Jan 8, 2024
1 parent f9131fc commit 64fba2a
Show file tree
Hide file tree
Showing 13 changed files with 16 additions and 5 deletions.
8 changes: 3 additions & 5 deletions Packages/idv.jlchntoz.vvmw/Editor/VVMW/CoreEditor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -434,11 +434,9 @@ static void DrawShaderPropertiesField(SerializedProperty property, GUIContent la

public static bool AddTarget(Core core, UnityObject newTarget, bool recordUndo = true, bool copyToUdon = false) {
using (var so = new SerializedObject(core)) {
if (newTarget is AudioSource) {
var audioSourcesProperty = so.FindProperty("audioSources");
var index = audioSourcesProperty.arraySize++;
audioSourcesProperty.GetArrayElementAtIndex(index).objectReferenceValue = newTarget;
} else if (!AppendScreen(
if (newTarget is AudioSource)
AppendElement(so.FindProperty("audioSources"), newTarget);
else if (!AppendScreen(
newTarget,
so.FindProperty("screenTargets"),
so.FindProperty("screenTargetModes"),
Expand Down
1 change: 1 addition & 0 deletions Packages/idv.jlchntoz.vvmw/Runtime/I18N/LanguageManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ namespace JLChnToZ.VRC.VVMW.I18N {
[UdonBehaviourSyncMode(BehaviourSyncMode.NoVariableSync)]
[AddComponentMenu("VizVid/Locales/Language Manager")]
[DefaultExecutionOrder(0)]
[HelpURL("https://github.com/JLChnToZ/VVMW/blob/main/Packages/idv.jlchntoz.vvmw/README.md#locale")]
public class LanguageManager : UdonSharpEventSender {
[SerializeField] TextAsset[] languageJsonFiles;
[SerializeField, Multiline] string languageJson;
Expand Down
1 change: 1 addition & 0 deletions Packages/idv.jlchntoz.vvmw/Runtime/VVMW/AutoPlayOnNear.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
namespace JLChnToZ.VRC.VVMW {
[UdonBehaviourSyncMode(BehaviourSyncMode.NoVariableSync)]
[AddComponentMenu("VizVid/Components/Auto Play On Near")]
[HelpURL("https://github.com/JLChnToZ/VVMW/blob/main/Packages/idv.jlchntoz.vvmw/README.md#how-to-setup-auto-plays-when-a-user-goes-nearby")]
public class AutoPlayOnNear : VizVidBehaviour {
[SerializeField, Locatable] FrontendHandler handler;
[Tooltip("The distance to trigger the video, set to 0 to disable")]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ namespace JLChnToZ.VRC.VVMW {
[UdonBehaviourSyncMode(BehaviourSyncMode.NoVariableSync)]
[AddComponentMenu("VizVid/Components/BGM Volume Control")]
[RequireComponent(typeof(AudioSource))]
[HelpURL("https://github.com/JLChnToZ/VVMW/blob/main/Packages/idv.jlchntoz.vvmw/README.md#how-to-make-background-music-fade-out-when-video-is-playing")]
public class BGMVolumeControl : VizVidBehaviour {
AudioSource audioSource;
[SerializeField, Locatable, BindUdonSharpEvent] Core core;
Expand Down
1 change: 1 addition & 0 deletions Packages/idv.jlchntoz.vvmw/Runtime/VVMW/Core.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ namespace JLChnToZ.VRC.VVMW {
[DisallowMultipleComponent]
[AddComponentMenu("VizVid/Core")]
[DefaultExecutionOrder(0)]
[HelpURL("https://github.com/JLChnToZ/VVMW/blob/main/Packages/idv.jlchntoz.vvmw/README.md#vvmw-game-object")]
public class Core : UdonSharpEventSender {
const byte IDLE = 0, LOADING = 1, PLAYING = 2, PAUSED = 3;
[HideInInspector, SerializeField] string[] trustedUrlDomains = new string[0]; // This list will be fetched on build, via VRChat SDK
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ namespace JLChnToZ.VRC.VVMW.Designer {
[EditorOnly]
[ExecuteInEditMode]
[AddComponentMenu("VizVid/Color Configurator/Color Config")]
[HelpURL("https://github.com/JLChnToZ/VVMW/blob/main/Packages/idv.jlchntoz.vvmw/README.md#how-to-change-color")]
public class ColorConfig : MonoBehaviour {
public Color[] colors;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ namespace JLChnToZ.VRC.VVMW.Designer {
[EditorOnly]
[RequireComponent(typeof(Button))]
[AddComponentMenu("VizVid/Color Configurator/Resync Button")]
[HelpURL("https://github.com/JLChnToZ/VVMW/blob/main/Packages/idv.jlchntoz.vvmw/README.md#how-to-add-a-resync-button")]
public class ResyncButtonConfigurator : MonoBehaviour {
[Locatable(
InstaniatePrefabPath = "Packages/idv.jlchntoz.vvmw/VVMW (No Controls).prefab",
Expand Down
1 change: 1 addition & 0 deletions Packages/idv.jlchntoz.vvmw/Runtime/VVMW/FrontendHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ namespace JLChnToZ.VRC.VVMW {
[DisallowMultipleComponent]
[AddComponentMenu("VizVid/Frontend Handler")]
[DefaultExecutionOrder(1)]
[HelpURL("https://github.com/JLChnToZ/VVMW/blob/main/Packages/idv.jlchntoz.vvmw/README.md#play-list-queue-handler")]
public class FrontendHandler : UdonSharpEventSender {
protected const byte NONE = 0, REPEAT_ONE = 0x1, REPEAT_ALL = 0x2, SHUFFLE = 0x4;
[SerializeField, Locatable, BindUdonSharpEvent, SingletonCoreControl] public Core core;
Expand Down
1 change: 1 addition & 0 deletions Packages/idv.jlchntoz.vvmw/Runtime/VVMW/OverlayControl.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ namespace JLChnToZ.VRC.VVMW {
[DisallowMultipleComponent]
[AddComponentMenu("VizVid/Components/Overlay Control")]
[DefaultExecutionOrder(2)]
[HelpURL("https://github.com/JLChnToZ/VVMW/blob/main/Packages/idv.jlchntoz.vvmw/README.md#how-to-add-an-overlay-control")]
public class OverlayControl : VizVidBehaviour {
Quaternion leftHandRotation = Quaternion.Euler(-90, -45, 0);
Quaternion rightHandRotation = Quaternion.Euler(90, -45, 180);
Expand Down
1 change: 1 addition & 0 deletions Packages/idv.jlchntoz.vvmw/Runtime/VVMW/PickupPanel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ namespace JLChnToZ.VRC.VVMW.Pickups {
[RequireComponent(typeof(VRC_Pickup))]
[DisallowMultipleComponent]
[AddComponentMenu("VizVid/Components/Pickup Panel")]
[HelpURL("https://github.com/JLChnToZ/VVMW/blob/main/Packages/idv.jlchntoz.vvmw/README.md#how-to-add-a-pickupable-screen")]
public class PickupPanel : UdonSharpBehaviour {
[Header("References")]
[SerializeField] Transform scalingTarget;
Expand Down
1 change: 1 addition & 0 deletions Packages/idv.jlchntoz.vvmw/Runtime/VVMW/UIHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ namespace JLChnToZ.VRC.VVMW {
[DisallowMultipleComponent]
[AddComponentMenu("VizVid/UI Handler")]
[DefaultExecutionOrder(2)]
[HelpURL("https://github.com/JLChnToZ/VVMW/blob/main/Packages/idv.jlchntoz.vvmw/README.md#default-ui--screen-with-overlay")]
public class UIHandler : VizVidBehaviour {
[Header("Main Reference")]
[SerializeField, Locatable(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ namespace JLChnToZ.VRC.VVMW {
[DisallowMultipleComponent]
[AddComponentMenu("VizVid/Components/Video Player Handler")]
[DefaultExecutionOrder(0)]
[HelpURL("https://github.com/JLChnToZ/VVMW/blob/main/Packages/idv.jlchntoz.vvmw/README.md#builtin-module--avpro-module")]
public class VideoPlayerHandler : UdonSharpBehaviour {
string[] rtspVaildProtocols = new string[] { "rtsp", "rtmp", "rtspt", "rtspu", "rtmps", "rtsps" };
[NonSerialized] public Core core;
Expand Down
2 changes: 2 additions & 0 deletions Packages/idv.jlchntoz.vvmw/Runtime/VVMW/VizVidBehaviour.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
using UdonSharp;
using UnityEngine;

namespace JLChnToZ.VRC.VVMW {
// A base class that come with a nice branded inspector.
[HelpURL("https://github.com/JLChnToZ/VVMW/blob/main/Packages/idv.jlchntoz.vvmw/README.md")]
public abstract class VizVidBehaviour : UdonSharpBehaviour {}
}

0 comments on commit 64fba2a

Please sign in to comment.