Skip to content

Commit

Permalink
Release 8.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Release Automat committed May 25, 2024
1 parent 0ce3a65 commit bf10fe5
Show file tree
Hide file tree
Showing 236 changed files with 30,721 additions and 545 deletions.
21 changes: 19 additions & 2 deletions Packages/tlp.udonutils/Editor/Tests/TestWithLogger.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
using System.Text.RegularExpressions;
using JetBrains.Annotations;
using NUnit.Framework;
using TLP.UdonUtils.Logger;
using TLP.UdonUtils.Tests.Utils;
using TLP.UdonUtils.Runtime.Logger;
using TLP.UdonUtils.Runtime.Tests.Utils;
using UnityEditor;
using UnityEngine;
using UnityEngine.SceneManagement;
Expand Down Expand Up @@ -138,5 +138,22 @@ public void AreApproximatelyEqual(Vector3 a, Vector3 b, float delta = 1e-5f) {
if (!ok) Debug.LogError($"{a} != {b}");
}
}

/// <summary>
/// Yields null in edit mode test until the give amount of time has elapsed (realtime)
/// </summary>
/// <code>
/// // Example usage:
/// yield return EditorTestWaitForSeconds(2);
/// </code>
/// <param name="duration"></param>
/// <returns>yield return null</returns>
public static IEnumerator EditorTestWaitForSeconds(float duration) {
Debug.Assert(!Application.isPlaying, "Use WaitForSeconds instead in PlaymodeTests");
float time = Time.realtimeSinceStartup;
while (Time.realtimeSinceStartup - time < duration) {
yield return null;
}
}
}
}
12 changes: 12 additions & 0 deletions Packages/tlp.udonutils/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,18 @@ The used pattern MAJOR.MINOR.PATCH indicates:

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

### [8.0.0] - 2024-05-25

#### 🚀 Features

- Add Stopwatch TimeSource
- *(TimeSource)* [**breaking**] Custom ntp servertime synchronization, move Runtime files to TLP.UdonUtils.Runtime namespace
- Add quaternion compression utils

#### 🚜 Refactor

- Remove unused code

### [7.0.0] - 2024-05-16

#### 🚀 Features
Expand Down
18 changes: 12 additions & 6 deletions Packages/tlp.udonutils/Runtime/Adapters/Cyan/CyanPoolAdapter.asset
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ MonoBehaviour:
compiledVersion: 2
behaviourSyncMode: 1
hasInteractEvent: 0
scriptID: 638003357138352276
scriptID: 3490165456808884842
serializationData:
SerializedFormat: 2
SerializedBytes:
Expand Down Expand Up @@ -136,7 +136,7 @@ MonoBehaviour:
Data: 8|System.RuntimeType, mscorlib
- Name:
Entry: 1
Data: TLP.UdonUtils.Logger.ELogLevel, TLP.UdonUtils.Runtime
Data: TLP.UdonUtils.Runtime.Logger.ELogLevel, TLP.UdonUtils.Runtime
- Name:
Entry: 8
Data:
Expand Down Expand Up @@ -325,7 +325,7 @@ MonoBehaviour:
Data: 19|System.RuntimeType, mscorlib
- Name:
Entry: 1
Data: TLP.UdonUtils.Logger.TlpLogger, TLP.UdonUtils.Runtime
Data: TLP.UdonUtils.Runtime.Logger.TlpLogger, TLP.UdonUtils.Runtime
- Name:
Entry: 8
Data:
Expand Down Expand Up @@ -571,13 +571,13 @@ MonoBehaviour:
Data:
- Name: $k
Entry: 1
Data: cyanPlayerObjectAssigner
Data: CyanPlayerObjectAssigner
- Name: $v
Entry: 7
Data: 37|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField
Entry: 1
Data: cyanPlayerObjectAssigner
Data: CyanPlayerObjectAssigner
- Name: <UserType>k__BackingField
Entry: 7
Data: 38|System.RuntimeType, mscorlib
Expand Down Expand Up @@ -607,7 +607,13 @@ MonoBehaviour:
Data: 39|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
- Name:
Entry: 12
Data: 0
Data: 1
- Name:
Entry: 7
Data: 40|UnityEngine.Serialization.FormerlySerializedAsAttribute, UnityEngine.CoreModule
- Name:
Entry: 8
Data:
- Name:
Entry: 13
Data:
Expand Down
42 changes: 32 additions & 10 deletions Packages/tlp.udonutils/Runtime/Adapters/Cyan/CyanPoolAdapter.cs
Original file line number Diff line number Diff line change
@@ -1,11 +1,17 @@
using Cyan.PlayerObjectPool;
using JetBrains.Annotations;
using TLP.UdonUtils.Runtime.Extensions;
using UdonSharp;
using UnityEngine;
using UnityEngine.Serialization;
using VRC.SDKBase;

