Skip to content

Instantly share code, notes, and snippets.

@z3t0
Created August 2, 2016 19:08
Show Gist options
  • Select an option

  • Save z3t0/d43af1f49c50c049d5e91941591a6aca to your computer and use it in GitHub Desktop.

Select an option

Save z3t0/d43af1f49c50c049d5e91941591a6aca to your computer and use it in GitHub Desktop.
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
using System;
using UnityEngine.SceneManagement;
using System.Reflection;
public class GameManager : MonoBehaviour {
public GameManager Instance;
#region Game
public Game game;
public int numOfPlayers {get; private set;}
#endregion
#region MonoBehaviour
void Awake() {
// Set instance
Instance = this;
}
// Use this for initialization
void Start () {
}
// Update is called once per frame
void Update () {
}
#endregion
public void StartGame(Game.GameMode gameMode) {
// Create a game
numOfPlayers = 1;
switch (gameMode) {
case Game.GameMode.DEATH_MATCH:
Debug.Log ("create a deathmatch game");
SceneManager.LoadScene ("dmGame", LoadSceneMode.Single);
break;
default:
Debug.LogError ("Gamemode not yet implemented");
break;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment