Michsky – Docs Michsky – Docs
  • Home 
  • Documentation 
    • Hex UI 
    • Beam UI 
    • Reach UI 
    • Heat UI 
    • DreamOS 
    • Modern UI Pack 
    • Loading Screen Studio 
    • Dark UI 
    • Motion Titles Pack 
  • Contact 
Michsky – Docs Michsky – Docs
Michsky – Docs
  • Home 
  • Documentation 
    • Hex UI 
    • Beam UI 
    • Reach UI 
    • Heat UI 
    • DreamOS 
    • Modern UI Pack 
    • Loading Screen Studio 
    • Dark UI 
    • Motion Titles Pack 
  • Contact 

DreamOS

  • Quick Start
  • Animations
  • Apps & Windows
    • App Library
    • Creating New Apps
    • Commander
    • Game Hub
    • Mail
    • Messaging
    • Music Player
    • Notepad
    • Photo Gallery
    • Reminder
    • Settings
    • Video Player
    • Web Browser
    • Widget Library
  • Handlers & Managers
    • Audio Manager
    • Boot Manager
    • Data Manager
    • Date & Time
    • Events
    • Mod Manager
    • Multi Instance Manager
    • Network Manager
    • Notification Manager
    • User Manager
    • World Space Manager
    • Window Manager
    • Wallpaper Manager
  • Localization
    • Getting Started
    • Localization Settings
    • Localization Manager
    • Localized Object
  • UI Elements
    • Button
    • Context Menu
    • Modal Window
    • Selectors
    • Slider
    • Switch
  • UI Manager
  • Others & Add-ons
    • Steam Messaging
  1. Home
  2. DreamOS
  3. Handlers & Managers
  4. Date & Time
Updated on July 4, 2023

DreamOS

  • Quick Start
  • Animations
  • Apps & Windows
    • App Library
    • Creating New Apps
    • Commander
    • Game Hub
    • Mail
    • Messaging
    • Music Player
    • Notepad
    • Photo Gallery
    • Reminder
    • Settings
    • Video Player
    • Web Browser
    • Widget Library
  • Handlers & Managers
    • Audio Manager
    • Boot Manager
    • Data Manager
    • Date & Time
    • Events
    • Mod Manager
    • Multi Instance Manager
    • Network Manager
    • Notification Manager
    • User Manager
    • World Space Manager
    • Window Manager
    • Wallpaper Manager
  • Localization
    • Getting Started
    • Localization Settings
    • Localization Manager
    • Localized Object
  • UI Elements
    • Button
    • Context Menu
    • Modal Window
    • Selectors
    • Slider
    • Switch
  • UI Manager
  • Others & Add-ons
    • Steam Messaging

Date & Time

Author: admin 290 views

Workflow

A component responsible for managing the system date and time. It doesn’t require any external resources and it’s a simulated time solution. It supports timed events and changing the simulation speed. You can find this manager under the DreamOS Canvas > Managers parent.

Use System Time

If you want to use the real time that is based on your OS, you can enable the ‘Use System Time’ option.

Scripting

				
					using UnityEngine;
using Michsky.DreamOS; // DreamOS namespace
using UnityEngine.Events;

public class SampleClass : MonoBehaviour
{
    [SerializeField] private DateAndTimeManager timeManager; // Manager variable
    [SerializeField] private UnityEvent tEvents; // Timed events

    void YourFunction()
    {
        // Set the simulation speed
        timeManager.timeMultiplier = 1;

        // Set date and time
        timeManager.currentSecond = 1;
        timeManager.currentMinute = 1;
        timeManager.currentHour = 1;
        timeManager.currentDay = 1;
        timeManager.currentMonth = 1;
        timeManager.currentYear = 2000;

        // Use system time
        timeManager.useSystemTime = true;

        // User short time format
        timeManager.useShortTimeFormat = true;

        // Create timed event
        timeManager.CreateTimedEvent("Title", int hour, int minute, DateAndTimeManager.DefaultShortTime.AM, DateAndTimeManager.TimedEventType.Once, tEvents)
    }
}				
			

How can we help?

A premium WordPress theme with an integrated Knowledge Base,
providing 24/7 community-based support.

© 2024 Michsky