namespace TLP.UdonUtils.Adapters.Cyan
namespace TLP.UdonUtils.Runtime.Adapters.Cyan
{
/// <summary>
/// Adapter that allows retrieving objects from the CyanPlayerObjectPool
/// with having to reference it directly.
/// </summary>
[UdonBehaviourSyncMode(BehaviourSyncMode.None)]
[DefaultExecutionOrder(ExecutionOrder)]
public class CyanPoolAdapter : TlpBaseBehaviour
Expand All @@ -16,30 +22,46 @@ public class CyanPoolAdapter : TlpBaseBehaviour
[PublicAPI]
public new const int ExecutionOrder = TlpExecutionOrder.DefaultEnd;

public CyanPlayerObjectAssigner cyanPlayerObjectAssigner;
[FormerlySerializedAs("cyanPlayerObjectAssigner")]
public CyanPlayerObjectAssigner CyanPlayerObjectAssigner;

public virtual Component[] PooledUdon() {
#region TLP_DEBUG
#if TLP_DEBUG
DebugLog(nameof(PooledUdon));
if (Utilities.IsValid(cyanPlayerObjectAssigner)) {
return cyanPlayerObjectAssigner.pooledUdon;
#endif
#endregion

if (Utilities.IsValid(CyanPlayerObjectAssigner)) {
return CyanPlayerObjectAssigner.pooledUdon;
}

return new Component[0];
}

public virtual Component GetPlayerPooledUdon(VRCPlayerApi player) {
DebugLog($"{nameof(GetPlayerPooledUdon)} ({player.displayName})");
if (Utilities.IsValid(cyanPlayerObjectAssigner)) {
return cyanPlayerObjectAssigner._GetPlayerPooledUdon(player);
#region TLP_DEBUG
#if TLP_DEBUG
DebugLog($"{nameof(GetPlayerPooledUdon)} for player {player.ToStringSafe()}");
#endif
#endregion

if (Utilities.IsValid(CyanPlayerObjectAssigner)) {
return CyanPlayerObjectAssigner._GetPlayerPooledUdon(player);
}

return null;
}

public virtual GameObject GetPlayerPooledObject(VRCPlayerApi player) {
DebugLog($"{nameof(GetPlayerPooledObject)} ({player.displayName})");
if (Utilities.IsValid(cyanPlayerObjectAssigner)) {
return cyanPlayerObjectAssigner._GetPlayerPooledObject(player);
#region TLP_DEBUG
#if TLP_DEBUG
DebugLog($"{nameof(GetPlayerPooledObject)} for player {player.ToStringSafe()}");
#endif
#endregion

if (Utilities.IsValid(CyanPlayerObjectAssigner)) {
return CyanPlayerObjectAssigner._GetPlayerPooledObject(player);
}

return null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ MonoBehaviour:
compiledVersion: 2
behaviourSyncMode: 0
hasInteractEvent: 0
scriptID: -3871403792360827452
scriptID: -3380246762151393710
serializationData:
SerializedFormat: 2
SerializedBytes:
Expand Down Expand Up @@ -136,7 +136,7 @@ MonoBehaviour:
Data: 8|System.RuntimeType, mscorlib
- Name:
Entry: 1
Data: TLP.UdonUtils.Logger.ELogLevel, TLP.UdonUtils.Runtime
Data: TLP.UdonUtils.Runtime.Logger.ELogLevel, TLP.UdonUtils.Runtime
- Name:
Entry: 8
Data:
Expand Down Expand Up @@ -325,7 +325,7 @@ MonoBehaviour:
Data: 19|System.RuntimeType, mscorlib
- Name:
Entry: 1
Data: TLP.UdonUtils.Logger.TlpLogger, TLP.UdonUtils.Runtime
Data: TLP.UdonUtils.Runtime.Logger.TlpLogger, TLP.UdonUtils.Runtime
- Name:
Entry: 8
Data:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
using VRC.SDKBase;
using VRC.Udon;

namespace TLP.UdonUtils.Adapters.Cyan
namespace TLP.UdonUtils.Runtime.Adapters.Cyan
{
public class CyanPoolEventListener : TlpBaseBehaviour
{
Expand Down
32 changes: 19 additions & 13 deletions Packages/tlp.udonutils/Runtime/Adapters/Cyan/CyanPooledObject.asset
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ MonoBehaviour:
compiledVersion: 2
behaviourSyncMode: 0
hasInteractEvent: 0
scriptID: -4400628871536747571
scriptID: 8873734069264360041
serializationData:
SerializedFormat: 2
SerializedBytes:
Expand Down Expand Up @@ -136,7 +136,7 @@ MonoBehaviour:
Data: 8|System.RuntimeType, mscorlib
- Name:
Entry: 1
Data: TLP.UdonUtils.Logger.ELogLevel, TLP.UdonUtils.Runtime
Data: TLP.UdonUtils.Runtime.Logger.ELogLevel, TLP.UdonUtils.Runtime
- Name:
Entry: 8
Data:
Expand Down Expand Up @@ -325,7 +325,7 @@ MonoBehaviour:
Data: 19|System.RuntimeType, mscorlib
- Name:
Entry: 1
Data: TLP.UdonUtils.Logger.TlpLogger, TLP.UdonUtils.Runtime
Data: TLP.UdonUtils.Runtime.Logger.TlpLogger, TLP.UdonUtils.Runtime
- Name:
Entry: 8
Data:
Expand Down Expand Up @@ -571,25 +571,25 @@ MonoBehaviour:
Data:
- Name: $k
Entry: 1
Data: Owner
Data: CyanPoolAdapter
- Name: $v
Entry: 7
Data: 37|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField
Entry: 1
Data: Owner
Data: CyanPoolAdapter
- Name: <UserType>k__BackingField
Entry: 7
Data: 38|System.RuntimeType, mscorlib
- Name:
Entry: 1
Data: VRC.SDKBase.VRCPlayerApi, VRCSDKBase
Data: TLP.UdonUtils.Runtime.Adapters.Cyan.CyanPoolAdapter, TLP.UdonUtils.Runtime
- Name:
Entry: 8
Data:
- Name: <SystemType>k__BackingField
Entry: 9
Data: 38
Data: 20
- Name: <SyncMode>k__BackingField
Entry: 7
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
Expand All @@ -610,7 +610,7 @@ MonoBehaviour:
Data: 1
- Name:
Entry: 7
Data: 40|JetBrains.Annotations.PublicAPIAttribute, UnityEngine.CoreModule
Data: 40|UnityEngine.Serialization.FormerlySerializedAsAttribute, UnityEngine.CoreModule
- Name:
Entry: 8
Data:
Expand All @@ -631,25 +631,25 @@ MonoBehaviour:
Data:
- Name: $k
Entry: 1
Data: cyanPoolAdapter
Data: Owner
- Name: $v
Entry: 7
Data: 41|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField
Entry: 1
Data: cyanPoolAdapter
Data: Owner
- Name: <UserType>k__BackingField
Entry: 7
Data: 42|System.RuntimeType, mscorlib
- Name:
Entry: 1
Data: TLP.UdonUtils.Adapters.Cyan.CyanPoolAdapter, TLP.UdonUtils.Runtime.Adapters.Cyan
Data: VRC.SDKBase.VRCPlayerApi, VRCSDKBase
- Name:
Entry: 8
Data:
- Name: <SystemType>k__BackingField
Entry: 9
Data: 20
Data: 42
- Name: <SyncMode>k__BackingField
Entry: 7
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
Expand All @@ -667,7 +667,13 @@ MonoBehaviour:
Data: 43|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
- Name:
Entry: 12
Data: 0
Data: 1
- Name:
Entry: 7
Data: 44|JetBrains.Annotations.PublicAPIAttribute, UnityEngine.CoreModule
- Name:
Entry: 8
Data:
- Name:
Entry: 13
Data:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
using JetBrains.Annotations;
using UnityEngine.Serialization;
using VRC.SDKBase;

namespace TLP.UdonUtils.Adapters.Cyan
namespace TLP.UdonUtils.Runtime.Adapters.Cyan
{
public class CyanPooledObject : TlpBaseBehaviour
{
[FormerlySerializedAs("cyanPoolAdapter")]
public CyanPoolAdapter CyanPoolAdapter;

/// <summary>
/// Who is the current owner of this object. Null if object is not currently in use.
/// </summary>
Expand Down Expand Up @@ -33,7 +37,5 @@ public virtual void _OnCleanup() {
DebugLog(nameof(_OnCleanup));
#endif
}

public CyanPoolAdapter cyanPoolAdapter;
}
}

This file was deleted.

This file was deleted.

Loading

0 comments on commit bf10fe5

Please sign in to comment.