All Projects → Bian-Sh → Unijoystick

Bian-Sh / Unijoystick

Licence: mit
It is a powerful joystick component for UGUI.

Projects that are alternatives of or similar to Unijoystick

Unitypausemenu
This is an open source Unity pause menu created for the game New Horizons, and it's completely free because of how a pause menu is a core component of a game, while the unity asset store was lacking in such an asset (until this was released on the asset store).
Stars: ✭ 160 (+113.33%)
Mutual labels:  unity, joystick
Dkvfxsketches
VFX sketches with Depthkit and Unity
Stars: ✭ 74 (-1.33%)
Mutual labels:  unity
3d Game Shaders For Beginners
🎮 A step-by-step guide to implementing SSAO, depth of field, lighting, normal mapping, and more for your 3D game.
Stars: ✭ 11,698 (+15497.33%)
Mutual labels:  unity
Taa unity urp
Temporal Anti-Aliasing(TAA) for Unity’s Universal Render Pipeline
Stars: ✭ 69 (-8%)
Mutual labels:  unity
Vfxgraphmodeling
Procedural modeling with Unity VFX Graph
Stars: ✭ 68 (-9.33%)
Mutual labels:  unity
4dviewstest
4DViews volumetric video + Unity
Stars: ✭ 71 (-5.33%)
Mutual labels:  unity
Sentry Unity
Sentry SDK for Unity3d
Stars: ✭ 66 (-12%)
Mutual labels:  unity
Unityrtc
基于webrtc的unity多人游戏实时语音(A Unity Demo for Impl Real-time Game Voice Among Mutiplayers Based On WEBRTC)
Stars: ✭ 74 (-1.33%)
Mutual labels:  unity
Nexplayer unity plugin
Stream videos in HLS & DASH with Widevine DRM using NexPlayer Video Streaming Player SDK for Unity on Android & iOS devices
Stars: ✭ 73 (-2.67%)
Mutual labels:  unity
Matrix Shockwave Shader
Surface shader with tesselation - Tried recreating the shockwave effect in Matrix when Neo takes off.
Stars: ✭ 69 (-8%)
Mutual labels:  unity
Unity3d Python
在Unity里使用Python脚本
Stars: ✭ 69 (-8%)
Mutual labels:  unity
Pbr proj
Shader of PBR for Unity
Stars: ✭ 68 (-9.33%)
Mutual labels:  unity
Unitypointcloudviewer
Point Cloud Viewer and Tools for Unity
Stars: ✭ 71 (-5.33%)
Mutual labels:  unity
Nintendoextensionctrl
Arduino library for communicating with Nintendo extension controllers
Stars: ✭ 67 (-10.67%)
Mutual labels:  joystick
Davinci
An esay-to-use image downloading and caching library for Unity
Stars: ✭ 74 (-1.33%)
Mutual labels:  unity
Unimic
A wrapper for Unity's Microphone class.
Stars: ✭ 65 (-13.33%)
Mutual labels:  unity
Libfive Unity
A CSharp wrapper for libfive with Unity bindings
Stars: ✭ 69 (-8%)
Mutual labels:  unity
Extosc
extOSC is a tool dedicated to simplify creation of applications in Unity with OSC protocol usage.
Stars: ✭ 69 (-8%)
Mutual labels:  unity
Unity3d Dynamicallyloadinganimation
👾 Unity3D Loading and unloading animations at runtime (Example)
Stars: ✭ 74 (-1.33%)
Mutual labels:  unity
Ugcframework
unity客户端框架(UGUI+C#+protocol+xlua/ILRuntime)
Stars: ✭ 74 (-1.33%)
Mutual labels:  unity

UniJoystick

这是一个代码极简但功能相对完善的基于UGUI的摇杆(Joystick)组件。

Summary

  1. 支持设置摇杆半径范围
  2. 支持挂载指示器(指示器已经剥离成独立可选挂件)
  3. 支持配置哪一个轴向使能。
  4. 支持一键将摇杆设置为动态底座摇杆或者静态底座摇杆
  5. 事件驱动,使用UnityEvent 使得事件可以在面板上挂载
  6. 本仓库配备了3个摇杆控制解决方案(Demo,仅供参考):
    • 第一人称 Charactor 控制
    • 第三人称 Charactor 控制
    • 常规Transform.Translate控制
  7. 适配 Canvas 的 三种 RenderMode。
  8. 几乎每句代码都热情洋溢充满注释。

How to use?

  1. 拖入 Joystick 预制体到 Canvas 中(按需更换 UI 素材)。
  2. 再关注摇杆数据的地方获取摇杆实例并注册 OnValueChanged 事件
  3. 点击运行即可。

示例代码

    public float speed = 5;
    [SerializeField] Joystick joystick;
    void Start()
    {
        joystick.OnValueChanged.AddListener(v =>
        {
            if (v.magnitude != 0)
            {
                transform.Translate(v.x * speed, 0, v.y * speed, Space.World);
                transform.rotation = Quaternion.LookRotation(new Vector3(v.x, 0, v.y));
            }
        });
    }

功能演示

无论静态 or 动态摇杆,都支持 Canvas 的所有 RenderMode

指向器挂载即可使用,不想用销毁即可(有些同学反映指向器用不到,所以剥离并作为可选挂件提供给大家)。

第一人称解决方案示例

第三人称解决方案示例

结语

因为使用 IpointerXXXHandler 这套事件接口,淡化了 Touch 和 Input API ,所以:

  1. 这个摇杆理论上是支持各种各样的多点触控设备的
  2. 支持同屏多个摇杆实例且互不干扰。

ps :在 Microsoft's Surface Pro 测试OK。

My Blog

[Unity 3d] 使用UGUI做一个类似王者荣耀的摇杆 - 简书

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].