//for checking end-of turn stuff, like if you're on the right space public void CurrentNodeCheck_MovementEnd() { if (graphPosition.VictorySpace == true) { Debug.Log("Yay, you made it!"); LevelReset levelReset = GameObject.FindObjectOfType <LevelReset>(); levelReset.ResetScene(); } }
void Start() { sr = GetComponent <SpriteRenderer>(); PlayerController = GetComponent <PlayerController>(); LevelReset = GetComponent <LevelReset>(); score = 0; touchingObstacle = false; }
public IEnumerator Respawn() //manages respawning { currentLoc = new Vector3(transform.position.x, transform.position.y, transform.position.z); //get the player position dying = true; //set death to true, this stops the update loop of the main movement controller yield return(new WaitForSeconds(deathTime)); //wait for however long LevelReset.Reset(); transform.position = spawnPoint; //move the player to the spawner location yield return(new WaitForSeconds(waitToInput)); //how long after respawner should the player wait before they can input again //currently not implimented dying = false; //set death back to false, letting the player control themselves again. }
// Use this for initialization void Awake() { s = this; }
internal void on_LevelReset() => LevelReset?.Invoke();