Created
June 9, 2019 07:24
-
-
Save fredknack/0934ef2f50ad320998fea0b8a06f5b01 to your computer and use it in GitHub Desktop.
Persistent Manager Script #framework #Unity
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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