コード例 #1
0
        public void writeAnimationModel(AnimationsModel animationsModel)
        {
            var settings = new JsonSerializerSettings {
                Formatting = Formatting.Indented
            };
            string jsonString = Newtonsoft.Json.JsonConvert.SerializeObject(animationsModel, settings);

            System.IO.File.WriteAllText(GetAnimationModelExportPath(), jsonString);
        }
コード例 #2
0
        public void ExportPersoStatesAnimations()
        {
            var             jsonAnimationDataFileWriter = new JSONAnimationDataFileWriter();
            AnimationsModel animationsModel             = new AnimationsModel();

            foreach (var animationClip in persoAnimationStatesDataManipulator.IterateAnimationClips())
            {
                Debug.Log("Animation Clip: " + animationClip.Name);
                foreach (var animationKeyframe in animationClip.IterateKeyframes())
                {
                    animationsModel.addAnimationFrameModelToAnimationClip(
                        animationClip.Name, animationKeyframe.GetAnimationFrameModel(), animationKeyframe.FrameNumber);
                }
            }
            jsonAnimationDataFileWriter.writeAnimationModel(animationsModel);
        }
コード例 #3
0
        void ItemChanged()
        {
            if (model != null)
            {
                model.CustomSelectionChanged -= Model_SelectedChanged;
            }

            var title = segmentedControl.TitleAt(segmentedControl.SelectedSegment);

            currentAgent = new Agent(title);
            agentView.ConfigureAgent(currentAgent);
            currentAgent.Animate();

            animations       = currentAgent.GetAnimations();
            model            = new AnimationsModel(animations);
            pickerView.Model = model;
            pickerView.ReloadAllComponents();
            model.CustomSelectionChanged += Model_SelectedChanged;
        }