IEnumerator loadLevel(string levelText) { LevelName levelToLoad = (LevelName)scenePassThroughDataRef.levelNum; if (levelToLoad == LevelName.EndScene) { DialogueBox.gameObject.SetActive(false); LastLevelDialogueBox.gameObject.SetActive(true); LastLevelMessage.text = levelText; } else { DialogueBox.gameObject.SetActive(true); LastLevelDialogueBox.gameObject.SetActive(false); Message.text = levelText; } imageToFade.gameObject.SetActive(true); yield return(new WaitForSeconds(5)); if (PlayerExists == true) { playerControllerRef.playerDead(); } PlayerExists = false; SceneManager.LoadScene(levelToLoad.ToString()); }
public void LoadLevel(LevelName levelName, int spawnIndex) { curSpawnIndex = spawnIndex; // Load level SceneManager.LoadScene(levelName.ToString()); }
public ChangeLevelCommand(Guid playerId, int levelId, LevelName levelName, int pointsToAdvance) { PlayerId = playerId; LevelId = levelId; LevelName = levelName; PointsToAdvance = pointsToAdvance; }
public NewLevelWindow(Map map) { this.Map = map; InitializeComponent(); this.Title = "Edit map settings"; LevelName.Text = map.Name; LevelLocation.Text = map.FilePath; LevelLocation.IsReadOnly = true; PropertiesDataGrid.ItemsSource = Map.Properties; AddPropertyBtn.IsEnabled = true; RemovePropertyBtn.IsEnabled = true; FileBrowseBtn.IsEnabled = false; CreateBtn.Content = "Save"; if (LevelName.Text.Length > 0) { CreateBtn.IsEnabled = true; } else { CreateBtn.IsEnabled = false; } LevelName.Focus(); }
public Level(LevelName levelName, int recvExp, int recvGold, int requiredLevel) { this.LevelName = levelName; this.ReceivedExperienceAmount = recvExp; this.ReceivedGoldAmount = recvGold; this.RequiredLevel = requiredLevel; }
public void Load(LevelName level) { if (!SceneManager.GetSceneByName(level.ToString()).isLoaded) { SceneManager.LoadScene(level.ToString(), LoadSceneMode.Additive); PlayerHUDManager.Instance.ChangeLevel(level); } }
public NewLevelWindow() { InitializeComponent(); this.Title = "Create a new map"; CreateBtn.Content = "Create"; LevelName.Focus(); }
public void OnPlayerLoadGameLevel_Start(LevelName levelName, bool useLoadingPanel) { CloseAllPanel(); if (useLoadingPanel) { OpenPanel <Loading_Panel>(); } }
private void Refresh() { levelNameLabel.text = LevelName.ToUpper(); highScoreLabel.text = GameController.I.GetHighScore(LevelName).ToString(); background.color = IsSelected ? selectedColor : normalColor; background.sprite = IsSelected ? selectedSprite : normalSprite; }
public void LoadLevel(int current) { sceneIndex = current; LevelSelectionCanvas.SetActive(false); MainMenuCanvas.SetActive(false); loading.SetTrigger("Load"); OK = true; WhatLevelSelected = (LevelName)sceneIndex - 1; }
public override int GetHashCode() { int result = 1; result = (result * 397) ^ Id.GetHashCode(); result = (result * 397) ^ Level.GetHashCode(); result = (result * 397) ^ LevelId.GetHashCode(); result = (result * 397) ^ (LevelName != null ? LevelName.GetHashCode() : 0); return(result); }
/// <summary> /// Upgrade operation /// </summary> public void UpgradeOperation(LevelName levelName) { switch (levelName) { case LevelName.Level_0: //make a function UpgradeRuleOperation(10, 10, 2, 1, 10); break; case LevelName.Level_1: UpgradeRuleOperation(20, 20, 4, 2, 10); break; case LevelName.Level_2: UpgradeRuleOperation(25, 25, 5, 2, 10); break; case LevelName.Level_3: UpgradeRuleOperation(30, 30, 5, 2, 10); break; case LevelName.Level_4: UpgradeRuleOperation(10, 10, 2, 1, 10); break; case LevelName.Level_5: UpgradeRuleOperation(10, 10, 2, 1, 10); break; case LevelName.Level_6: UpgradeRuleOperation(10, 10, 2, 1, 10); break; case LevelName.Level_7: UpgradeRuleOperation(10, 10, 2, 1, 10); break; case LevelName.Level_8: UpgradeRuleOperation(10, 10, 2, 1, 10); break; case LevelName.Level_9: UpgradeRuleOperation(10, 10, 2, 1, 10); break; case LevelName.Level_10: UpgradeRuleOperation(10, 10, 2, 1, 10); break; default: break; } }// UpgradeOperation_end
public void LoadLevel(LevelName levelName) { Debug.Log(levelName.ToString() + " Loaded"); Utility.isGameOver = false; TrunkRotator.Instance.RemoveBonueses(); GameManager.Instance.currentLevelName = levelName; GameManager.Instance.UpdateLevelInfo(levels[levelName]); KnifeStack.Instance.LoadKnives(); TrunkRotator.Instance.UpdateRotation(); UIManager.Instance.UpdateLevelName(levelName); PlayerPrefManager.Instance.HighScore = levelName; }
public void LoadLevel(LevelName levelName, bool useLoadingPanel) { if (m_loadCoroutine != null) { return; } m_loadCoroutine = StartCoroutine(LoadLevelEnumerator(levelName)); if (useLoadingPanel) { StartCoroutine(SetLoadingPanelProgress(levelName, m_assembly.m_levelAssemblyDic[levelName].Length)); } }
/// <summary> /// 升级操作 /// 1.处理核心最大数值增加 /// 2.对应的核心数值,加满为最大数值 /// </summary> public void UpgradeOperation(LevelName lvName) { switch (lvName) { case LevelName.Level_0: UpgradeRuleOperation(10, 10, 2, 1, 10); break; case LevelName.Level_1: UpgradeRuleOperation(10, 10, 2, 1, 10); break; case LevelName.Level_2: UpgradeRuleOperation(10, 10, 2, 1, 10); break; case LevelName.Level_3: UpgradeRuleOperation(10, 10, 2, 1, 10); break; case LevelName.Level_4: UpgradeRuleOperation(10, 10, 2, 1, 10); break; case LevelName.Level_5: UpgradeRuleOperation(10, 10, 2, 1, 10); break; case LevelName.Level_6: UpgradeRuleOperation(10, 10, 2, 1, 10); break; case LevelName.Level_7: UpgradeRuleOperation(10, 10, 2, 1, 10); break; case LevelName.Level_8: UpgradeRuleOperation(10, 10, 2, 1, 10); break; case LevelName.Level_9: UpgradeRuleOperation(10, 10, 2, 1, 10); break; case LevelName.Level_10: UpgradeRuleOperation(10, 10, 2, 1, 10); break; default: break; } }
void FixedUpdate() { if (LevelName.Equals(firstLevel)) { GetComponent <Renderer>().enabled = false; GetComponent <Collider>().enabled = false; } else { GetComponent <Renderer>().enabled = true; GetComponent <Collider>().enabled = true; } }
public void OpenLevel <T>(LevelName levelName) where T : LevelBase { if (m_LevelNow != null) { CloseLevel(); } GameObject Level = Mgr_AssetBundle.Instance.LoadAsset <GameObject>(ABTypes.prefab, levelName.ToString()); m_LevelNow = Instantiate(Level).GetComponent <T>() as LevelBase; m_LevelNow.transform.SetParent(GameManager.Instance.m_MainGame.m_Level, false); m_LevelNow.Init(); m_LevelNow.OnOpen(); }
/// <summary> /// Creates a level based on the leveltype supplied /// </summary> /// <param name="levelType">The LevelType you want to create</param> /// <param name="renderBackground">Bool that determines whether or not we create background blocks</param> public Level(LevelName levelType, Player myPlayer = null, bool renderBackground = true) : base() { myRandom = new Random(); this.renderBackground = renderBackground; this.levelType = levelType; this.myPlayer = myPlayer; currLevel = levelType; ChooseTextures(); CreateMap(); SetupLevel(); }
/// <summary> /// 升级规则的总管理器(玩家属性的提升) /// 1:所有的核心最大数值的增加。 /// 2:对应的核心数值当前值,加到最大数值。(升级时会回复HP和MP) /// </summary> public void LevelUpOperationMgr(LevelName levelName) { switch (levelName) { case LevelName.Level_1: //定义一个方法来处理这些 //具体的数据后期应该存储到XML设置文档中。 LevelUpOperation(10, 10, 2, 1, 10); break; case LevelName.Level_2: LevelUpOperation(10, 10, 2, 1, 10); break; case LevelName.Level_3: LevelUpOperation(10, 10, 2, 1, 10); break; case LevelName.Level_4: LevelUpOperation(10, 10, 2, 1, 10); break; case LevelName.Level_5: LevelUpOperation(10, 10, 2, 1, 10); break; case LevelName.Level_6: LevelUpOperation(10, 10, 2, 1, 10); break; case LevelName.Level_7: LevelUpOperation(10, 10, 2, 1, 10); break; case LevelName.Level_8: LevelUpOperation(10, 10, 2, 1, 10); break; case LevelName.Level_9: LevelUpOperation(10, 10, 2, 1, 10); break; case LevelName.Level_10: LevelUpOperation(10, 10, 2, 1, 10); break; default: LevelUpOperation(10, 10, 2, 1, 10); break; } }
public void ActivateLocalChest(LevelName levelName, int chestID) { GlobalObjectManager.instance.OpenChest((int)levelName, chestID); if (chestID == chestA.GetComponent <Chest>().chestID) { chestA.GetComponent <SpriteRenderer>().sprite = Resources.Load <Sprite>("Sprites/In-Game Sprites/Chest_Open"); chestA.transform.position += new Vector3(0, 0.4f, 0); } else if (chestID == chestB.GetComponent <Chest>().chestID) { chestB.GetComponent <SpriteRenderer>().sprite = Resources.Load <Sprite>("Sprites/In-game Sprites/Chest_Open"); chestB.transform.position += new Vector3(0, 0.4f, 0); } }
public static LevelData CreateLevelData(LevelName levelName) { LevelData levelData; switch (levelName) { case LevelName.Level0: levelData = new LevelData_0(); break; case LevelName.Level1: levelData = new LevelData_1(); break; case LevelName.Level2: levelData = new LevelData_2(); break; case LevelName.Level3: levelData = new LevelData_3(); break; case LevelName.Level4: levelData = new LevelData_4(); break; case LevelName.Level5_1: levelData = new LevelData_5_1(); break; case LevelName.Level5_2: levelData = new LevelData_5_2(); break; case LevelName.LevelTest1: levelData = new LevelTest_1(); break; case LevelName.LevelTest2: levelData = new LevelTest_2(); break; default: levelData = new LevelData_0(); break; } levelData.Initialize(); return(levelData); }
/*升级操作 * 1.所有的核心最大数值发生改变:生命值、魔法值等等 * 2.最大的核心数值加满为最大数值 */ public void UpgradeOperation(LevelName levelName) { switch (levelName) { case LevelName.Level_0: //定义一个方法 里面的每一个数都是当前等级下的增量 UpgradeRuleOperation(10, 10, 2, 1, 10, 0.1f); break; case LevelName.Level_1: UpgradeRuleOperation(10, 10, 2, 1, 10, 0.1f); break; case LevelName.Level_2: UpgradeRuleOperation(10, 10, 2, 1, 10, 0.1f); break; case LevelName.Level_3: UpgradeRuleOperation(10, 10, 2, 1, 10, 0.03f); break; case LevelName.Level_4: UpgradeRuleOperation(10, 10, 2, 1, 10, 0.01f); break; case LevelName.Level_5: UpgradeRuleOperation(10, 10, 2, 1, 10, 0); break; case LevelName.Level_6: UpgradeRuleOperation(10, 10, 2, 1, 10, 0); break; case LevelName.Level_7: UpgradeRuleOperation(10, 10, 2, 1, 10, 0); break; case LevelName.Level_8: UpgradeRuleOperation(10, 10, 2, 1, 10, 0); break; case LevelName.Level_9: UpgradeRuleOperation(10, 10, 2, 1, 10, 0); break; case LevelName.Level_10: UpgradeRuleOperation(10, 10, 2, 1, 10, 0); break; } } //UpgradeOperation end
private IEnumerator SetLoadingPanelProgress(LevelName levelName, int length) { m_progress_target = 1f / length; m_progress_current = 0f; while (m_progress_target <= 1f) { m_progress_current = Mathf.Lerp(m_progress_current, m_progress_target, 0.02f); //GameEvent.Local_Invoke<float>(CommandType.UpdateLoadingProgress, m_progress_current); //GameEvent.UpdateLoadingProgress.Invoke(m_progress_current); m_updateLoadingProgress.Invoke(m_progress_current); yield return(new WaitForEndOfFrame()); } //GameEvent.UpdateLoadingProgress.Invoke(1f); m_updateLoadingProgress.Invoke(1f); }
public void ActivateLocalNest(LevelName levelName, LevelPosition levelPosition) { GlobalObjectManager.instance.ActivateNest((int)levelName, (int)levelPosition); if (levelPosition == LevelPosition.Start) { UIManager.Instance.SetStartWarp(true); } else if (levelPosition == LevelPosition.Shop) { UIManager.Instance.SetShopWarp(true); } else if (levelPosition == LevelPosition.Boss) { UIManager.Instance.SetBossWarp(true); } }
/// <summary> /// CONSTRUTOR /// </summary> /// <param name="game">Referência para o jogo que o chamou</param> /// <param name="centerPosition">Posicao do centro do texto</param> /// <param name="font">Font carregada</param> /// <param name="color">Cor da font</param> public Chronometer(IServiceProvider serviceProvider, LevelName levelName) { if (levelName == LevelName.Bogeyman) { this.startTime = TimeSpan.FromMinutes(9.9); this.time = TimeSpan.FromMinutes(9.9); } this.finalTime = TimeSpan.FromMinutes(0.3); this.color = Color.Yellow; this.stoped = false; ContentManager content = new ContentManager(serviceProvider, "Content"); this.font = content.Load<SpriteFont>("Fonts/chronometer"); }
public void NextLevel() { if (levelIndex == -2) //currently in lobby { levelIndex = -1; SceneManager.LoadScene("powerup"); return; } else if (levelIndex == -1) //currently in upgrades { levelIndex = 0; currentLevel = levels[0]; return; } PlayerController winner = FindObjectOfType <PlayerController>(); foreach (Stats s in playerStats) { if (s.controllerId == winner.controllerId) { s.won++; } } if (mapIndex >= currentLevel.maps) { levelIndex++; if (levelIndex < levels.Length) { currentLevel = levels[levelIndex]; mapIndex = 0; } else { SceneManager.LoadScene("leaderboard"); return; } } string mapToLoad = currentLevel.mapPrefix + "_" + mapIndex; mapIndex++; SceneManager.LoadScene(mapToLoad); }
/// <summary> /// CONSTRUTOR /// </summary> /// <param name="serviceProvider">Interface para apontar o gerenciador de conteúdo (Content)</param> /// <param name="levelName">Nome da fase</param> public Level(IServiceProvider serviceProvider, Viewport viewport, LevelName levelName) { // Inicializa o gerenciador de conteúdo if (this.content == null) { this.content = new ContentManager(serviceProvider, "Content"); } // Viewport this.viewport = viewport; // Nome da fase this.levelName = levelName; // Carrega as texturas e sons da fase this.LoadContent(); }
public override int GetHashCode() { int hash = 1; if (LevelId != 0) { hash ^= LevelId.GetHashCode(); } if (LevelType != 0) { hash ^= LevelType.GetHashCode(); } if (LevelName.Length != 0) { hash ^= LevelName.GetHashCode(); } if (LevelTheme.Length != 0) { hash ^= LevelTheme.GetHashCode(); } if (LevelPicture != 0) { hash ^= LevelPicture.GetHashCode(); } if (LevelUnlock != 0) { hash ^= LevelUnlock.GetHashCode(); } if (Rating1 != 0) { hash ^= Rating1.GetHashCode(); } hash ^= rating2_.GetHashCode(); hash ^= rating3_.GetHashCode(); hash ^= levelPixel_.GetHashCode(); if (AdPuzzle != 0) { hash ^= AdPuzzle.GetHashCode(); } if (_unknownFields != null) { hash ^= _unknownFields.GetHashCode(); } return(hash); }
string CalcChance(int level, LevelName name) { switch (name) { case LevelName.Start: if (level % 2 == 0) { return("Prefabs/Rooms/Normal/Room" + Random.Range(1, NORMAL_NUM + 1).ToString()); } else { return("Prefabs/Rooms/Treasury/Room" + Random.Range(1, TREASURY_NUM + 1).ToString()); } default: return("No"); } }
public IActionResult Index([FromBody] LevelName level) { if (!LevelRepo.Instance.ContainsLevel(level.Name)) { return(new BadRequestObjectResult("there is no such level")); } var gameId = Guid.NewGuid(); var game = GamesRepo.Instance.NewGame(gameId, level.Name); GameDto dto = new GameDto( GameDtoBuilder.BuildCells(game).ToArray(), true, true, game.Width, game.Height, gameId, false, 0); return(new ObjectResult(dto)); }
public static void SetLevel(LevelName level) { switch (level) { case LevelName.Level1: propertiesReader.SetLevel("Level1"); levelReader.SetLevel("Level1"); break; case LevelName.Level2: propertiesReader.SetLevel("Level2"); levelReader.SetLevel("Level2"); break; case LevelName.Level3: propertiesReader.SetLevel("Level3"); levelReader.SetLevel("Level3"); break; } InitializeContent(); }
public override int GetHashCode() { int hash = 1; if (InfoId != 0) { hash ^= InfoId.GetHashCode(); } if (InfoType != 0) { hash ^= InfoType.GetHashCode(); } if (LevelName.Length != 0) { hash ^= LevelName.GetHashCode(); } if (LevelDesc.Length != 0) { hash ^= LevelDesc.GetHashCode(); } return(hash); }
/// <summary> /// Instancia o status do jogador para inicialização de fases /// </summary> public static void InitializeAllStatus(IServiceProvider serviceProvider, LevelName levelName, bool isTriggerTime) { // Se estiver nulo instancia um novo status if (Status.InstanceStatus == null) { Status.InstanceStatus = new Status(serviceProvider); } // Atualiza o território da fase Status.InstanceStatus.levelName = levelName; Status.InstanceStatus.isTriggerTimer = isTriggerTime; Status.InstanceStatus.chronometer = new Chronometer(serviceProvider, levelName); }
private Tile[,] walls; // Tiles acima do chão e dos personagens #endregion Fields #region Constructors /// <summary> /// CONSTRUTOR /// </summary> /// <param name="serviceProvider">Interface para apontar o gerenciador de conteúdo (Content)</param> /// <param name="levelName">Nome da fase</param> public Level(IServiceProvider serviceProvider, Viewport viewport, LevelName levelName) { // Inicializa o gerenciador de conteúdo if (this.content == null) { this.content = new ContentManager(serviceProvider, "Content"); } // Viewport this.viewport = viewport; // Nome da fase this.levelName = levelName; // Inicializa as posições de M com uma lista que armazenará todas as posições x e y de M no txt this.positionsM = new List<Vector2>(); // Carrega as texturas e sons da fase this.LoadContent(); // Inicializa a posição do monstro fazendo um random entre os M no arquivo txt da fase this.random = new Random(DateTime.Now.Millisecond); int m = this.random.Next(positionsM.Count - 1); LoadMonsterTile((int)positionsM[m].X, (int)positionsM[m].Y); }