blob: bacd4d9012f3086e6bb371ec2424f2f5dc40ba11 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
|
using System;
using UnityEngine;
public class DemoKeyboardStick : VirtualJoystick
{
public SpriteRenderer UpKey;
public SpriteRenderer DownKey;
public SpriteRenderer LeftKey;
public SpriteRenderer RightKey;
protected override void FixedUpdate()
{
}
public override void UpdateJoystick(FingerBehaviour finger, Vector2 velocity, bool syncFinger)
{
this.UpKey.enabled = (velocity.y > 0.1f);
this.DownKey.enabled = (velocity.y < -0.1f);
this.RightKey.enabled = (velocity.x > 0.1f);
this.LeftKey.enabled = (velocity.x < -0.1f);
}
}
|