UGTK cat mascotUGTKengine within an engine Request access

UGTK / Toolkit / Utility Systems / Time Online System Completed

Utility Systems — UGTK

Time Online System

Summary

The Time Online System is a utility system that provides current time provided from external sources.


Content


Modules Dependencies

The Time Online System does not have any dependencies.

Carried inside the prefabs. These modules are not referenced by the assembly definition - the components are simply already attached to the prefabs this module ships. Remove one of them from the project and the prefab keeps its layout and loses that behaviour, with nothing in the console to say so.

Module Component, and the prefab carrying it
UIModule/TextUpdaterSystem Mn_TextUpdater (in DateOnline)

Setup

Don't require any setup. The Time Online System is ready to use.


How To Use

Get current time

OnlineDataTimeUtils.GetOnlineTime(this, (value, error) =>
{
    if (error)
    {
        Debug.LogError("Error getting online time");
        return;
    }
    onlineDateTime_1 = value;
});

Get difference between stored time and current time

OnlineDataTimeUtils.HasPassedTime(this, onlineDateTime_1.Value, (value, error) => 
{
    if (error)
    {
        Debug.LogError("Error getting online time");
        return;
    }
    Debug.Log("Time passed: " + value.GetSeconds());
});

Testing Scene

Test code example:

S_OnlineDateTime? onlineDateTime_1 = null;
Debug.Log("Ask online time 1");
OnlineDataTimeUtils.GetOnlineTime(this, (value, error) =>
{
    if (error)
    {
    Debug.LogError("Error getting online time");
    return;
    }
    onlineDateTime_1 = value;
});

yield return new WaitUntil(() => onlineDateTime_1.HasValue);
Debug.Log("Wait for 5 seconds");
yield return new WaitForSeconds(5);

Debug.Log("Ask online time 2");
OnlineDataTimeUtils.HasPassedTime(this, onlineDateTime_1.Value, (value, error) => 
{
    if (error)
    {
        Debug.LogError("Error getting online time");
        return;
    }
    Debug.Log("Time passed: " + value.GetSeconds());
});

Good to know:


Technical Info

The following are the main scripts and Time Online System. Refer to the script section for detailed structure.

Scripts:

OnlineDataTimeUtils Functions

S_OnlineDateTime Functions


© 2026 Marcello De Bonis. All rights reserved

Real dependenciesOpen in the map →

Depends on 1

Used by 2

Measured from the repository: code references (asmdef) plus prefab and asset GUIDs. Importing this module alone brings in 2 modules in total.