public void WebJsonAnimationLoader(string animationJson) { if (_currentCoroutine != null) { StopCoroutine(_currentCoroutine); } RemoveCharacter(); _currentSequenceIndex = -1; _currentCoroutine = null; _currentHotspotAnimation = JsonConvert.DeserializeObject <HotspotAnimation>(animationJson); GoToNextSequence(); }
/// <summary> /// Get fired once an image has been tracked. /// </summary> /// <returns></returns> private IEnumerator OnTracked() { //Set the current sequence index to -1. _currentSequenceIndex = -1; _currentCoroutine = null; ShowNextSequenceButton(true); ShowFastForwardButton(false); ShowRestartSequenceButton(false); ShowPauseSequenceButton(false); ShowResumeSequenceButton(false); yield return(StartCoroutine(LoadAnimationPropertiesFromServer())); if (_loadedAnimationFile.text == "") { //Debug.Log("Warning, file is empty"); _loadedAnimationFile = animationFile; //yield break; } _currentHotspotAnimation = JsonConvert.DeserializeObject <HotspotAnimation>(_loadedAnimationFile.text); GoToNextSequence(); }