Tanoda
SliderShadow.cs
Go to the documentation of this file.
1/******************************************************************************
2 * Copyright (C) Ultraleap, Inc. 2011-2020. *
3 * *
4 * Use subject to the terms of the Apache License 2.0 available at *
5 * http://www.apache.org/licenses/LICENSE-2.0, or another agreement *
6 * between Ultraleap and you, your company or other organization. *
7 ******************************************************************************/
8
9using UnityEngine;
10using System.Collections;
11
12namespace Leap.Unity.InputModule {
13 public class SliderShadow : MonoBehaviour {
14 public Transform Slider;
15 public Transform Handle;
16
17 void Update() {
18 Vector3 LocalHandle = Slider.InverseTransformPoint(Handle.position);
19 Vector3 LocalShadow = Slider.InverseTransformPoint(transform.position);
20 Vector3 NewLocalShadow = new Vector3(LocalHandle.x, LocalHandle.y, LocalShadow.z);
21 transform.position = Slider.TransformPoint(NewLocalShadow);
22 }
23 }
24}