Search Unity

[WIP | Update] In-Game Developer Console

Discussion in 'Assets and Asset Store' started by psuong, Apr 7, 2018.

  1. psuong

    psuong

    Joined:
    Jun 11, 2014
    Posts:
    126
    Hey folks,

    So I was browsing the asset store for a developer console plugin, but the one free one I found seems a bit dated, so I started building my own open sourced one! I'll mainly be using this thread to post updates and get some feedback on the progress and use cases of the tool.

    Here are some deets below:

    The In-Game Developer Console provides an interactable in-game console like the ones found in:
    • Counter Strike games
    • Quake 4
    • Elder Scrolls/Fallout Series
    It's a minimalistic Unity tool and comes packaged with:
    • Global Event Handler
    • Relative Event Handler
    • Customizable UI
    • Unix Terminal like behaviours such as storing previous command (aka .bash_history)
    Allowing any developer or user to interact and modify/execute controllable properties or functions the game is built or is in play mode.
    [Repository Link]
    [Basic Documentation (WIP)]

    Here's a preview of usage within the Survival Shooter during Play Mode:



    Feel free to clone the repo and mess with the tool, I'll be updating the repo in the coming weeks with
    • Full Documenation
    • Scripting API
    • Asset Store Content
    • Test cases
    • Getting it ready with .NET 4.5
     
  2. psuong

    psuong

    Joined:
    Jun 11, 2014
    Posts:
    126
    Some more updates to the in game console:
    • Refactored the RelativeEventHandler for .NET 3.5 to act more like how Delegates work in C#, allowing you to combine similar delegates together if they share the same parameter types and length.
    • Caching the Instance Id of an object to allow the event to be execute from the Console.
    • Added a bool parsing in the command line.
    • Added custom a custom inspector to the IdCache for customization and visual info within the inspector.
    Code (CSharp):
    1. using GlobalEvents;
    2. // When some outside instance invokes the event, "some-event-name",  
    3. // both Foo(object) and Bar(object) will be executed!
    4. private void OnEnable() {
    5.     // Subscribe the method, Foo and Bar
    6.     RelativeEventHandler.SubscribeEvent("some-event-name", this, "Foo");
    7.     RelativeEventHandler.SubscribeEvent("some-event-name", this, "Bar");
    8. }
    9.  
    10. private void OnEnable() {
    11.     // Unsubscribe Foo and Bar from the event handler
    12.     RelativeEventHandler.UnsubscribeEvent("some-event-name", this, "Foo");
    13.     RelativeEventHandler.UnsubscribeEvent("some-event-name", this, "Bar");
    14. }
    15.  
    16. private void Foo(object arg0) {
    17.     // Do something unique here
    18. }
    19. private void Bar(object arg0) {
    20.    // Do something unique that Foo doesn't do
    21. }
    22.  
    All updates can be found on the README of the repository page here.