• Stars
    star
    253
  • Rank 159,966 (Top 4 %)
  • Language
    C#
  • License
    BSD 3-Clause "New...
  • Created over 11 years ago
  • Updated over 6 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

In-game Console

Synopsis

Quake-style console plugin for Unity3d. Toggle the console by pressing tilde (~). Press tab to autocomplete commands.

Screenshot

Screenshot

Installation

  1. Copy the Console directory to your Assets/Plugins folder. (Make the plugins folder if it doesn't exist.)
  2. Drag the console prefab into your scene.
  3. Run your scene and press ~ to launch the console.
  4. Now register some custom commands

Registering custom commands

using UnityEngine;
using System.Collections;

public class ConsoleCommandRouter : MonoBehaviour {
    void Start() {
        var repo = ConsoleCommandsRepository.Instance;
        repo.RegisterCommand("hi", Hi);
        repo.RegisterCommand("save", Save);
        repo.RegisterCommand("load", Load);
    }

    public string Hi(params string[] args) {
        return "Hey there yourself!";
    }

    public string Save(params string[] args) {
        var filename = args[0];

        //
        // [insert code here saving the game to that filename]
        //

        return "Saved to " + filename;
    }

    public string Load(params string[] args) {
        var filename = args[0];

        //
        // [insert code here loading the game from that filename]
        //

        return "Loaded " + filename;
    }
}

The string returned from the console command will be displayed to the in-game console log. Insert newlines in your response to have multiple lines be written to the log.

Logging

var logger = ConsoleLog.Instance;
logger.Log("Player died")

Logs to the in-game console.

Note from the author

Feel free to contribute your changes back! I love pull requests.

Cheers,

Mike

[email protected]

@mikelovesrobots on Twitter

More Repositories

1

mmmm

799
star
2

lua-enumerable

A port of ruby's Enumerable module to Lua
Lua
40
star
3

unity3d-trigger-action-pattern

Trigger/Action is an organizational strategy that loosely couples an event like pressing a key to an action like spawning a monster.
C#
33
star
4

unity3d-rigidbody-toolkit

A useful set of scripts for working with rigidbody objects in Unity3d
16
star
5

unity3d-no-clip-first-person-controller

C#
5
star
6

lua-tower-defense

Lua
5
star
7

unity3d-bounds-calculator

5
star
8

unity3d-vector-extensions

4
star
9

unity3d-base

Base Unity3d Project
C#
3
star
10

unity3d-game-of-life

C#
3
star
11

nano

JavaScript
3
star
12

ey-cloud-recipes

A starter repo for custom chef recipes on EY's cloud platform
Ruby
3
star
13

murder-in-moscow

A supernatural roguelike written in ruby then abandoned at the 5 day mark
Ruby
2
star
14

each_with_progressbar

Adds a simple progressbar for long-running loops (e.g., migrations, rake tasks, console tasks)
Ruby
2
star
15

deep-sea-team-deathmatch

Unity3d multiplayer game
C#
2
star
16

rubyminds

Source of the RubyMinds Website
Ruby
2
star
17

free_range_monsters

Free Range Monsters is a roguelike create-your-own-monster adventure
Lua
2
star
18

robot_enumerable

robot_enumerable is a collection of useful additions to the Array and Hash classes.
Ruby
1
star
19

love2d-speed-test

draws lots and lots of lines
1
star
20

joint-serializer-test

Isolated test for a UnitySerializer 1.04 problem (or misunderstanding on my part)
C#
1
star
21

throw-a-ball-tutorial

Code used in a demonstration of Unity for a learning lunch at Substantial
C#
1
star
22

lightwalls

ruby challenge lightcycle game, program your lightcycles
Ruby
1
star
23

murdersnake-sample-client

Ruby
1
star
24

substantial-lua-demo

Lua
1
star
25

is_mike_employed

A gimmicky rails site attempting to get Mike Judge employed
Ruby
1
star
26

its-right-behind-you

Lua videogame
Lua
1
star