Skip to content

Commit 83bb506

Browse files
author
Release Automat
committed
Release 4.0.0
1 parent 336964b commit 83bb506

56 files changed

Lines changed: 17256 additions & 60536 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2023 Guribo
3+
Copyright (c) 2025 Guribo
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

Packages/tlp.udonvoiceutils/Editor/Inspectors/PlayerAudioControllerEditor.cs

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
#if !COMPILER_UDONSHARP && UNITY_EDITOR
22
using System;
33
using System.Collections.Generic;
4-
using System.Linq;
54
using TLP.UdonUtils.Runtime.Common;
5+
using TLP.UdonVoiceUtils.Editor.Core;
66
using TLP.UdonVoiceUtils.Runtime.Core;
77
using UdonSharp;
88
using UdonSharpEditor;
@@ -11,19 +11,20 @@
1111
using UnityEngine.SceneManagement;
1212
using VRC.SDKBase;
1313
using VRC.Udon;
14-
using VRC.Udon.Serialization.OdinSerializer.Utilities;
1514

1615
namespace TLP.UdonVoiceUtils.Editor.Inspectors
1716
{
1817
[CustomEditor(typeof(PlayerAudioController))]
19-
public class PlayerAudioControllerEditor : UnityEditor.Editor
18+
public class PlayerAudioControllerEditor : TlpBehaviourEditor
2019
{
2120
private readonly HashSet<PlayerAudioOverride> _relevantBehaviours =
2221
new HashSet<PlayerAudioOverride>();
2322

24-
public override void OnInspectorGUI() {
25-
UdonSharpGUI.DrawDefaultUdonSharpBehaviourHeader(target);
26-
DrawDefaultInspector();
23+
protected override string GetDescription() {
24+
return "Main controller for any player audio override. Only one allowed per scene/world. " +
25+
"Can be disabled to turn of all effects (resets every player to configured default). " +
26+
"Can provide global effects (configurable via PlayerAudioConfigurationModels). " +
27+
"Can be used to tweak performance and quality of audio effects.";
2728
}
2829

2930
public void OnSceneGUI() {
@@ -76,12 +77,15 @@ private void UpdateRelevantBehaviours() {
7677
_relevantBehaviours.Clear();
7778

7879
var rootGameObjects = SceneManager.GetActiveScene().GetRootGameObjects();
79-
Debug.Log($"Roots: {rootGameObjects.Count()}");
80+
#if TLP_DEBUG
81+
Debug.Log($"Roots: {rootGameObjects.Length}");
82+
#endif
8083

8184
foreach (var rootGameObject in rootGameObjects) {
8285
var udonBehaviours = rootGameObject.GetComponentsInChildren<UdonBehaviour>();
83-
Debug.Log($"{rootGameObject.transform.GetPathInScene()}: {udonBehaviours.Count()}");
84-
86+
#if TLP_DEBUG
87+
Debug.Log($"{rootGameObject.transform.GetPathInScene()}: {udonBehaviours.Length}");
88+
#endif
8589
foreach (var udonBehaviour in udonBehaviours) {
8690
try {
8791
var udonSharpBehaviour = UdonSharpEditorUtility.GetProxyBehaviour(udonBehaviour);
@@ -106,8 +110,9 @@ private void UpdateRelevantBehaviours() {
106110
}
107111
}
108112
}
109-
113+
#if TLP_DEBUG
110114
Debug.Log($"{nameof(_relevantBehaviours)}: {_relevantBehaviours.Count}");
115+
#endif
111116
}
112117

113118
private void HandleInput(Event guiEvent, UdonSharpBehaviour destination) {

Packages/tlp.udonvoiceutils/Editor/Inspectors/VoiceOverrideDoorEditor.cs

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,19 @@
1+
using TLP.UdonVoiceUtils.Editor.Core;
12
using TLP.UdonVoiceUtils.Runtime.Examples;
2-
using UdonSharpEditor;
33
using UnityEditor;
44
using UnityEngine;
55
using VRC.SDKBase;
66

77
namespace TLP.UdonVoiceUtils.Editor.Inspectors
88
{
99
[CustomEditor(typeof(VoiceOverrideDoor))]
10-
public class VoiceOverrideDoorEditor : UnityEditor.Editor
10+
public class VoiceOverrideDoorEditor : TlpBehaviourEditor
1111
{
12-
public override void OnInspectorGUI() {
13-
UdonSharpGUI.DrawDefaultUdonSharpBehaviourHeader(target);
14-
DrawDefaultInspector();
12+
protected override string GetDescription() {
13+
return "Example implementation of a door which adds a player to " +
14+
"a PlayerAudioOverride upon entering a room. " +
15+
"This works by checking player-trigger interactions with the doors box collider (trigger) " +
16+
"when the player walks through the door.";
1517
}
1618

1719
public void OnSceneGUI() {

Packages/tlp.udonvoiceutils/Editor/Inspectors/VoiceOverrideRoomEditor.cs

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
using System.Collections.Generic;
2+
using TLP.UdonVoiceUtils.Editor.Core;
23
using TLP.UdonVoiceUtils.Runtime.Examples;
34
using UdonSharp;
45
using UdonSharpEditor;
@@ -10,16 +11,24 @@
1011
namespace TLP.UdonVoiceUtils.Editor.Inspectors
1112
{
1213
[CustomEditor(typeof(VoiceOverrideRoom))]
13-
public class VoiceOverrideRoomEditor : UnityEditor.Editor
14+
public class VoiceOverrideRoomEditor : TlpBehaviourEditor
1415
{
1516
private readonly HashSet<UdonSharpBehaviour> _relevantBehaviours = new HashSet<UdonSharpBehaviour>();
1617

17-
private int refreshInterval = 60;
18+
private const int RefreshInterval = 60;
1819
private int _refreshCount;
1920

20-
public override void OnInspectorGUI() {
21-
UdonSharpGUI.DrawDefaultUdonSharpBehaviourHeader(target);
22-
DrawDefaultInspector();
21+
protected override string GetDescription() {
22+
return "Example script using a PlayerAudioOverride to define a space/zone in which every player " +
23+
"has specific audio/voice properties. " +
24+
"Players must be added explicitly through other scripts (e.g. VoiceOverrideDoor). " +
25+
"All added players are automatically synchronized over the network.\n\n" +
26+
"Note: please make sure that if the room is a physical space, that players can only enter/exit " +
27+
"through means (e.g. VoiceOverrideDoor) that add/remove players from the VoiceOverrideRoom!\n\n" +
28+
"Use cases: rooms, vehicles (cockpits), " +
29+
"spaces with complex geometry (not suited for trigger based zones).\n\n" +
30+
"Pitfall: players being carried by other players (station on avatar) will not be added to a room " +
31+
"when the carrying player uses e.g. the example VoiceOverrideRoomEnter-/ExitButton scripts.";
2332
}
2433

2534
public void OnSceneGUI() {
@@ -35,7 +44,7 @@ public void OnSceneGUI() {
3544
case EventType.Repaint:
3645
{
3746
// draw lines to each connected element
38-
_refreshCount = (_refreshCount + 1) % refreshInterval;
47+
_refreshCount = (_refreshCount + 1) % RefreshInterval;
3948
if (_refreshCount == 0) {
4049
UpdateRelevantBehaviours(voiceOverrideRoom);
4150
}

Packages/tlp.udonvoiceutils/Editor/Inspectors/VoiceOverrideRoomEnterButtonEditor.cs

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,19 @@
1+
using TLP.UdonVoiceUtils.Editor.Core;
12
using TLP.UdonVoiceUtils.Runtime.Examples;
2-
using UdonSharpEditor;
33
using UnityEditor;
44
using UnityEngine;
55
using VRC.SDKBase;
66

77
namespace TLP.UdonVoiceUtils.Editor.Inspectors
88
{
99
[CustomEditor(typeof(VoiceOverrideRoomEnterButton))]
10-
public class VoiceOverrideEnterButtonEditor : UnityEditor.Editor
10+
public class VoiceOverrideEnterButtonEditor : TlpBehaviourEditor
1111
{
12-
public override void OnInspectorGUI() {
13-
UdonSharpGUI.DrawDefaultUdonSharpBehaviourHeader(target);
14-
DrawDefaultInspector();
12+
protected override string GetDescription() {
13+
return "Example implementation of a door which adds a player to " +
14+
"a VoiceOverrideRoom when interacting with the button.\n\n" +
15+
"Pitfall: If the entering player carries another player, " +
16+
"then that player will not be added to the VoiceOverrideRoom!";
1517
}
1618

1719
public void OnSceneGUI() {

Packages/tlp.udonvoiceutils/Editor/Inspectors/VoiceOverrideRoomExitButtonEditor.cs

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,19 @@
1+
using TLP.UdonVoiceUtils.Editor.Core;
12
using TLP.UdonVoiceUtils.Runtime.Examples;
2-
using UdonSharpEditor;
33
using UnityEditor;
44
using UnityEngine;
55
using VRC.SDKBase;
66

77
namespace TLP.UdonVoiceUtils.Editor.Inspectors
88
{
99
[CustomEditor(typeof(VoiceOverrideRoomExitButton))]
10-
public class VoiceOverrideRoomExitButtonEditor : UnityEditor.Editor
10+
public class VoiceOverrideRoomExitButtonEditor : TlpBehaviourEditor
1111
{
12-
public override void OnInspectorGUI() {
13-
UdonSharpGUI.DrawDefaultUdonSharpBehaviourHeader(target);
14-
DrawDefaultInspector();
12+
protected override string GetDescription() {
13+
return "Example implementation of a door which removes a player from " +
14+
"a VoiceOverrideRoom when interacting with the button.\n\n" +
15+
"Pitfall: If the entering player carries another player, " +
16+
"then that player will not be removed from the VoiceOverrideRoom!";
1517
}
1618

1719
public void OnSceneGUI() {

Packages/tlp.udonvoiceutils/LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2023 Guribo
3+
Copyright (c) 2025 Guribo
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

0 commit comments

Comments
 (0)