Skip to content

Commit

Permalink
Release 5.2.1
Browse files Browse the repository at this point in the history
  • Loading branch information
Release Automat committed Apr 13, 2024
1 parent 9b91a83 commit b3a4dcf
Show file tree
Hide file tree
Showing 10 changed files with 1,513 additions and 62 deletions.
6 changes: 6 additions & 0 deletions Packages/tlp.udonutils/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,12 @@ The used pattern MAJOR.MINOR.PATCH indicates:

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

### [5.2.1] - 2024-04-13

#### 🐛 Bug Fixes

- Split get scene path functions and fix C## error in test utils

### [5.2.0] - 2024-04-13

#### 🚀 Features
Expand Down
15 changes: 10 additions & 5 deletions Packages/tlp.udonutils/Runtime/Common/UdonCommon.cs
Original file line number Diff line number Diff line change
Expand Up @@ -203,12 +203,17 @@ public static string GetPathInScene(this Transform transform) {
/// 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;
}

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

return component.transform.GetPathInScene() + "/" +
UdonTypeNameShort(component.GetUdonTypeName());
}
}
}
Loading

0 comments on commit b3a4dcf

Please sign in to comment.