Exemplo n.º 1
0
 // Use this for initialization
 void Start()
 {
     Debug.Log("In Preloader Start!");
     if (!COM_Director.CheckIfInitDone())
     {
         COM_Director.InitData();
     }
 }
Exemplo n.º 2
0
    void Start()
    {
        // Preload the Masters if they are not loaded
        COM_Director.InitData();

        MAS_Admin tempMasterAdmin = (MAS_Admin)COM_Director.GetMaster("MAS_Admin");

        adminController = (CON_AdminMenu)tempMasterAdmin.GetController("CON_AdminMenu");

        isLockOn = (PlayerPrefs.GetInt("lockOnOff") == 1);

        // Create a current time DateTime object
        DateTime current = DateTime.Now;


        // Create a DateTime object for the FROM and TO lock out times
        DateTime lockOutFrom = new DateTime(current.Year, current.Month, current.Day, (PlayerPrefs.GetInt("LockoutFromTimeInt")), 0, 0);

        DateTime lockOutTo = new DateTime(current.Year, current.Month, current.Day, (PlayerPrefs.GetInt("LockoutToTimeInt")), 0, 0);

        if (PlayerPrefs.GetString("LockoutToTimeString") != null && PlayerPrefs.GetString("LockoutToTimeString") != "")
        {
            timeText.text = (PlayerPrefs.GetString("LockoutToTimeString"));
        }

        DateTime lockOutToOvernight = new DateTime(current.Year, current.Month, current.Day, ((PlayerPrefs.GetInt("LockoutToTimeInt")) + 1), 0, 0);

        dataService = StartupScript.ds;


        //Display ChildName Key saved in PlayerPref in the ChildNameText game object in scene, or display "My" if the childnamekey is blank or null
        if ((PlayerPrefs.GetString("ChildNameKey") == "") || (PlayerPrefs.GetString("ChildNameKey") == null))
        {
            childnameText.text = "My";
        }
        else
        {
            childnameText.text = PlayerPrefs.GetString("ChildNameKey") + "'s";
        }

        if (!RuntimeManager.IsInitialized())
        {
            RuntimeManager.Init();
        }

        // Check if lock out prefs exist
        if (isLockOn)
        {
            if (lockOutFrom < lockOutTo)
            {
                if ((current > lockOutFrom) && (current < lockOutTo))
                {
                    noAccessPrompt.SetActive(true);
                    startButton.interactable = false;
                }
            }
            else if (lockOutTo < lockOutFrom)
            {
                if ((current > lockOutFrom) || (current < (lockOutTo)))
                {
                    noAccessPrompt.SetActive(true);
                    startButton.interactable = false;
                }
            }
        }

        CheckIfFirstOpenAfterInstall();
    }