void OnTriggerEnter2D(Collider2D other) { if (other.gameObject.name == "Player") { _ttm.StopTrial(); PlayerControll.CanPause = false; DisplayEndTrialScreen(); if (_ttm.EvaluateResult()) { SetWinText(); ProgressManager.UnlockOneHitKill(); } else { SetLossText(); } SetPlayerTime(); if (_rm.EvaluateRecords()) { DisplayNewRecordText(); UpdateRecordsBoard(); } LoadSaveManager.SaveGame(); } }
void Awake() { if (Ref == null) { Ref = GetComponent <LoadSaveManager>(); } _SaveFileNameManList = Application.persistentDataPath + "/ManListSave.xml"; _SaveFileNameRoomList = Application.persistentDataPath + "/RoomListSave.xml"; }
void Start() { if (LoadSaveManager.IsSaveAvailable()) { loadGameButton.gameObject.SetActive(true); } else { loadGameButton.gameObject.SetActive(false); } }
// Use this for initialization void Awake() { if (instance == null) { instance = this; DontDestroyOnLoad(gameObject); } else { Destroy(gameObject); } }
private void Update() { //APAGAR ############################## if (Input.GetKeyDown(KeyCode.Space)) { UI.instance.ShowFinalButtons(); AddTimeAsked(5); LoadSaveManager.LoadGame(); } if (Input.GetKeyDown(KeyCode.N)) { NextLevel(); } //APAGAR ############################## ManageTime(); }
public void NextLevel() { if (levelDone) { int nextSceneIndex = SceneManager.GetActiveScene().buildIndex + 1; if (nextSceneIndex >= SceneManager.sceneCountInBuildSettings) { nextSceneIndex = 0; } thisLevel.levelParams.timeGuess = TimeAsked; LoadSaveManager.atualGame.levels.Add(thisLevel); LoadSaveManager.SaveGame(LoadSaveManager.atualGame); SceneManager.LoadScene(nextSceneIndex); } }
void OnTriggerEnter2D(Collider2D other) { int currentLevel = SceneManager.GetActiveScene().buildIndex - 1; if ((other.gameObject.name == "Player") && (PlayerScore.Score >= Requirements.GetPoints(currentLevel))) { PlayerControll.CanPause = false; Time.timeScale = 0; DisplayEndLevelScreen(); SetScoreText(); LoadSaveManager.SaveGame(); } else if ((other.gameObject.name == "Player") && (PlayerScore.Score < Requirements.GetPoints(currentLevel))) { gameObject.GetComponentInChildren <AudioSource>().Play(); } }
protected override void Activate() { if (Player.HasKey()) { GameManager.RemoveKey(); //animator.SetTrigger("fadeOut"); //buttonIsDisabled = true; //button.SetActive(false); PlayerData dataToSave = new PlayerData(); dataToSave.isCheckpoint = false; dataToSave.sceneData = SceneLoader.GetNextSceneName(); LoadSaveManager.Save(dataToSave); AudioSource.PlayClipAtPoint(openDoor, transform.position); SceneLoader.LoadNextScene(); } }
void Awake() { // Check if instance exists if (Instance == null) { //if not, set instance to this Instance = this; } //If instance already exists and it's not this: else if (Instance != this) { //Then wipe self. Zero mercy for late arrivals. Destroy(gameObject); } //Sets this one to not be destroyed when reloading scene DontDestroyOnLoad(gameObject); // Prepare for save and load _savePath = Path.Combine(Application.persistentDataPath, "adventurer_config.json"); LoadButton.OnLoadRequested += LoadButton_OnLoadRequested; //SaveButton.OnSaveRequested += SaveButton_OnSaveRequested; }
private void Start() { SetLevel(); if (LoadSaveManager.atualGame.levels != null) { Game g = LoadSaveManager.LoadGame(); if (g != null) { int index = 1; foreach (Level level in g.levels) { string log = ""; log += "level index - " + level.levelParams.levelIndex + "\n"; log += "time played - " + level.levelParams.timePlayed + "\n"; log += "time guess - " + level.levelParams.timeGuess + "\n"; log += "score - " + level.point.Count; Debug.Log(log); index++; } } } }
public void LoadGame() { PlayerData data = LoadSaveManager.Load(); SceneLoader.LoadSceneByName(data.sceneData); }
void Start() { LoadSaveManager.DeleteSave(); }
/// <summary> /// Initializes all ScriptCore classes that data to the App Domain /// and initialize any other static members in Sims3.SimIFace classes. /// </summary> public static void Initialize() { if (!sInitialized) { if (gAnimation == null) { gAnimation = new Animation(); } if (gAudio == null) { gAudio = new Audio(); } if (gAutomationUtils == null) { gAutomationUtils = new AutomationUtils(); } if (gCacheManager == null) { gCacheManager = new CacheManager(); } if (gCameraController == null) { gCameraController = new CameraController(); } if (gCASUtils == null) { gCASUtils = new CASUtils(); } if (gCommandSystem == null) { gCommandSystem = new CommandSystem(); } if (gCTProductModularObject == null) { gCTProductModularObject = new CTProductModularObject(); } if (gDataFactory == null) { gDataFactory = new DataFactory(); } if (gDebugDraw == null) { gDebugDraw = new DebugDraw(); } if (gDeviceConfig == null) { gDeviceConfig = new DeviceConfig(); } if (gDownloadContent == null) { gDownloadContent = new DownloadContent(); } if (gEAText == null) { gEAText = new EAText(); } if (gEATrace == null) { gEATrace = new EATrace(); } if (gEventQueueInitializer == null) { gEventQueueInitializer = new EventQueueInitializer(); } if (gGameUtils == null) { gGameUtils = new GameUtils(); } if (gLoadSaveManager == null) { gLoadSaveManager = new LoadSaveManager(); } if (gLocalizedStringService == null) { gLocalizedStringService = new LocalizedStringService(); } if (gLookAtMgr == null) { gLookAtMgr = new LookAtMgr(); } if (gNameGuidMapService == null) { gNameGuidMapService = new NameGuidMapService(); } if (gObjects == null) { gObjects = new Objects(); } if (gOnlineFeatures == null) { gOnlineFeatures = new OnlineFeatures(); } //if (gProfilerUtils == null) gProfilerUtils = new ProfilerUtils(); if (gQueries == null) { gQueries = new Queries(); } if (gRandom == null) { gRandom = new ScriptCore.Random(); } if (gReflection == null) { gReflection = new ScriptCore.Reflection(); } if (gRouteManager == null) { gRouteManager = new RouteManager(); } if (gSACS == null) { gSACS = new SACS(); } if (gSimulator == null) { gSimulator = new Simulator(); } if (gSlots == null) { gSlots = new Slots(); } if (gSocialFeatures == null) { gSocialFeatures = new SocialFeatures(); } if (gStopWatch == null) { gStopWatch = new StopWatch(); } if (gStreamHost == null) { gStreamHost = new StreamHost(); } if (gSwarm == null) { gSwarm = new Swarm(); } if (gThumbnailManager == null) { gThumbnailManager = new ThumbnailManager(); } if (gUIManager == null) { gUIManager = new UIManager(); } if (gUserToolUtils == null) { gUserToolUtils = new UserToolUtils(); } if (gVideoRecorder == null) { gVideoRecorder = new VideoRecorder(); } if (gWorld == null) { gWorld = new World(); } // Will this still be reached if any of the constructors throw an Exception? Hopefully not sInitialized = true; } }