コード例 #1
0
 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;
 }
コード例 #2
0
 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);
 }
コード例 #3
0
 public void PlayAnimForced(ECS_UnitAnimType.TypeEnum ecsUnitAnimTypeEnum, float3 dir, Skeleton_Anim_OnComplete onComplete)
 {
     PlayAnim(ecsUnitAnimTypeEnum, ECS_Animation.GetAnimDir(dir), true, onComplete);
 }
コード例 #4
0
 public void PlayAnimForced(ECS_UnitAnimType.TypeEnum ecsUnitAnimTypeEnum, UnitAnim.AnimDir animDir, Skeleton_Anim_OnComplete onComplete)
 {
     PlayAnim(ecsUnitAnimTypeEnum, animDir, true, onComplete);
 }
コード例 #5
0
        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);
        }
コード例 #6
0
 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);
     }
 }
コード例 #7
0
 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);
     }
 }
コード例 #8
0
 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);
 }
コード例 #9
0
        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,
            });
        }
コード例 #10
0
        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!");
            }
        }
コード例 #11
0
        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!");
            }
        }