public static void Init()
        {
            unitAnimMeshListDic      = new Dictionary <ECS_UnitAnim, List <Mesh> >();
            unitAnimDictionaryKeyDic = new Dictionary <DictionaryKey, ECS_UnitAnim>();

            foreach (ECS_UnitAnimType ecsUnitAnimType in ECS_UnitAnimType.GetUnitAnimTypeList())
            {
                foreach (UnitAnim.AnimDir animDir in System.Enum.GetValues(typeof(UnitAnim.AnimDir)))
                {
                    ECS_UnitAnim ecsUnitAnim = ecsUnitAnimType.GetUnitAnim(animDir);
                    unitAnimDictionaryKeyDic[new DictionaryKey {
                                                 ecsUnitAnimTypeEnum = ecsUnitAnimType.GetTypeEnum(),
                                                 animDir = animDir
                                             }] = ecsUnitAnim;

                    unitAnimMeshListDic[ecsUnitAnim] = new List <Mesh>();

                    int frameCount = ecsUnitAnim.GetFrameCount();

                    for (int i = 0; i < frameCount; i++)
                    {
                        Mesh mesh = ECS_Animation.CreateMesh(ecsUnitAnim, i);
                        unitAnimMeshListDic[ecsUnitAnim].Add(mesh);
                    }
                }
            }
        }
Ejemplo n.º 2
0
 public void Execute(Entity entity, int index, ref Skeleton_Data skeletonData, ref Skeleton_PlayAnim skeletonPlayAnim) {
     if (skeletonPlayAnim.forced) {
         skeletonPlayAnim.forced = false;
         ECS_Animation.PlayAnimForcedJobs(entity, index, entityCommandBuffer, skeletonPlayAnim.ecsUnitAnimTypeEnum, skeletonPlayAnim.animDir, skeletonPlayAnim.onComplete);
     } else {
         ECS_Animation.PlayAnimJobs(entity, index, entityCommandBuffer, skeletonData, skeletonPlayAnim.ecsUnitAnimTypeEnum, skeletonPlayAnim.animDir, skeletonPlayAnim.onComplete);
     }
 }
        public static void Init()
        {
            unitAnimTypeDic  = new Dictionary <TypeEnum, ECS_UnitAnimType>();
            unitAnimTypeList = new List <ECS_UnitAnimType>();

            foreach (TypeEnum typeEnum in System.Enum.GetValues(typeof(TypeEnum)))
            {
                ECS_UnitAnimType ecsUnitAnimType = ECS_Animation.ConvertVAnimToAnim(typeEnum);
                unitAnimTypeDic[typeEnum] = ecsUnitAnimType;
                unitAnimTypeList.Add(ecsUnitAnimType);
            }

            ECS_UnitAnim.Init();
        }
 public void PlayAnimForced(ECS_UnitAnimType.TypeEnum ecsUnitAnimTypeEnum, float3 dir, Skeleton_Anim_OnComplete onComplete)
 {
     PlayAnim(ecsUnitAnimTypeEnum, ECS_Animation.GetAnimDir(dir), true, onComplete);
 }
 public static Skeleton_Anim_OnComplete Create(ECS_UnitAnimType.TypeEnum unitAnimTypeEnum, float3 dir)
 {
     return(Create(unitAnimTypeEnum, ECS_Animation.GetAnimDir(dir)));
 }