LostStateScene1

using UnityEngine;
using Assets.Code.Interfaces;

namespace Assets.Code.States
{
  public class LostStateScene1 : IStateBase
  {
    private StateManager manager;

    public LostStateScene1 (StateManager managerRef)
    {
      manager = managerRef;
      if(Application.loadedLevelName != "Scene0")
        Application.LoadLevel("Scene0");
    }

    public void StateUpdate()
    {
      if (Input.GetKeyUp (KeyCode.Space))
      {
        manager.SwitchState (new 
          PlayStateScene1_1 (manager));
      }

      if (Input.GetKeyUp (KeyCode.Return))
      {
        manager.Restart();
      }
    }

    public void ShowIt()
    {
      Debug.Log("In LostStateScene1");
    }
  }
}

Get Learning C# by Developing Games with Unity 3D Beginner's Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.