Skip to content

Commit

Permalink
Release 8.2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Release Automat committed Jun 2, 2024
1 parent 6e6eb7f commit 7024999
Show file tree
Hide file tree
Showing 32 changed files with 7,896 additions and 17 deletions.
10 changes: 10 additions & 0 deletions Packages/tlp.udonutils/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,16 @@ The used pattern MAJOR.MINOR.PATCH indicates:

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

### [8.2.0] - 2024-06-02

#### 🚀 Features

- Add state machine implementation with optionally synchronized transition timing

#### 🐛 Bug Fixes

- *(UtcTimeSource)* Prevent usage of utc float time due to accuracy problems

### [8.1.1] - 2024-05-27

#### 🐛 Bug Fixes
Expand Down
5 changes: 3 additions & 2 deletions Packages/tlp.udonutils/Runtime/DesignPatterns/MVC/Model.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using JetBrains.Annotations;
using TLP.UdonUtils.Runtime.Common;
using TLP.UdonUtils.Runtime.Events;
using UnityEngine;
using VRC.SDKBase;
Expand Down Expand Up @@ -34,15 +35,15 @@ public bool IsReady() {
[PublicAPI]
public bool Initialize(UdonEvent changeEvent) {
#if TLP_DEBUG
DebugLog(nameof(Initialize));
DebugLog($"{nameof(Initialize)} with '{changeEvent.GetScriptPathInScene()}");
#endif
if (HasError) {
Error($"Can not initialize again due to previous critical error: '{CriticalError}'");
return false;
}

if (Initialized) {
Warn("Already initialized");
Error("Already initialized");
return false;
}

Expand Down
55 changes: 49 additions & 6 deletions Packages/tlp.udonutils/Runtime/DesignPatterns/MVC/MvcBase.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
using TLP.UdonUtils.Runtime.Common;
using TLP.UdonUtils.Runtime.Events;
using UnityEngine;
using VRC.SDKBase;

namespace TLP.UdonUtils.Runtime.DesignPatterns.MVC
{
Expand All @@ -10,12 +12,27 @@ public abstract class MvcBase : TlpBaseBehaviour
public bool HasError { get; protected set; }

public static bool InitializeMvcSingleGameObject(GameObject gameObject) {
return InitializeMvc(
gameObject.GetComponent<Model>(),
gameObject.GetComponent<View>(),
gameObject.GetComponent<Controller>(),
gameObject.GetComponent<UdonEvent>()
);
if (!Utilities.IsValid(gameObject)) {
Debug.LogError($"{nameof(InitializeMvcSingleGameObject)}: {nameof(gameObject)} invalid");
return false;
}

#region TLP_DEBUG
#if TLP_DEBUG
Debug.Log($"{nameof(InitializeMvcSingleGameObject)} '{gameObject.transform.GetPathInScene()}'");
#endif
#endregion

if (InitializeMvc(
gameObject.GetComponent<Model>(),
gameObject.GetComponent<View>(),
gameObject.GetComponent<Controller>(),
gameObject.GetComponent<UdonEvent>())) {
return true;
}

Debug.LogError($"Failed to Initialize MVC on '{gameObject.transform.GetPathInScene()}'", gameObject);
return false;
}

public static bool InitializeMvc(
Expand All @@ -24,6 +41,32 @@ public static bool InitializeMvc(
Controller controller,
UdonEvent modelChangedEvent
) {
#region TLP_DEBUG
#if TLP_DEBUG
Debug.Log(nameof(InitializeMvc));
#endif
#endregion

if (!Utilities.IsValid(model)) {
Debug.LogError($"{nameof(model)} invalid");
return false;
}

if (!Utilities.IsValid(view)) {
Debug.LogError($"{nameof(view)} invalid");
return false;
}

if (!Utilities.IsValid(controller)) {
Debug.LogError($"{nameof(controller)} invalid");
return false;
}

if (!Utilities.IsValid(modelChangedEvent)) {
Debug.LogError($"{nameof(modelChangedEvent)} invalid");
return false;
}

return model.Initialize(modelChangedEvent)
&& controller.Initialize(model, view)
&& view.Initialize(controller, model);
Expand Down
2 changes: 1 addition & 1 deletion Packages/tlp.udonutils/Runtime/Events/UiEvent.asset
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ MonoBehaviour:
sourceCsScript: {fileID: 11500000, guid: f95147634bfd42ba8c41c9183e88e2bf, type: 3}
scriptVersion: 2
compiledVersion: 2
behaviourSyncMode: 2
behaviourSyncMode: 1
hasInteractEvent: 0
scriptID: -2691533232995813866
serializationData:
Expand Down
2 changes: 1 addition & 1 deletion Packages/tlp.udonutils/Runtime/Events/UiEvent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
namespace TLP.UdonUtils.Runtime.Events
{
[DefaultExecutionOrder(ExecutionOrder)]
[UdonBehaviourSyncMode(BehaviourSyncMode.NoVariableSync)]
[UdonBehaviourSyncMode(BehaviourSyncMode.None)]
public class UiEvent : UdonEvent
{
}
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 7024999

Please sign in to comment.