Пример #1
0
        private static ArmatureData parseArmatureData(Dictionary <String, Object> armatureObject, SkeletonData data, uint frameRate)
        {
            ArmatureData armatureData = new ArmatureData();

            armatureData.Name = armatureObject[ConstValues.A_NAME] as String;

            //Logger.Log("ObjectDataParser::: " + armatureObject[ConstValues.BONE].ToString());
            foreach (Dictionary <String, Object> boneObject in armatureObject[ConstValues.BONE] as List <object> )
            {
                armatureData.AddBoneData(parseBoneData(boneObject as Dictionary <string, object>));
            }

            foreach (Dictionary <String, Object> skinObject in armatureObject[ConstValues.SKIN] as List <object> )
            {
                armatureData.AddSkinData(parseSkinData(skinObject as Dictionary <string, object>, data));
            }

            DBDataUtil.TransformArmatureData(armatureData);
            armatureData.SortBoneDataList();

            foreach (Dictionary <String, Object> animationObject in armatureObject[ConstValues.ANIMATION] as List <object> )
            {
                armatureData.AddAnimationData(parseAnimationData(animationObject as Dictionary <string, object>, armatureData, frameRate));
            }

            return(armatureData);
        }
Пример #2
0
 /// <summary>
 /// 初始化所有Db数据到缓存中
 /// </summary>
 public void initDbData()
 {
     m_BB   = DBDataUtil.getInstance().GetAllDataFromDB <bbase>(new bbase(), "bbase");
     m_BP   = DBDataUtil.getInstance().GetAllDataFromDB <BuildingPos>(new BuildingPos(), "bpos");
     m_Item = DBDataUtil.getInstance().GetAllDataFromDB <Item>(new Item(), "item");
     m_BI   = DBDataUtil.getInstance().GetAllDataFromDB <BuildingInfo>(new BuildingInfo(), "binfo");
 }
Пример #3
0
 public SQLiteDataManager(string persistentFilePath)
 {
     this.persistentFilePath = persistentFilePath;
     DBDataUtil.getInstance().setPerSistentPath(persistentFilePath);
     Debug.Log("persistentFilePath---=" + persistentFilePath);
     initDbData();
 }
Пример #4
0
 public static DBDataUtil getInstance()
 {
     if (instance == null)
     {
         instance = new DBDataUtil();
     }
     return(instance);
 }
Пример #5
0
        private static AnimationData parseAnimationData(Dictionary <String,Object> animationObject,ArmatureData armatureData,uint frameRate)
        {
            AnimationData animationData = new AnimationData();

            animationData.Name      = animationObject[ConstValues.A_NAME] as String;
            animationData.FrameRate = (uint)frameRate;

            animationData.Loop       = int.Parse(animationObject[ConstValues.A_LOOP].ToString());
            animationData.FadeInTime = (float)animationObject[ConstValues.A_FADE_IN_TIME];
            animationData.Duration   = (float)animationObject [ConstValues.A_DURATION] / frameRate;
            animationData.Scale      = (float)animationObject[ConstValues.A_SCALE];

            if (animationObject.ContainsKey(ConstValues.A_TWEEN_EASING))
            {
                Object tweenEase = animationObject[ConstValues.A_TWEEN_EASING];
                if (
                    tweenEase == null
                    )
                {
                    animationData.TweenEasing = float.NaN;
                }
                else
                {
                    animationData.TweenEasing = (float)tweenEase;
                }
            }
            else
            {
                animationData.TweenEasing = float.NaN;
            }

            parseTimeline(animationObject as Dictionary <string,object>,animationData,parseMainFrame,frameRate);

            TransformTimeline timeline;
            string            timelineName;

            foreach (Dictionary <String,Object> timelineObject in animationObject[ConstValues.TIMELINE] as List <object> )
            {
                timeline     = parseTransformTimeline(timelineObject as Dictionary <string,object>,animationData.Duration,frameRate);
                timelineName = (timelineObject as Dictionary <string,object>)[ConstValues.A_NAME] as String;
                animationData.AddTimeline(timeline,timelineName);
            }

            DBDataUtil.AddHideTimeline(animationData,armatureData);
            DBDataUtil.TransformAnimationData(animationData,armatureData);

            return(animationData);
        }