PlayStateScene2

using UnityEngine; using Assets.Code.Interfaces; namespace Assets.Code.States { public class PlayStateScene2 : IStateBase { private StateManager manager; private GameObject player; private PlayerControl controller; public PlayStateScene2 (StateManager managerRef) { manager = managerRef; if(Application.loadedLevelName != "Scene2") Application.LoadLevel("Scene2"); player = GameObject.Find("Player"); controller = player.GetComponent<PlayerControl>(); player.rigidbody.isKinematic = false; foreach(var camera in manager.gameDataRef.cameras) { if(camera.name != "Following Camera") camera.SetActive(false); else camera.SetActive(true); } } public void StateUpdate() { if(manager.gameDataRef.playerLives <= 0) { manager.SwitchState(new LostStateScene2(manager)); ...

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.