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);
		}
	}
示例#3
0
    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");
        }
    }
示例#4
0
        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;
			}
		}
示例#9
0
 /// <summary>
 ///
 /// </summary>
 public void LoadLevel(LevelNames lvl)
 {
     CLevel.Initialize(Services.PLManager.NLevels[(int)lvl], Services.LManager);
 }
示例#10
0
 public string GetLevelName(int worldIndex, int levelIndex) => GetName(levelIndex, LevelNames?.TryGetItem(worldIndex)?.TryGetItem(levelIndex));
示例#11
0
	void OnLevelWasLoaded(int levelNum){
		if (levelNum>0){
			currentLevel = (LevelNames)(levelNum-1);
		}
	}