Giter Site home page Giter Site logo

unity3d-beastconsole's Introduction

License MIT

Beast Console

screen

Recently updated to remove any trace of UGUI. Now its pure IMGUI, with no additional clutter.

This project is possible because of the effort of amazing people at Cranium Software this project is based of SmartConsole https://github.com/CraniumSoftware/SmartConsole

BeastConsole is evolution (hopefully) of SmartConsole,

Console

  • Backend is created by folks at CraniumSoftware.
  • Use attributes to bind members
  • Register your own arbitrary commands/methods for any object(non monob as well) and provide parameters
  • Autocomplete
  • Both commands and variables support any number of subscribers, modify all objects at once.
  • Multiline
  • Suggestions
  • History
  • ConsoleUtility class containing methods to draw tables. (You can actually use ConsoleUtility pretty much by itself instead of Console class).

Usage

setup: Drop Console prefab in scene, change parameters to your liking.

Attributes:

Console uses reflection to find attributes, to speed up the whole process we should mark any class that has uses console attributes with [ConsoleParse] attribute.

[ConsoleParse]
public class AttributeTest : MonoBehaviour {

    [ConsoleVariable("testvar", "")]
    public float TestVariable = 5f;

    [ConsoleVariable("testproperty", "")]
    public bool TestPropertyVariable
    {
        set {
            Console.WriteLine("testproperty was set to: " + value);
        }
    }


    [ConsoleCommand("testMethod", "")]
	void TestMethod() {
        BeastConsole.Console.WriteLine("test method works");
    }

    [ConsoleCommand("testMethodWithParams", "")]
    public void TestMethodWithParams(float param1) {
        BeastConsole.Console.WriteLine("works :" + param1.ToString());

    }

    [ConsoleCommand("testMethodWith2Params", "")]
    public void TestMethodWith2Params(float param1, int param2) {
        BeastConsole.Console.WriteLine("works :" + (param1+ param2).ToString());

    }
}

Manual:

public float Volume = 1f;
Console.RegisterVariable<float>("Volume", "", x => Volume = x, this);

Console.RegisterCommand("MoveUp", "", this, MoveUp);
   
private void MoveUp(string[] val) {
   transform.position += new Vector3(0, System.Convert.ToSingle(val[1]) , 0);
}

Manual method requires you to unregister commands and variables when done with an object.

See Example folder for more examples.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.