Skip to content

Commit

Permalink
Release 2.0.0-rc.2
Browse files Browse the repository at this point in the history
  • Loading branch information
Release Automat committed Nov 2, 2024
1 parent 70d9427 commit 1bf0927
Show file tree
Hide file tree
Showing 51 changed files with 1,221 additions and 480 deletions.
13 changes: 11 additions & 2 deletions Packages/tlp.udonvoiceutils/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,14 @@
>
> **Create a backup before testing 2.0.0!**
>
> Feel free to give UVU 2.0.0-rc1 a try and create issue tickets if you run into any problems.
> Feel free to give UVU 2.0.0-rc2 a try and create issue tickets if you run into any problems.
> I will get these sorted out before the final release.
>
> Migration from 1.0.x to 2.0.x should not require any additional work
> unless you use custom scripts that interact with UVU components.
> unless you use custom scripts that interact with UVU components or are based on them:
> **UdonVoiceUtils and other scripts based on TLP scripts MUST have a unique ExecutionOrder now!**
> Use the `Tools/TLP/UdonUtils/TLP ExecutionOrder` menu to log the order to the console.
> Please use other TLP based scripts as reference when defining new ExecutionOrder values for your scripts.
[![Total downloads](https://img.shields.io/github/downloads/Guribo/UdonVoiceUtils/total?style=flat-square&logo=appveyor)](https://github.com/Guribo/UdonVoiceUtils/releases)

Expand Down Expand Up @@ -332,6 +335,12 @@ This includes:

All notable changes to this project will be documented in this file.

### [2.0.0-rc.2] - 2024-11-02

#### 🚀 Features

- [**breaking**] Deterministic execution order to address known VRC-bug

### [2.0.0-rc.1] - 2024-08-21

#### 🚀 Features
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: c333ccfdd0cbdbc4ca30cef2dd6e6b9b, type: 3}
m_Name: IgnoredPlayers
m_EditorClassIdentifier:
serializedUdonProgramAsset: {fileID: 11400000, guid: d652cce053ddf484ea051276da9f5b81,
serializedUdonProgramAsset: {fileID: 11400000, guid: 61b942f160390f04598a4228ec5b3ad9,
type: 2}
udonAssembly:
assemblyError:
Expand Down
15 changes: 14 additions & 1 deletion Packages/tlp.udonvoiceutils/Runtime/Core/IgnoredPlayers.cs
Original file line number Diff line number Diff line change
@@ -1,14 +1,27 @@
using TLP.UdonUtils.Runtime;
using JetBrains.Annotations;
using TLP.UdonUtils.Runtime;
using TLP.UdonUtils.Runtime.Extensions;
using TLP.UdonUtils.Runtime.Player;
using UdonSharp;
using UnityEngine;
using VRC.SDK3.Data;
using VRC.SDKBase;

namespace TLP.UdonVoiceUtils.Runtime.Core
{
/// <summary>
/// TODO Use Blacklist instead?
/// </summary>
[UdonBehaviourSyncMode(BehaviourSyncMode.NoVariableSync)]
[DefaultExecutionOrder(ExecutionOrder)]
[TlpDefaultExecutionOrder(typeof(IgnoredPlayers), ExecutionOrder)]
public class IgnoredPlayers : TlpBaseBehaviour
{
protected override int ExecutionOrderReadOnly => ExecutionOrder;

[PublicAPI]
public new const int ExecutionOrder = PlayerBlackList.ExecutionOrder + 1;

#region State
internal readonly DataDictionary IgnoredPlayerIds = new DataDictionary();
#endregion
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public class PlayerAudioConfigurationModel : Model
protected override int ExecutionOrderReadOnly => ExecutionOrder;

[PublicAPI]
public new const int ExecutionOrder = Model.ExecutionOrder;
public new const int ExecutionOrder = Model.ExecutionOrder + 10;

#region Constants
public const int EnvironmentLayerMask = 1 << 11;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ MonoBehaviour:
sourceCsScript: {fileID: 11500000, guid: 26bfbf1b1a5e2e345b13767ec5b829a3, type: 3}
scriptVersion: 2
compiledVersion: 2
behaviourSyncMode: 1
behaviourSyncMode: 2
hasInteractEvent: 0
scriptID: -9019558757475906389
serializationData:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,14 @@ namespace TLP.UdonVoiceUtils.Runtime.Core
{
[RequireComponent(typeof(DummyView))]
[DefaultExecutionOrder(ExecutionOrder)]
[UdonBehaviourSyncMode(BehaviourSyncMode.None)]
[TlpDefaultExecutionOrder(typeof(PlayerAudioController), ExecutionOrder)]
[UdonBehaviourSyncMode(BehaviourSyncMode.NoVariableSync)]
public class PlayerAudioController : Controller
{
protected override int ExecutionOrderReadOnly => ExecutionOrder;

[PublicAPI]
public new const int ExecutionOrder = VoiceUtilsExecutionOrder.AudioStart;
public new const int ExecutionOrder = PlayerOcclusionStrategy.ExecutionOrder + 10;

#region General settings
[Header("General settings")]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -405,7 +405,7 @@ public bool RemovePlayer(VRCPlayerApi playerToRemove) {
return false;
}

bool ignored = LocallyAddedPlayers.Remove(playerToRemove.playerId);
bool unused = LocallyAddedPlayers.Remove(playerToRemove.playerId);
var playerListResult = PlayerSet.RemovePlayer(playerToRemove);
switch (playerListResult) {
case PlayerListResult.Success:
Expand Down Expand Up @@ -474,7 +474,8 @@ public void Refresh() {
bool containsLocal = false;
var localPlayer = Networking.LocalPlayer;

if (!Assert(Utilities.IsValid(localPlayer), "Local player invalid", this)) {
if (!Utilities.IsValid(localPlayer)) {
Error($"{nameof(Refresh)}.{nameof(localPlayer)} invalid");
return;
}

Expand Down Expand Up @@ -531,6 +532,7 @@ public bool ForceNoSynchronization() {
DebugLog(nameof(ForceNoSynchronization));
#endif
#endregion

if (!Initialized) {
Error("Not initialized");
return false;
Expand All @@ -551,6 +553,7 @@ public bool AllowSynchronization() {
DebugLog(nameof(AllowSynchronization));
#endif
#endregion

if (!Initialized) {
Error("Not initialized");

Expand Down Expand Up @@ -684,7 +687,5 @@ internal void ApplyToAffectedPlayers() {
}
}
#endregion


}
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ MonoBehaviour:
sourceCsScript: {fileID: 11500000, guid: 936acf65749e3cc47a2c9a7d679dc33d, type: 3}
scriptVersion: 2
compiledVersion: 2
behaviourSyncMode: 1
behaviourSyncMode: 2
hasInteractEvent: 0
scriptID: 5714018263193312821
serializationData:
Expand Down
29 changes: 13 additions & 16 deletions Packages/tlp.udonvoiceutils/Runtime/Core/PlayerAudioOverrideList.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,21 @@
using TLP.UdonUtils.Runtime;
using TLP.UdonUtils.Runtime.Extensions;
using UdonSharp;
using UnityEngine;
using VRC.SDKBase;

namespace TLP.UdonVoiceUtils.Runtime.Core
{
[UdonBehaviourSyncMode(BehaviourSyncMode.None)]
[UdonBehaviourSyncMode(BehaviourSyncMode.NoVariableSync)]
[DefaultExecutionOrder(ExecutionOrder)]
[TlpDefaultExecutionOrder(typeof(PlayerAudioOverrideList), ExecutionOrder)]
public class PlayerAudioOverrideList : TlpBaseBehaviour
{
protected override int ExecutionOrderReadOnly => ExecutionOrder;

[PublicAPI]
public new const int ExecutionOrder = PlayerAudioOverride.ExecutionOrder + 1;

// start with an initial size of 3
internal PlayerAudioOverride[] PlayerAudioOverrides;
internal PlayerAudioOverride[] TempList;
Expand Down Expand Up @@ -125,28 +133,17 @@ public PlayerAudioOverride Get(int index) {
return null;
}

if (PlayerAudioOverrides == null) {
if (PlayerAudioOverrides.LengthSafe() == 0) {
return null;
}

if (PlayerAudioOverrides.Length == 0) {
return null;
}

if (!Assert(
Overrides <= PlayerAudioOverrides.Length,
"Overrides == PlayerAudioOverrides.Length failed",
this
)) {
if (Overrides > PlayerAudioOverrides.Length) {
Error("Overrides <= PlayerAudioOverrides.Length failed");
return null;
}

Overrides = Consolidate(PlayerAudioOverrides);
if (index < Overrides) {
return PlayerAudioOverrides[index];
}

return null;
return index < Overrides ? PlayerAudioOverrides[index] : null;
}
#endregion

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ MonoBehaviour:
sourceCsScript: {fileID: 11500000, guid: 2d0f84b9d12c3ee40b92e363d3a9efcb, type: 3}
scriptVersion: 2
compiledVersion: 2
behaviourSyncMode: 1
behaviourSyncMode: 2
hasInteractEvent: 0
scriptID: 1328404493635490500
serializationData:
Expand Down
12 changes: 11 additions & 1 deletion Packages/tlp.udonvoiceutils/Runtime/Core/PlayerAudioView.cs
Original file line number Diff line number Diff line change
@@ -1,16 +1,26 @@
using System.Globalization;
using JetBrains.Annotations;
using TLP.UdonUtils.Runtime.DesignPatterns.MVC;
using TLP.UdonVoiceUtils.Runtime.Examples.Microphone;
using UdonSharp;
using UnityEngine;
using UnityEngine.UI;
using VRC.SDKBase;

namespace TLP.UdonVoiceUtils.Runtime.Core
{
[UdonBehaviourSyncMode(BehaviourSyncMode.None)]
[UdonBehaviourSyncMode(BehaviourSyncMode.NoVariableSync)]
[DefaultExecutionOrder(ExecutionOrder)]
[TlpDefaultExecutionOrder(typeof(PlayerAudioView), ExecutionOrder)]
public class PlayerAudioView : View
{

protected override int ExecutionOrderReadOnly => ExecutionOrder;

[PublicAPI]
public new const int ExecutionOrder = View.ExecutionOrder + 100;


#region Ui Elements
#region General Settings
[Header("General Settings")]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: c333ccfdd0cbdbc4ca30cef2dd6e6b9b, type: 3}
m_Name: DefaultPlayerOcclusion
m_EditorClassIdentifier:
serializedUdonProgramAsset: {fileID: 11400000, guid: c9121f1a01ffb2644bfba68490143189,
serializedUdonProgramAsset: {fileID: 11400000, guid: 5da8e1b18d9b1404fbb82605e6d9052a,
type: 2}
udonAssembly:
assemblyError:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,17 @@
using UnityEngine;
using JetBrains.Annotations;
using UnityEngine;

namespace TLP.UdonVoiceUtils.Runtime.Core.PlayerOcclusion
{
[DefaultExecutionOrder(ExecutionOrder)]
[TlpDefaultExecutionOrder(typeof(DefaultPlayerOcclusion), ExecutionOrder)]
public class DefaultPlayerOcclusion : PlayerOcclusionStrategy
{
protected override int ExecutionOrderReadOnly => ExecutionOrder;

[PublicAPI]
public new const int ExecutionOrder = NullPlayerOcclusion.ExecutionOrder + 1;

#region State
private readonly RaycastHit[] _rayHits = new RaycastHit[2];
#endregion
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: c333ccfdd0cbdbc4ca30cef2dd6e6b9b, type: 3}
m_Name: NullPlayerOcclusion
m_EditorClassIdentifier:
serializedUdonProgramAsset: {fileID: 11400000, guid: 805f5cfcf4c61074b83a4a3e4f0fa664,
serializedUdonProgramAsset: {fileID: 11400000, guid: 5a51d5bb7ce0c634788fbfda0d13a9a4,
type: 2}
udonAssembly:
assemblyError:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,18 @@
using UnityEngine;
using JetBrains.Annotations;
using TLP.UdonUtils.Runtime;
using UnityEngine;

namespace TLP.UdonVoiceUtils.Runtime.Core.PlayerOcclusion
{
[DefaultExecutionOrder(ExecutionOrder)]
[TlpDefaultExecutionOrder(typeof(NullPlayerOcclusion), ExecutionOrder)]
public class NullPlayerOcclusion : PlayerOcclusionStrategy
{
protected override int ExecutionOrderReadOnly => ExecutionOrder;

[PublicAPI]
public new const int ExecutionOrder = PlayerOcclusionStrategy.ExecutionOrder + 1;

public override float CalculateOcclusion(
Vector3 listenerHead,
Vector3 direction,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,21 @@
using TLP.UdonUtils.Runtime;
using JetBrains.Annotations;
using TLP.UdonUtils.Runtime;
using UdonSharp;
using UnityEngine;

namespace TLP.UdonVoiceUtils.Runtime.Core.PlayerOcclusion
{
[UdonBehaviourSyncMode(BehaviourSyncMode.NoVariableSync)]
[DefaultExecutionOrder(ExecutionOrder)]
[TlpDefaultExecutionOrder(typeof(PlayerOcclusionStrategy), ExecutionOrder)]
public abstract class PlayerOcclusionStrategy : TlpBaseBehaviour
{
protected override int ExecutionOrderReadOnly => ExecutionOrder;

[PublicAPI]
public new const int ExecutionOrder = TlpExecutionOrder.AudioStart + 100;


/// <param name="listenerHead"></param>
/// <param name="direction"></param>
/// <param name="distance"></param>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public class SyncedPlayerAudioConfigurationModel : PlayerAudioConfigurationModel
protected override int ExecutionOrderReadOnly => ExecutionOrder;

[PublicAPI]
public new const int ExecutionOrder = PlayerAudioConfigurationModel.ExecutionOrder;
public new const int ExecutionOrder = PlayerAudioConfigurationModel.ExecutionOrder + 1;

public override void Start() {
base.Start();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
using System;
using JetBrains.Annotations;
using JetBrains.Annotations;
using TLP.UdonUtils.Runtime.Adapters.Cyan;
using TLP.UdonUtils.Runtime.Common;
using TLP.UdonUtils.Runtime.Extensions;
using TLP.UdonUtils.Runtime.Player;
using TLP.UdonVoiceUtils.Runtime.Core;
using TLP.UdonVoiceUtils.Runtime.Examples;
using UdonSharp;
using UnityEngine;
using VRC.SDKBase;
using VRC.Udon;

namespace TLP.UdonVoiceUtils.Runtime.Debugging
{
Expand All @@ -19,13 +17,12 @@ public class VoiceRangeVisualizer : CyanPooledObject
protected override int ExecutionOrderReadOnly => ExecutionOrder;

[PublicAPI]
public new const int ExecutionOrder = PlayerAudioController.ExecutionOrder + 1;
public new const int ExecutionOrder = VoiceOverrideTriggerZone.ExecutionOrder + 1;

#region State
private TrackingDataFollowerUI _playerFollower;
#endregion


[SerializeField]
private Transform Near;

Expand Down
Loading

0 comments on commit 1bf0927

Please sign in to comment.