Skip to content

Instantly share code, notes, and snippets.

@fredknack
Created June 9, 2019 07:24
Show Gist options
  • Save fredknack/0934ef2f50ad320998fea0b8a06f5b01 to your computer and use it in GitHub Desktop.
Save fredknack/0934ef2f50ad320998fea0b8a06f5b01 to your computer and use it in GitHub Desktop.
Persistent Manager Script #framework #Unity
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class PersistentScript : MonoBehaviour
{
public static PersistentScript Instance { get; private set; }
DateTime referenceDate = DateTime.Now;
public void printDate()
{
Debug.Log("referenceDate " + referenceDate.ToString("yyyy-MM-dd"));
//Call this function from other scripts by using the following:
//PersistentManagerScript.Instance.printDate();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment