public static void GoToMaze(Tile.Transition transition) { lastMaze = maze != null?maze.GetTheme() : ""; SaveManager.currentSave.transition = transition; SceneManager.LoadScene(SceneManager.GetActiveScene().name); }
public GameSave() { GameGraph gameGraph = new GameGraph(); start = transition = gameGraph.StartTransition(); mazes = gameGraph.ToMazeArray(); bag = new Bag(); lifePoints = maxHP; playTime = 0; golemBossFirstTime = true; }
Tile.Transition GenerateHole(int beginID) { int id = Random.Range(beginID, this.id); Maze maze = GameGraph.current.caveStage.mazes [id - beginID]; int x, y; do { x = Random.Range(2, maze.width - 3); y = Random.Range(2, maze.height - 3); } while (!maze.tiles [x, y].isWalkable); Tile.Transition transition = new Tile.Transition(id, x, y, 3); transition.instant = false; return(transition); }
// =============================================================================== // Queda // =============================================================================== public IEnumerator Fall(Tile.Transition transition) { canMove = false; character.damaging = true; character.Stop(); SoundManager.Fall(); yield return(new WaitForSeconds(0.2f)); Destroy(transform.GetChild(0).gameObject); float speed = 120; while (character.spriteRenderer.color.a > 0) { transform.Translate(0, -Time.deltaTime * speed, 0); character.spriteRenderer.color -= new Color(0, 0, 0, Time.deltaTime * 4); yield return(null); } MazeManager.GoToMaze(transition); }