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 void UpdateLabel(int id) | |
{ | |
if (id == 1) | |
{ | |
label.transform.parent.gameObject.SetActive(true); | |
_target.SetActive(true); | |
label.text = "Muscle"; | |
} | |
else if (id == 2) | |
{ |
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
void Update() | |
{ | |
_lineRenderer.SetPosition(0, transform.position); | |
_lineRenderer.SetPosition(1, target.transform.position); | |
} |
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 GameObject target; | |
private LineRenderer _lineRenderer; | |
void Start() | |
{ | |
_lineRenderer = GetComponent<LineRenderer>(); | |
_lineRenderer.startWidth = 0.01f; | |
_lineRenderer.endWidth = 0.01f; | |
} |
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 int GetCurrentStateId() | |
{ | |
return _animator.GetInteger("stateId"); | |
} | |
public void Play(int id) | |
{ | |
_animator.SetInteger("stateId", id); | |
} |
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 void PlayNext() | |
{ | |
prevButton.interactable = true; | |
horseAnimationHandler.Play(horseAnimationHandler.GetCurrentStateId() + 1); | |
if (horseAnimationHandler.GetCurrentStateId() == 2) | |
nextButton.interactable = false; | |
} | |
public void PlayPrev() |
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 void PlayNext() | |
{ | |
HorseState currentState = horseAnimationHandler.GetCurrentState(); | |
switch (currentState) | |
{ | |
case HorseState.stillHorse: | |
case HorseState.muscleToHorse: | |
prevButton.interactable = true; | |
horseAnimationHandler.Play(HorseState.horseToMuscle.ToString()); |
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 HorseState GetCurrentState() | |
{ | |
bool parsed = false; | |
HorseState currentState; | |
foreach (string name in Enum.GetNames(typeof(HorseState))) | |
{ | |
if (_animator.GetCurrentAnimatorStateInfo(0).IsName(name)) | |
{ | |
parsed = Enum.TryParse<HorseState>(name, out currentState); |
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 class MapsAPIHandler | |
{ | |
public string googleStaticMapsAPIkey = "my_api_key"; | |
public string staticMapUrl = "https://maps.googleapis.com/maps/api/staticmap"; | |
public MapsRequest mapsRequest = new MapsRequest(); | |
//builds the API request object | |
public void GetStaticMapRequest(int width, int height) {...} | |
public IEnumerator DownloadMap(RawImage image, int width, int height) |
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 RawImage locationImage; | |
public MapsAPIHandler _mapsAPIHandler = new MapsAPIHandler(); | |
private new void OnEnable() | |
{ | |
StartCoroutine(_mapsAPIHandler.DownloadMap(locationImage, | |
(int)locationImage.rectTransform.sizeDelta.x, | |
(int)locationImage.rectTransform.sizeDelta.y)); | |
} |
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
User.INSTANCE.setName("Single Ton"); | |
User.INSTANCE.setId(666L); | |
//pretty much clear, no? |