void Awake(){ exploShieldMaterial = exploShield.GetComponent<MeshRenderer>().material; imploShieldMaterial = imploShield.GetComponent<MeshRenderer>().material; cubeFader.color = GameColor.fader; exploFader.color = GameColor.fader; imploFader.color = GameColor.fader; selectedLevel = LevelNames.Level1; }
void Awake() { if (theInstance == null) { DontDestroyOnLoad(gameObject); theInstance = this; StaticControls.P1_Controls = p1; highestAccessibleLevel =LevelNames.Level1; } else if (theInstance !=this){ Destroy(gameObject); } }
public void ShowLevel(LevelNames levelName) { HideAllLevels(); if (levelsDictionary.TryGetValue(levelName, out var foundLevel)) { currentLevel = foundLevel; currentLevel.Reset(); currentLevel.EnableColliders(); currentLevel.RegisterShipMarkers(); CoreConnector.CoreGameControl.ResetGame(); } else { // couldn't find level Debug.Log("ERROR! Can't find it"); } }
private void btnLoadLevel_Click(object sender, EventArgs e) { btnSaveLevel.Enabled = false; SelectedLevel = (LevelNames)cbLevel.SelectedIndex; //Locate the start of the data + the compressed length, and then decompress it int startOffset = (FileTable[LevelFileTableOffset[(int)SelectedLevel]].StartOffset & 0x7FFFFFFF) + 0x1B2C6C; int endOffset = startOffset + FileTable[LevelFileTableOffset[(int)SelectedLevel]].CompressedSize * 4; byte[] compressedLevelData = new byte[endOffset - startOffset]; byte[] romArray = _romData.ToArray(); Array.Copy(romArray, startOffset, compressedLevelData, 0, compressedLevelData.Length); //Decompress using (StreamWriter writer = new StreamWriter("tempCompressedVPK0Data.bin")) { writer.BaseStream.Write(compressedLevelData, 0, compressedLevelData.Length); } string nvpkCommand = @"/c nvpktool -d -level 2 -i tempCompressedVPK0Data.bin -o tempDecompressedVPK0Data.bin"; //System.Diagnostics.Process.Start("CMD.exe", nvpkCommand); System.Diagnostics.Process process = new System.Diagnostics.Process(); System.Diagnostics.ProcessStartInfo startInfo = new System.Diagnostics.ProcessStartInfo(); //startInfo.WindowStyle = System.Diagnostics.ProcessWindowStyle.Hidden; startInfo.FileName = "cmd.exe"; startInfo.Arguments = nvpkCommand; process.StartInfo = startInfo; process.Start(); ///NOT WORKING!!! Thread.Sleep(500); //wait a bit _decompressedLevelData = new List<byte>(); if (File.Exists("tempDecompressedVPK0Data.bin")) { _decompressedLevelData.AddRange(File.ReadAllBytes("tempDecompressedVPK0Data.bin")); File.Delete("tempDecompressedVPK0Data.bin"); btnSaveLevel.Enabled = true; } File.Delete("tempCompressedVPK0Data.bin"); //Possibly have a pre-made palette/texture offset switch(SelectedLevel) { case LevelNames.HyruleTemple: LoadHyruleTextures(_decompressedLevelData); break; } cbTextures.Enabled = true; }
void ChangeSelectedLevel(bool levelUp){ selectedLevel = levelUp ? selectedLevel+1 : selectedLevel-1; }
public IEnumerator AddAStar(LevelNames levelName){ if ((int)levelName>=1 && (int)levelName<starCheck.Length){ starCheck[(int)levelName-1] = true; } yield return null; }
public static void LoadLevel(LevelNames levelName){ Application.LoadLevel(ConvertLevelNameToString(levelName)); }
static string ConvertLevelNameToString(LevelNames levelName){ if (levelName == LevelNames.HomeScreen){ return homeScreen; } else if (levelName == LevelNames.LevelSelect){ return levelSelect; } else if (levelName == LevelNames.Level1){ return level1; } else if (levelName == LevelNames.Level2){ return level2; } else if (levelName == LevelNames.Level3){ return level3; } else if (levelName == LevelNames.Level4){ return level4; } else if (levelName == LevelNames.Level5){ return level5; } else if (levelName == LevelNames.Level6){ return level6; } else { return Application.loadedLevelName; } }
/// <summary> /// /// </summary> public void LoadLevel(LevelNames lvl) { CLevel.Initialize(Services.PLManager.NLevels[(int)lvl], Services.LManager); }
public string GetLevelName(int worldIndex, int levelIndex) => GetName(levelIndex, LevelNames?.TryGetItem(worldIndex)?.TryGetItem(levelIndex));
void OnLevelWasLoaded(int levelNum){ if (levelNum>0){ currentLevel = (LevelNames)(levelNum-1); } }