Skip to content

Instantly share code, notes, and snippets.

@ted80
Created May 7, 2016 12:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ted80/f65fc6eacb9de4646fb18cabeea8b6ce to your computer and use it in GitHub Desktop.
Save ted80/f65fc6eacb9de4646fb18cabeea8b6ce to your computer and use it in GitHub Desktop.
using UnityEngine;
using System.Collections;
public class Main : MonoBehaviour
{
void Start ()
{
CommandManager.registerCommand(onCommandLoadLevel, "load");
}
public void onCommandLoadLevel(string[] _params)
{
if(_params.Length == 0 || string.IsNullOrEmpty(_params[0]))
{
CommandConsole.Log("Invalid parameter! Example: load [levelname]", new Color32(255, 255, 0, 255));
return;
}
CommandConsole.Log("Loading level: " + _params[0]);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment