Created
July 3, 2017 15:36
-
-
Save CameronVetter/133c9937771549b9d114dc77c2381793 to your computer and use it in GitHub Desktop.
Make him Animate
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using HoloToolkit.Unity.InputModule; | |
using UnityEngine; | |
public class Cowboy : MonoBehaviour, IInputClickHandler | |
{ | |
private Animator _anim; | |
private void Start() | |
{ | |
InputManager.Instance.AddGlobalListener(gameObject); | |
} | |
public void MoveCharacterToPoint(Vector3 newLoc) | |
{ | |
if (_anim == null) _anim = gameObject.GetComponent<Animator>(); | |
_anim.SetFloat("Forward", 1); | |
} | |
public void OnInputClicked(InputClickedEventData eventData) | |
{ | |
MoveCharacterToPoint(GazeManager.Instance.HitPosition); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment