Skip to content

Commit

Permalink
Release 4.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Release Automat committed Apr 7, 2024
1 parent 3a6e9b0 commit 0b84f50
Show file tree
Hide file tree
Showing 63 changed files with 6,209 additions and 2,662 deletions.
26 changes: 26 additions & 0 deletions Packages/tlp.udonutils/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,32 @@ The used pattern MAJOR.MINOR.PATCH indicates:

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

### [4.0.0] - 2024-04-07

#### 🚀 Features

- *(TlpAccurateSyncBehaviour)* Make Start() method virtual
- *(Sync)* Make dependencies public
- *(UdonCommon)* Add extension function to get path in the scene of a transform
- *(UdonCommon)* Add extension function to get path in the scene of a component
- *(TlpBaseBehaviour)* [**breaking**] Switch to TimeSources, change logging of time and deltas, add SetupAndValidate method and call it in Start(), fix scenes and delete obsolete ones
- *(TransformBacklog)* Prevent adding of time values from the past, add boolean return value, add tests
- *(Testing)* Added new example runtime test GameTime vs DeltaTime, restructured Testing folder

#### 🚜 Refactor

- *(TlpAccurateSyncBehaviour)* Add some descriptions

#### 🧪 Testing

- *(TimeBacklog)* Ensure interpolatable check works
- *(TransformBacklog)* Fix failure due to floating point accuracy
- *(TransformBacklog)* Fix another floating point accuracy error

#### ⚙️ Miscellaneous Tasks

- Bump version

### [3.0.0] - 2024-03-30

#### 🚀 Features
Expand Down
28 changes: 15 additions & 13 deletions Packages/tlp.udonutils/Runtime/Common/Chair.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,19 +34,6 @@ public class Chair : TlpBaseBehaviour
public UdonEvent OnRemotePlayerExited;

#region UdonSharp Lifecycle
public void Start() {
#region TLP_DEBUG
#if TLP_DEBUG
DebugLog(nameof(Start));
#endif
#endregion

_station = (VRCStation)gameObject.GetComponent(typeof(VRCStation));
if (!Utilities.IsValid(_station)) {
ErrorAndDisableComponent($"{name} is missing a {nameof(VRCStation)} component");
}
}

public void OnDisable() {
#region TLP_DEBUG
#if TLP_DEBUG
Expand Down Expand Up @@ -226,5 +213,20 @@ private void NotifyRemotePlayerExited(VRCPlayerApi player) {
}
}
#endregion


#region Hook Implementations
protected override bool SetupAndValidate() {
if (!base.SetupAndValidate()) return false;

_station = (VRCStation)gameObject.GetComponent(typeof(VRCStation));
if (!Utilities.IsValid(_station)) {
Error($"{name} is missing a {nameof(VRCStation)} component");
return false;
}

return true;
}
#endregion
}
}
35 changes: 34 additions & 1 deletion Packages/tlp.udonutils/Runtime/Common/UdonCommon.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,13 @@

namespace TLP.UdonUtils.Common
{
/// <summary>
/// Common Utilities and extension methods for <see cref="UdonSharpBehaviour"/>s.
/// </summary>
public static class UdonCommon
{
/// <summary>
/// Finds the component of a given type in the current gameobject hierarchy which is closest to the scene root
/// Finds the component of a given type in the current GameObject hierarchy which is closest to the scene root
/// </summary>
/// <param name="type"></param>
/// <param name="start"></param>
Expand Down Expand Up @@ -177,5 +180,35 @@ public static T[] GetBehavioursInChildren<T>(this Transform start) where T : Udo

return outPut;
}

/// <param name="transform"></param>
/// <returns>The path from the scene root to the transform provided,
/// returns an empty string if the provided transform is invalid</returns>
public static string GetPathInScene(this Transform transform) {
if (!Utilities.IsValid(transform)) {
return "";
}

string path = "";
while (transform != null) {
path = transform.name + (path.Length > 0 ? "/" + path : "");
transform = transform.parent;
}

return path;
}

/// <param name="transform"></param>
/// <returns>The path from the scene root to the component provided,
/// returns an empty string if the provided component is invalid</returns>
public static string GetComponentPathInScene(this Component component) {
if (!Utilities.IsValid(component)) return "";
if (component is TlpBaseBehaviour) {
return component.transform.GetPathInScene() + "/" +
UdonTypeNameShort(((TlpBaseBehaviour)component).GetUdonTypeName());
}

return component.transform.GetPathInScene() + "/" + component.GetType().Name;
}
}
}
96 changes: 63 additions & 33 deletions Packages/tlp.udonutils/Runtime/Common/WorldVersionCheck.asset
Original file line number Diff line number Diff line change
Expand Up @@ -824,13 +824,13 @@ MonoBehaviour:
Data:
- Name: $k
Entry: 1
Data: updateAvailableListeners
Data: UpdateAvailableListeners
- Name: $v
Entry: 7
Data: 53|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField
Entry: 1
Data: updateAvailableListeners
Data: UpdateAvailableListeners
- Name: <UserType>k__BackingField
Entry: 7
Data: 54|System.RuntimeType, mscorlib
Expand Down Expand Up @@ -866,10 +866,16 @@ MonoBehaviour:
Data: 56|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
- Name:
Entry: 12
Data: 1
Data: 2
- Name:
Entry: 7
Data: 57|UnityEngine.TooltipAttribute, UnityEngine.CoreModule
Data: 57|UnityEngine.Serialization.FormerlySerializedAsAttribute, UnityEngine.CoreModule
- Name:
Entry: 8
Data:
- Name:
Entry: 7
Data: 58|UnityEngine.TooltipAttribute, UnityEngine.CoreModule
- Name: tooltip
Entry: 1
Data: Behaviours to notify when a player with a new world version joins
Expand All @@ -893,16 +899,16 @@ MonoBehaviour:
Data:
- Name: $k
Entry: 1
Data: updateAvailableEvent
Data: UpdateAvailableEvent
- Name: $v
Entry: 7
Data: 58|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
Data: 59|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField
Entry: 1
Data: updateAvailableEvent
Data: UpdateAvailableEvent
- Name: <UserType>k__BackingField
Entry: 7
Data: 59|System.RuntimeType, mscorlib
Data: 60|System.RuntimeType, mscorlib
- Name:
Entry: 1
Data: System.String, mscorlib
Expand All @@ -911,7 +917,7 @@ MonoBehaviour:
Data:
- Name: <SystemType>k__BackingField
Entry: 9
Data: 59
Data: 60
- Name: <SyncMode>k__BackingField
Entry: 7
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
Expand All @@ -926,13 +932,19 @@ MonoBehaviour:
Data: true
- Name: _fieldAttributes
Entry: 7
Data: 60|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
Data: 61|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
- Name:
Entry: 12
Data: 1
Data: 2
- Name:
Entry: 7
Data: 62|UnityEngine.Serialization.FormerlySerializedAsAttribute, UnityEngine.CoreModule
- Name:
Entry: 8
Data:
- Name:
Entry: 7
Data: 61|UnityEngine.TooltipAttribute, UnityEngine.CoreModule
Data: 63|UnityEngine.TooltipAttribute, UnityEngine.CoreModule
- Name: tooltip
Entry: 1
Data: Name of the custom event to call on the behaviours in updateAvailableListeners
Expand All @@ -956,13 +968,13 @@ MonoBehaviour:
Data:
- Name: $k
Entry: 1
Data: versionConflictListeners
Data: VersionConflictListeners
- Name: $v
Entry: 7
Data: 62|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
Data: 64|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField
Entry: 1
Data: versionConflictListeners
Data: VersionConflictListeners
- Name: <UserType>k__BackingField
Entry: 9
Data: 54
Expand All @@ -983,13 +995,19 @@ MonoBehaviour:
Data: true
- Name: _fieldAttributes
Entry: 7
Data: 63|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
Data: 65|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
- Name:
Entry: 12
Data: 1
Data: 2
- Name:
Entry: 7
Data: 64|UnityEngine.TooltipAttribute, UnityEngine.CoreModule
Data: 66|UnityEngine.Serialization.FormerlySerializedAsAttribute, UnityEngine.CoreModule
- Name:
Entry: 8
Data:
- Name:
Entry: 7
Data: 67|UnityEngine.TooltipAttribute, UnityEngine.CoreModule
- Name: tooltip
Entry: 1
Data: Behaviours to notify when a world version conflict between a joining
Expand All @@ -1014,19 +1032,19 @@ MonoBehaviour:
Data:
- Name: $k
Entry: 1
Data: versionConflictEvent
Data: VersionConflictEvent
- Name: $v
Entry: 7
Data: 65|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
Data: 68|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField
Entry: 1
Data: versionConflictEvent
Data: VersionConflictEvent
- Name: <UserType>k__BackingField
Entry: 9
Data: 59
Data: 60
- Name: <SystemType>k__BackingField
Entry: 9
Data: 59
Data: 60
- Name: <SyncMode>k__BackingField
Entry: 7
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
Expand All @@ -1041,13 +1059,19 @@ MonoBehaviour:
Data: true
- Name: _fieldAttributes
Entry: 7
Data: 66|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
Data: 69|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
- Name:
Entry: 12
Data: 1
Data: 2
- Name:
Entry: 7
Data: 67|UnityEngine.TooltipAttribute, UnityEngine.CoreModule
Data: 70|UnityEngine.Serialization.FormerlySerializedAsAttribute, UnityEngine.CoreModule
- Name:
Entry: 8
Data:
- Name:
Entry: 7
Data: 71|UnityEngine.TooltipAttribute, UnityEngine.CoreModule
- Name: tooltip
Entry: 1
Data: Name of the custom event to call on the behaviours in versionConflictListeners
Expand All @@ -1071,13 +1095,13 @@ MonoBehaviour:
Data:
- Name: $k
Entry: 1
Data: build
Data: Build
- Name: $v
Entry: 7
Data: 68|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
Data: 72|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField
Entry: 1
Data: build
Data: Build
- Name: <UserType>k__BackingField
Entry: 9
Data: 3
Expand All @@ -1098,13 +1122,19 @@ MonoBehaviour:
Data: true
- Name: _fieldAttributes
Entry: 7
Data: 69|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
Data: 73|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
- Name:
Entry: 12
Data: 2
Data: 3
- Name:
Entry: 7
Data: 74|UnityEngine.Serialization.FormerlySerializedAsAttribute, UnityEngine.CoreModule
- Name:
Entry: 8
Data:
- Name:
Entry: 7
Data: 70|UnityEngine.HeaderAttribute, UnityEngine.CoreModule
Data: 75|UnityEngine.HeaderAttribute, UnityEngine.CoreModule
- Name: header
Entry: 1
Data: Auto generated/updated on upload
Expand All @@ -1113,7 +1143,7 @@ MonoBehaviour:
Data:
- Name:
Entry: 7
Data: 71|UnityEngine.TooltipAttribute, UnityEngine.CoreModule
Data: 76|UnityEngine.TooltipAttribute, UnityEngine.CoreModule
- Name: tooltip
Entry: 1
Data: Is automatically incremented during upload, can be set to an initial
Expand Down
Loading

0 comments on commit 0b84f50

Please sign in to comment.