Aptus Unibug User Guide


TABLE OF CONTENTS:
  1. Installation
  2. Integrating Unibug Into Your Scene
  3. Unibug at Runtime
    1. The Bug Icon
    2. Dock View
    3. Watch View
    4. FPS View
    5. Log View
    6. Tools View
    7. Vars View
  4. Unibug API
    1. Unibug.Log
    2. Unibug.Watch
    3. Unibug.Expose
  5. Unibug Support

  1. Installation

    Please see the "Getting Started" document for instructions on how to install Aptus Unibug.

  2. Integrating Unibug Into Your Scene

    When Unibug is imported into your project, you will see a new submenu under Unity's GameObject menu called Unibug. In this submenu there is a Toggle Unibug in Current Scene option. This option will enable Unibug in any scene you have open, or will remove it if it's already present.

  3. Unibug at Runtime

    1. The Bug Icon

      When you play a scene with Unibug in it, you will see a bug icon in one of the four corners. Click or tap on this icon to expand the Unibug interface, and then click or tap on it again to hide the interface when you want it out of the way.

    2. Dock View

      Click or tap on the Dock tab to switch to the Dock view. From there, you can choose any corner of the screen to dock Unibug in.

    3. Watch View

      Click or tap on the Watch tab to switch to the Watch view. From there, you can watch an object's transform (position, rotation, scale) as it changes during runtime. There is an option to add an object to the watch list by clicking or tapping on it. Click on this option and then on the object, and it will be added to the watch list. Please note that the object must have a collider component attached for this to work, as Unibug uses a raycast to determine which object you're clicking on. Next, there is an option to add an object to the watch list by name. This is useful is an object doesn't have a collider, or if it is out of view and you can't click on it. Just choose this option, enter the name and then click the Add button. Finally, you can add objects to the watch list from your code, by using the Unibug.Watch function. See the section on that function for more details.

    4. FPS View

      Click or tap on the FPS tab to switch to the FPS view. From there, you can see a running framerate counter. This will tell you how fast or slow your game is running, measured in frames per second. Along with the current framerate, the minimum and maximum framerate are also shown.

    5. Log View

      Click or tap on the Log tab to switch to the Log view. From there, you can see messages that are being printed from your code. This is useful to see if certain points in your code are being reached, or certain conditions are being met. The Unibug.Log function is used to output messages from your code, so please read the documentation on that function for more information.

    6. Tools View

      Click or tap on the Tools tab to switch to the Tools view. From there, you can save screenshots of your game at any time. Just click on the screenshot button and a screenshot will be taken without the Unibug interface. More features will be added to the Tools view in future versions of Aptus Unibug.

    7. Vars View

      Click or tap on the Vars tab to switch to the Vars view. This is one of the coolest features of Unibug, because it gives access to view and control variables internal to your game scripts. By using the Unibug.Expose function in any of your scripts, you can add any variable to this interface. In the case of integer or float variables, a horizontal slider will be shown that allows you to view and change the value of the variable at runtime. The script can set minimum and maximum values for this slider. This can be used for setting speeds, quantities and other values useful in debugging a game. In the case of a boolean variable, a checkbox will be shown that allows you to toggle the value of the variable. This can be used for things like turning off enemy AI, unlocking doors, etc. In the case of a string variable, a text edit field will be shown that allows you to change the value of the variable. Finally, you can set up a message to be sent to an object every time you button in the Vars view. Just tell Unibug which object you want the message passed to and the name of the message. This can be used to activate switches, kill enemies, and other things you sometimes want to skip over when testing a debugging a game. Please see the documentation on the Unibug.Expose function for more information.

  4. Unibug API

    1. Unibug.Log

      This function is used to send debugging output messages to the Log view of the Unibug interface. From anywhere in your code, call Unibug.Log (str), where str is a string you'd like to send to the Log view.

    2. Unibug.Watch

      This function is used to add game objects to the Watch view of the Unibug interface. From anywhere in your code, call Unibug.Watch (obj), where obj is any game object in your scene, and then it will be added to the view.

    3. Unibug.Expose

      This function is used to expose variables and script messages to the Vars view of the Unibug interface. This function differs from some of the other Unibug API functions because it needs to be called every frame, since the values of the exposed variables can be changed depending on what happens in the interface. So, call it from a function like Update() or OnGUI(), etc. Following is a list of the possible parameter lists you can use when calling this function, with a description of how to use each:

      1. Unibug.Expose (name:String, value:float, minRange:float, maxRange:float):float

        Description:
        Use this format when you want to expose/control a float variable. You have to pass in the current value of the variable (in the "value" parameter) and assign the function's return value back to the variable.

        Parameters:
        name - This is a friendly label that will be displayed in the Unibug interface next to the controls. value - This is the current value of the variable. minRange - This is the minimum possible value that you want assigned to this variable. maxRange - This is the maximum possible value that you want assigned to this variable.

        Example:
        function Update ()
        {
        	enemySpeed = Unibug.Expose ("Enemy Speed", enemySpeed, 0.0, 100.0);
        }
        		
      2. Unibug.Expose (name:String, value:int, minRange:int, maxRange:int):int

        Description:
        Use this format when you want to expose/control an integer variable. You have to pass in the current value of the variable (in the "value" parameter) and assign the function's return value back to the variable.

        Parameters:
        name - This is a friendly label that will be displayed in the Unibug interface next to the controls. value - This is the current value of the variable. minRange - This is the minimum possible value that you want assigned to this variable. maxRange - This is the maximum possible value that you want assigned to this variable.

        Example:
        function Update ()
        {
        	numEnemiesToSpawn = Unibug.Expose ("Enemy Quantity", numEnemiesToSpawn, 0, 10);
        }
        		
      3. Unibug.Expose (name:String, value:boolean):boolean

        Description:
        Use this format when you want to expose/control a boolean variable. You have to pass in the current value of the variable (in the "value" parameter) and assign the function's return value back to the variable.

        Parameters:
        name - This is a friendly label that will be displayed in the Unibug interface next to the controls. value - This is the current value of the variable.

        Example:
        function Update ()
        {
        	isInvincible = Unibug.Expose ("Player Invincible", isInvincible);
        }
        		
      4. Unibug.Expose (name:String, value:String):String

        Description:
        Use this format when you want to expose/control a string variable. You have to pass in the current value of the variable (in the "value" parameter) and assign the function's return value back to the variable.

        Parameters:
        name - This is a friendly label that will be displayed in the Unibug interface next to the controls. value - This is the current value of the variable.

        Example:
        function Update ()
        {
        	assetPath = Unibug.Expose ("Asset Server Path", assetPath);
        }
        		
      5. Unibug.Expose (name:String, tgt:GameObject, rcv:String)

        Description:
        Use this format when you want to set up a button to send a message to an object.

        Parameters:
        name - This is a friendly label that will be displayed on the button. tgt - This is the game object that the message will be sent to. rcv - This is the name of the message to send, in other words, the function that will be called in the receiving object's script.

        Example:
        function Update ()
        {
        	Unibug.Expose ("Kill Enemies", enemyParentObj, "KillEnemies");
        }
        		
      6. Unibug.Expose (name:String, tgt:GameObject, rcv:String, param:Object)

        Description:
        Use this format when you want to set up a button to send a message to an object.

        Parameters:
        name - This is a friendly label that will be displayed on the button. tgt - This is the game object that the message will be sent to. rcv - This is the name of the message to send, in other words, the function that will be called in the receiving object's script. param - This is the object that will be passed to the message recipient/function.

        Example:
        function Update ()
        {
        	Unibug.Expose ("Freeze Enemies", enemyParentObj, "SetEnemyMovement", false);
        }
        		
  5. Unibug Support

    For more support, please email unibug@aptusmobile.com.