Created
December 2, 2019 02:50
-
-
Save travisdmathis/5f9a1c908115ca80eee398106e5c6ebc to your computer and use it in GitHub Desktop.
This file contains hidden or 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
public enum INPUT_TYPE | |
{ | |
PointAndClick, | |
Directional, | |
FollowPointer, | |
PointClickOrFollowPointer, | |
SideScrollX, | |
SideScrollZ, | |
TankControl | |
} | |
protected virtual void UpdateInputPointClickOrFollowPointer() | |
{ | |
if (!this.IsControllable()) return; | |
this.UpdateUIConstraints(); | |
if (Input.GetMouseButton((int)this.mouseButtonMove) && !this.uiConstrained) | |
{ | |
this.UpdateInputFollowPointer(); | |
} | |
else if (Input.GetMouseButtonUp((int)this.mouseButtonMove) && !this.uiConstrained) | |
{ | |
Camera maincam = this.GetMainCamera(); | |
if (maincam == null) return; | |
Ray cameraRay = maincam.ScreenPointToRay(Input.mousePosition); | |
this.characterLocomotion.SetTarget(cameraRay, this.mouseLayerMask, null, 0f, null); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment