예제 #1
0
        public static void LoadDataFromAnimationHelpers()
        {
            AnimationGroupList sceneAnimationGroupList = new AnimationGroupList();

            sceneAnimationGroupList.LoadFromData();

            foreach (IINode node in Loader.Core.RootNode.DirectChildren())
            {
                if (node.IsBabylonAnimationHelper())
                {
                    AnimationGroupList helperAnimationGroupList = new AnimationGroupList();
                    helperAnimationGroupList.LoadFromData(node);

                    //merge
                    foreach (AnimationGroup animationGroup in helperAnimationGroupList)
                    {
                        AnimationGroup toMerge = sceneAnimationGroupList.Find(a => a.Name == animationGroup.Name);
                        if (toMerge != null)
                        {
                            toMerge.MergeFrom(animationGroup);
                        }
                        else
                        {
                            AnimationGroup newAnimationGroup = new AnimationGroup();
                            newAnimationGroup.DeepCopyFrom(animationGroup);
                            sceneAnimationGroupList.Add(newAnimationGroup);
                        }
                    }
                }
            }
            sceneAnimationGroupList.SaveToData();
            Loader.Global.SetSaveRequiredFlag(true, false);
        }