SetupState

using UnityEngine; using Assets.Code.Interfaces; using System.Collections; namespace Assets.Code.States { public class SetupState : IStateBase { private StateManager manager; private GameObject player; private PlayerControl controller; public SetupState (StateManager managerRef) { manager = managerRef; if(Application.loadedLevelName != "Scene0") Application.LoadLevel("Scene0"); player = GameObject.Find("Player"); controller = player.GetComponent<PlayerControl>(); } public void StateUpdate () { if(!Input.GetButton("Jump")) controller.transform.Rotate(0, controller.setupSpinSpeed * Time.deltaTime, 0); } public void StateFixedUpdate() { } public void ShowIt () { GUI.Box(new Rect(Screen.width - 110,10,100,25), string.Format("Lives left: ...

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.