Buenas, hoy os comparto un script para hacer un Joystick en C#. Es un port de un script que ya viene en Unity3D y que podéis encontrar en Standard Asset Mobile, este Script estaba en javascript y bueno, lo pasé a C#. Espero que a alguien le sea útil. using UnityEngine; using System.Collections; ////////////////////////////////////////////////////////////// // PORT DE Joystick.js A Joystick.cs //Nicolás Sánchez Baile // Joystick creates a movable joystick (via GUITexture) that // handles touch input, taps, and phases. Dead zones can control // where the joystick input gets picked up and can be normalized. // // Optionally, you can enable the touchPad property from the editor // to treat this Joystick as a TouchPad. A TouchPad allows the finger // to touch down at any point and it tracks the movement relatively // without moving the graphic ////////////////////////////////////////////////////////////// // A simple class for bounding how far the GUITexture ...
Comentarios
Publicar un comentario