Giter Site home page Giter Site logo

realtime-debug-command's Introduction

Yunasawa Studio

Runtime Debug Command - Documentation

Documentation shows you how to use RUNTIME DEBUG COMMAND.

script email

★ About

  • Runtime Debug Command provides you an input field used to handle and debug your logics, events or you can use it as a feature of you game.
  • See Version for more updated features.
  • This tool is not really perfect and complete so if you have any errors or bugs or difficulties when use this, please feedback and I will response as soon as possible.

★ Table On Contents

★ How to create Debug Command GUI

From Menu Item / Hierarchy (Currently not supported)

  • First, you can select an object in hierarchy to be parent of RDC.
  • Right-click in hierarchy, select YのL > 2D > Runtime Debug Command or select Tools > YのL > Create Object > 2D > Runtime Debug Command on window bar.
  • In case you don't select a canvas to be the parent, a new Canvas and Event System will be created automatically.

From Prefab / Asset

  • Find RDC in Assets > Yunasawa の Library > Runtime Debug Command > Prefabs > Debug Command GUI.
  • Drag it into an object that you want it to be the parent of RDC.

★ How to create new Debug Command

  • Here is a sample code for a , I call it DC_Debug. It is used to display a message inside log window with a general command of .


  • As you can see on the sample picture, now I will show you how to make one step by step:
    • First, create a new class (name it whatever you want, I recommend to put DC_ in the beginning), inherited from .
    • Make a constructor for it, now you have to concentrate on this step. CommandNodes is a List of CommandNode. Here is CommandNode class:

    • As you can see, CommandNode has 3 properties, Nodes, Suggestions, MustStartWith and Customable.
      • Nodes is the general name of node in a command. For example, in the command , Nodes are "debug", "selection", "message".
      • Suggestions will show up when you typing the commands so you can Tab to finish it automatically, when you typing the "selection" node of , a list of will show up.
      • MustStartWith, if you enable this only the suggestions which start with the word you're typing will appear. You are in "selection" node, then you type "n" then only "notify" appears, but if it's disabled, "warning", "caution" and "notify" will show up (Those 3 contain "n").
      • Customable allows you to set that node is customable or not, it means you can type anything in that node and no need to follow the suggestions.
    • Back to sample DebugCommand, you can see inside the constructor, I assign CommandNodes with a new list, inside I make new CommandNode objects with inputing params are Nodes, Suggestions, MustStartWith, Customable.
      • Node 0: , it have "debug" as Nodes, "debug" as Suggestions and MustStartWith is true.
      • Node 1: is similar.
      • Node 2: , because I don't need Suggestions for this so I don't put anything inside, StartWith is defaulted by false and this node is Customable, you can type anything in this node.
    • After finish the constructor, call an override void named , value is an array of words separated by space. For example, in command , value is { "debug", "log", "Hello", "world" }. Inside this method, you can do your own code to handle the command just like above sample code.
    • You can use to automatically check for wrong command and block the executer.
    • Use to show your command's result on Command Log as a message.

  • Here is another sample for called DC_Time, used to manage time in game.


  • After you created a new , go inside DebugCommandObject.cs and there're 2 things you have to notice:

    • Find this CreateCommand() method in DebugCommandList class.
    • Inside this switch, add the first node of commands as case and return the command like this.
    • Then find this CommandList inside DebugCommandObject class.
    • Add the first node of the command inside the list of string like this.
  • Finish those thing and you now can use your own right inside your project.

★ How to use Debug Command Setting

You can select Debug Command GUI object to make your custom setting for RDC.

realtime-debug-command's People

Contributors

yunasawa avatar

Stargazers

 avatar

Watchers

 avatar

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.