public void PlayAnim(ECS_UnitAnimType.TypeEnum ecsUnitAnimTypeEnum, UnitAnim.AnimDir animDir, bool forced, Skeleton_Anim_OnComplete onComplete) { this.ecsUnitAnimTypeEnum = ecsUnitAnimTypeEnum; this.animDir = animDir; this.forced = forced; this.onComplete = onComplete; }
public static void PlayAnimForced(Entity entity, ECS_UnitAnimType.TypeEnum ecsUnitAnimTypeEnum, Vector3 dir, Skeleton_Anim_OnComplete onComplete) { UnitAnim.AnimDir animDir = GetAnimDir(dir); PlayAnimForced(entity, ecsUnitAnimTypeEnum, animDir, onComplete); }
public void PlayAnimForced(ECS_UnitAnimType.TypeEnum ecsUnitAnimTypeEnum, float3 dir, Skeleton_Anim_OnComplete onComplete) { PlayAnim(ecsUnitAnimTypeEnum, ECS_Animation.GetAnimDir(dir), true, onComplete); }
public void PlayAnimForced(ECS_UnitAnimType.TypeEnum ecsUnitAnimTypeEnum, UnitAnim.AnimDir animDir, Skeleton_Anim_OnComplete onComplete) { PlayAnim(ecsUnitAnimTypeEnum, animDir, true, onComplete); }
public static void PlayAnim(Entity entity, ECS_UnitAnimType.TypeEnum ecsUnitAnimTypeEnum, Vector3 dir, Skeleton_Anim_OnComplete onComplete) { Skeleton_Data skeletonData = World.Active.EntityManager.GetComponentData <Skeleton_Data>(entity); PlayAnim(entity, skeletonData, ecsUnitAnimTypeEnum, GetAnimDir(dir), onComplete); }
public static void PlayAnim(Entity entity, Skeleton_Data skeletonData, ECS_UnitAnimType.TypeEnum ecsUnitAnimTypeEnum, UnitAnim.AnimDir animDir, Skeleton_Anim_OnComplete onComplete) { if (IsAnimDifferentFromActive(skeletonData, ecsUnitAnimTypeEnum, animDir)) { PlayAnimForced(entity, ecsUnitAnimTypeEnum, animDir, onComplete); } }
public static void PlayAnimJobs(Entity entity, int index, EntityCommandBuffer.Concurrent entityCommandBuffer, Skeleton_Data skeletonData, ECS_UnitAnimType.TypeEnum ecsUnitAnimTypeEnum, UnitAnim.AnimDir animDir, Skeleton_Anim_OnComplete onComplete) { if (IsAnimDifferentFromActive(skeletonData, ecsUnitAnimTypeEnum, animDir)) { // Different from current, play anim PlayAnimForcedJobs(entity, index, entityCommandBuffer, ecsUnitAnimTypeEnum, animDir, onComplete); } }
public static void PlayAnimJobs(Entity entity, int index, EntityCommandBuffer.Concurrent entityCommandBuffer, Skeleton_Data skeletonData, ECS_UnitAnimType.TypeEnum ecsUnitAnimTypeEnum, Vector3 dir, Skeleton_Anim_OnComplete onComplete) { PlayAnimJobs(entity, index, entityCommandBuffer, skeletonData, ecsUnitAnimTypeEnum, GetAnimDir(dir), onComplete); }
public static Skeleton_Data GetSkeletonData(ECS_UnitAnimType.TypeEnum ecsUnitAnimTypeEnum, UnitAnim.AnimDir animDir, Skeleton_Anim_OnComplete onComplete) { ECS_UnitAnimType ecsUnitAnimType = ECS_UnitAnimType.Get(ecsUnitAnimTypeEnum); ECS_UnitAnim ecsUnitAnim = ecsUnitAnimType.GetUnitAnim(animDir); return (new Skeleton_Data { frameCount = ecsUnitAnim.GetFrameCount(), currentFrame = 0, loopCount = 0, frameTimer = 0f, frameRate = ecsUnitAnim.GetFrameRate(), activeUnitAnimTypeEnum = ecsUnitAnimTypeEnum, activeAnimDir = animDir, onComplete = onComplete, }); }
public static void PlayAnimForcedJobs(Entity entity, int index, EntityCommandBuffer.Concurrent entityCommandBuffer, ECS_UnitAnimType.TypeEnum ecsUnitAnimTypeEnum, UnitAnim.AnimDir animDir, Skeleton_Anim_OnComplete onComplete) { Skeleton_Data skeletonData = GetSkeletonData(ecsUnitAnimTypeEnum, animDir, onComplete); entityCommandBuffer.SetComponent(index, entity, skeletonData); if (skeletonData.frameRate <= 0) { Debug.LogError("#################### FRAMERATE ZERO!"); } }
public static void PlayAnimForced(Entity entity, ECS_UnitAnimType.TypeEnum ecsUnitAnimTypeEnum, UnitAnim.AnimDir animDir, Skeleton_Anim_OnComplete onComplete) { Skeleton_Data skeletonData = GetSkeletonData(ecsUnitAnimTypeEnum, animDir, onComplete); World.Active.EntityManager.SetComponentData(entity, skeletonData); if (skeletonData.frameRate <= 0) { Debug.LogError("#################### FRAMERATE ZERO!"); } }