Scripting Basics

Basic Usage

using UnityEngine;
using Volplane;

// Basic usage...
public class Demo : VolplaneBehaviour
{
    private void OnReady()
    {
        // Set standard view for all players
        SetStandardView("mainView");
    }

    private void Update()
    {
        // If game master presses button "myButton"
        if(VInput.GetButtonDown(GetMaster(), "myButton"))
        {
            Debug.Log("Pressed button!");
        }
    }

    protected override void OnEnable()
    {
        // Call OnEnable() method from base class
        base.OnEnable();

        // Own code can be placed here...
        Debug.Log("Enabled!");
    }
}

VolplaneBehaviour again inherits from MonoBehaviour so you can make use of all Unity specific functionality. The only exceptions are the Unity calls OnEnable() and OnDisable().

From the abstract VolplaneBehaviour class the entire functionality of the framework can be accessed. Methods with a specific name will be bound to different events for various AirConsole actions. VolplaneBehaviour again inherits from MonoBehaviour, which allows you to also keep using all Unity calls (Awake, Start, Update, etc) like you did before. The only exception are the two calls OnEnable and OnDisable. Although those two can be overridden, they must always call their base method to guarantee the behaviours functionality.

There can be multiple instances inheriting from this behaviour.

VolplaneBehaviour


Inputs from your players through their controllers are managed in the static VInput class. It provides various methods for handling player inputs.

VInput


Player specific and user related interaction can be performed through VPlayer objects. Every AirConsole device is bound to an object.

VPlayer