public override void OnStart() { if (targetGameObject.Value == null) { targetGameObject.Value = this.gameObject; } var currentGameObject = GetDefaultGameObject(targetGameObject.Value); if (currentGameObject != prevGameObject) { animation = currentGameObject.GetComponentInChildren <SpineItem>(); prevGameObject = currentGameObject; } animDureTime = 0f; if (!isMonsterSharedBool.Value) { animation.SetSpinePlayAnim(JoyNameType.AttackJoy, prevGameObject.transform.localEulerAngles.y, animationSpeed.Value); } else { if (string.IsNullOrEmpty(animationName.Value)) { Debug.LogWarning("animationName is null"); } else { animation.SetMonsterAnim(animationName.Value, prevGameObject.transform.localEulerAngles.y, animationLoop.Value, animationSpeed.Value); animDureTime = animation.GetAnimTime(animationName.Value); } } }
public async Task LoadContentAsync(SpineItem spineItem) { _currentSpineItem = spineItem; var contents = Source.GetContents(spineItem, true, true); // var stylesheetLocations = GetStylesheetLocations(contents, Source.Manifest[spineItem.IdRef].ContentLocation); await LoadContentAsync(contents, new string[0]); }
public static SpineItem Next(this Spine spine, SpineItem item) { var index = spine.IndexOf(item); if (index + 1 < spine.Count) { return(spine.ElementAt(index + 1)); } return(null); }
public static SpineItem Previous(this Spine spine, SpineItem item) { var index = spine.IndexOf(item); if (index - 1 > 0) { return(spine.ElementAt(index - 1)); } return(null); }
public async Task LoadContentAsync(NavPoint navPoint) { var fileName = Path.GetFileName(navPoint.ContentPath); var manifestItem = Source.Manifest.FirstOrDefault(a => { var itemFileName = Path.GetFileName(a.Value.ContentLocation); return(itemFileName == fileName); }); _currentSpineItem = Source.Spine.FirstOrDefault(a => a.IdRef == manifestItem.Key); var contents = Source.GetContents(navPoint, true, true); // var stylesheetLocations = GetStylesheetLocations(contents, navPoint.ContentPath); await LoadContentAsync(contents, new string[0]); }
public async Task LoadContentAsync(SpineItem spineItem) { _currentSpineItem = spineItem; var contents = await Source.GetContentsAsync(spineItem); var stylesheetLocations = GetStylesheetLocations(contents, Source.Manifest[spineItem.IdRef].ContentLocation); var css = string.Empty; foreach (var location in stylesheetLocations) { var file = await Source.GetFileAsync(location); css += $"\r{await FileIO.ReadTextAsync(file)}"; } _converter.Convert(contents, css); }
public async Task LoadContentAsync(NavPoint navPoint) { var manifestItem = Source.Manifest.FirstOrDefault(a => Path.GetFileName(a.Value.ContentLocation) == Path.GetFileName(navPoint.ContentPath)); _currentSpineItem = Source.Spine.FirstOrDefault(a => a.IdRef == manifestItem.Key); var contents = await Source.GetContentsAsync(navPoint); var stylesheetLocations = GetStylesheetLocations(contents, navPoint.ContentPath); var css = string.Empty; foreach (var location in stylesheetLocations) { var file = await Source.GetFileAsync(location); css += $"\r{await FileIO.ReadTextAsync(file)}"; } _converter.Convert(contents, css); }