Loading files
This file is pinned to the selected release. Download the original to open it in your design tool.
fe72387c0This file is pinned to the selected release. Download the original to open it in your design tool.
using Leap.Unity.RuntimeGizmos;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using Leap.Unity;
namespace Leap.Unity.Apps.Paint4.Drawing {
public class PinchBrushController : MonoBehaviour {
public Brush brush;
public Chirality whichHand;
void Update() {
Hand hand = Hands.Get(whichHand);
if (hand != null) {
brush.transform.position = hand.GetPinchPosition();
if (hand.IsPinching() && !brush.IsBrushing()) {
brush.Begin();
}
if (!hand.IsPinching() && brush.IsBrushing()) {
brush.End();
}
}
}
}
}