示例#1
0
    void Awake()
    {
        if (Instance == null)
        {
            Instance = this;
            DontDestroyOnLoad(gameObject);
        }
        else
        {
            Destroy(gameObject);
            return;
        }

        PlayerPrefs.SetInt("SaveExists", GameData.readFile(SaveState.SAVE_DATA) as SaveState == null ? 0 : 1);
    }
示例#2
0
        public override void Start()
        {
            saveStateController = new SaveStateController();
            saveStateController.init();

            // Don't let the screen shutoff while running app.
            Screen.sleepTimeout = SleepTimeout.NeverSleep;

            base.Start();

            if (!SanityCheckAccessConfiguration())
            {
                return;
            }

            setupUI();

            spatialNotesUI.setStatusText("Starting Session...");

            startup();
        }
示例#3
0
        public override void OnInspectorGUI()
        {
            DrawDefaultInspector();

            SaveStateController myScript = (SaveStateController)target;

            if (GUILayout.Button("Load"))
            {
                myScript.LoadData();
            }

            if (GUILayout.Button("Save"))
            {
                myScript.SaveData();
            }

            if (GUILayout.Button("Delete Save"))
            {
                myScript.DeleteAll();
            }
        }
    // Use this for initialization
    void Start()
    {
        #if UNITY_WEBPLAYER
        Destroy(GameObject.Find("SavePanel"));
        Destroy(GameObject.Find("NamePanel"));
        #endif

        saveStateController = GameObject.Find("Save State Controller").
                                GetComponent<SaveStateController>();
        hitsIndicator = GameObject.Find("HitsIndicator")
                            .GetComponent<Text>();
        sceneManager = GameObject.FindObjectOfType<SceneManager>();
        bgPreview = GameObject.Find("BackgroundMiniPreview")
                        .GetComponent<Image>();
        backgrounds = GameParameters.Backgrounds;

        editorBGPreview = GameObject.Find("EditorPanel")
                            .GetComponent<Image>();

        levelNameText = GameObject.Find("LevelNameText")
                            .GetComponent<Text>();

        UpdateBackgrounds();
    }