Example #1
0
 void Start()
 {
     if (string.IsNullOrEmpty(text))
     {
         text = "v" + Application.version + " - Last Built: " + BuildtimeInfo.DateTimeString();
     }
 }
Example #2
0
        public static DateTime BuildTime()
        {
            DateTime buildTime;

#if UNITY_EDITOR
            buildTime = System.DateTime.Now;
#else
            buildTime = System.DateTime.Parse(BuildtimeInfo.DateTimeString());
#endif


            return(buildTime);
        }
Example #3
0
        public void Save(int slot)
        {
            var key = "PGWF_Savefile" + slot;

            if (PlayerPrefs.HasKey(key))
            {
                PlayerPrefs.DeleteKey(key);
            }

            saveTimestamp = DateTime.UtcNow.Ticks;
            saveVersion   = "v" + Application.version + " - Last Built: " + BuildtimeInfo.DateTimeString();

            PlayerSprite.value = Player.playerInstance.anim.spriteSetIndex;

            PlayerPrefs.SetString(key, JsonUtility.ToJson(this));
            PlayerPrefs.Save();
        }
Example #4
0
    private void Update()
    {
        if (InputController.JustPressed(Action.DEBUG_SaveState))
        {
            ActiveSavefile.saveTimestamp = DateTime.UtcNow.Ticks;
            ActiveSavefile.saveVersion   = "v" + Application.version + " - Last Built: " + BuildtimeInfo.DateTimeString();

            var data = JsonUtility.ToJson(ActiveSavefile);

            if (Application.platform == RuntimePlatform.WebGLPlayer)
            {
                DebugInfo.debugText = "Save Data: Setting text area to: " + data;


                LoadArea_SetText(data);
            }
            else
            {
                DebugInfo.debugText         = "Clipboard set to Save Data: " + data;
                GUIUtility.systemCopyBuffer = data;
            }
        }

        if (changedVariables)
        {
            EventPositioner.CheckPositions();
            changedVariables = false;
        }

        if (Input.GetKeyDown(KeyCode.Pause))
        {
            devModeForce++;

            if (devModeForce == 5)
            {
                Debug.Log("DEVMODE " + (devMode ? "DISABLED" : "ENABLED"));
                devMode      = !devMode;
                devModeForce = 0;
            }
        }

        //rest require devMode to be enabled
        if (!devMode)
        {
            return;
        }

        if (Input.GetKeyDown(KeyCode.BackQuote))
        {
            var val = _activeLanguage.value + 1;

            if (val == EventPage.supportedLanguageInitializers.Count)
            {
                val = 0;
            }

            ActiveLanguage = new GlobalInt(val);
        }

        if (Input.GetKeyDown(KeyCode.F5))
        {
            ResetLevel();
        }

        if (Input.GetKeyDown(KeyCode.PageDown))
        {
            var s = Application.platform == RuntimePlatform.WebGLPlayer ? LoadArea_GetText() : GUIUtility.systemCopyBuffer;
            DebugInfo.debugText = "Attempting to load Save Data from Clipboard... ";

            loadedData     = true;
            ActiveSavefile = new SaveFile();
            try
            {
                JsonUtility.FromJsonOverwrite(s, ActiveSavefile);
            }
            catch (Exception e)
            {
                DebugInfo.debugText = "Invalid Save Data.";
            }
            ResetLevel();
        }
    }