void Start()
    {
        VirtualInput.AddAxis(horizontalAxisName);
        VirtualInput.AddAxis(verticalAxisName);

        joystickSize = guiTexture.pixelInset.width - guiTexture.pixelInset.left;

        HideJoystick();
    }
Beispiel #2
0
    private float doubleClickDelay = 0.4f;       // The interval between button presses to define the double click action.

    // Start is always called after any Awake functions.
    void Start()
    {
        // Set up the references.
        doubleClickTimer = 0;
        bg           = this.GetComponent <Image>();
        joystick     = this.transform.GetChild(0).GetComponent <Image>();
        releaseColor = joystick.color;

        // Subscribe this virtual analog axes on the virtual Input manager.
        VirtualInput.AddAxis(inputXAxis, this);
        VirtualInput.AddAxis(inputYAxis, this);
        VirtualInput.AddAxis(buttonName, this);
    }