2D Roguelike Upgrade Guide
2D Roguelike Upgrade Guide
2D ROGUELIKE
This short guide will help you follow the 2D Roguelike tutorial series using recent
Unity versions and the updated 2D Roguelike assets
You can find the video tutorials on our Learn page here:
https://learn.unity.com/project/2d-roguelike-tutorial
To make best use of this guide, be aware of each video’s timestamps before
proceeding with the tutorial so that you know when to pause and review the
Notes.
TIME 06. WRITING THE PLAYER SCRIPT
Below the other variables towards the top of the script add the
following line:
if(hit.transform == null)
to:
isMoving = true;
rb2D.MovePosition(end);
isMoving = false;
TIME 09. WRITING THE PLAYER SCRIPT
using UnityEngine.UI;
using UnityEngine.SceneManagement;
Application.LoadLevel(Application.LoadedLevel);
SceneManager.LoadScene (0);
06:39 02. PLAYER CHARACTER
using UnityEngine.SceneManagement;
void OnEnable()
{
//Tell our ‘OnLevelFinishedLoading’ function to
start listening for a scene change event as soon as
this script is enabled.
SceneManager.sceneLoaded += OnLevelFinishedLoading;
}
void OnDisable()
{
//Tell our ‘OnLevelFinishedLoading’ function to stop
listening for a scene change event as soon as this
script is disabled.
//Remember to always have an unsubscription for every
delegate you subscribe to!
SceneManager.sceneLoaded -= OnLevelFinishedLoading;
}