Esempio n. 1
0
            public ChildMotionJson(ChildMotion childMotion, Urho3DEngine engine, PrefabContext prefabContext)
            {
                this.cycleOffset = childMotion.cycleOffset;
                var motion = childMotion.motion;

                if (motion is AnimationClip animationClip)
                {
                    this.animationClip = engine.EvaluateAnimationName(animationClip, prefabContext);
                    engine.ScheduleAssetExport(animationClip, prefabContext);
                }
                else if (motion is BlendTree blendTree)
                {
                    this.hasBlendTree = true;
                    this.blendTree    = new BlendTreeJson(blendTree, engine, prefabContext);
                }
            }
Esempio n. 2
0
            public StateJson(AnimatorState state, Urho3DEngine engine, PrefabContext prefabContext)
            {
                this.name = engine.DecorateName(state.name);
                // this.speed = state.speed;
                // this.cycleOffset = state.cycleOffset;
                var motion = state.motion;

                if (motion is AnimationClip animationClip)
                {
                    // this.animationClip = engine.EvaluateAnimationName(animationClip, prefabContext);
                    engine.ScheduleAssetExport(animationClip, prefabContext);
                }
                else if (motion is BlendTree blendTree)
                {
                    // this.hasBlendTree = true;
                    // this.blendTree = new BlendTreeJson(blendTree, engine, prefabContext);
                }

                transitions = state.transitions.Select(_ => new TransitionJson(_, engine, prefabContext)).ToArray();
            }