SetSlotsToSetupPose() 공개 메소드

public SetSlotsToSetupPose ( ) : void
리턴 void
예제 #1
0
        public Animation(string AnimationFile)
        {
            skeletonRenderer = new SkeletonRenderer();

            String name = AnimationFile;

            Atlas atlas = new Atlas("Data/" + name + ".atlas", new GLImpTextureLoader());
            SkeletonJson json = new SkeletonJson(atlas);
            skeleton = new Skeleton(json.ReadSkeletonData("Data/" + name + ".json"));
            skeleton.SetSlotsToSetupPose();

            // Define mixing between animations.
            stateData = new AnimationStateData(skeleton.Data);
            state = new AnimationState(stateData);
            //state.SetAnimation("idle", true);

            skeleton.X = 0;
            skeleton.Y = 0.1f;
            skeleton.UpdateWorldTransform();

            drawtime = new Stopwatch();
            drawtime.Start();

            Program.MiddleDrawQueue += Draw;
        }
예제 #2
0
        protected override void LoadContent()
        {
            skeletonRenderer = new SkeletonRenderer(GraphicsDevice);

            String name = "spineboy";             // "goblins";

            Atlas        atlas = new Atlas("data/" + name + ".atlas", new XnaTextureLoader(GraphicsDevice));
            SkeletonJson json  = new SkeletonJson(atlas);

            skeleton = new Skeleton(json.ReadSkeletonData("data/" + name + ".json"));
            if (name == "goblins")
            {
                skeleton.SetSkin("goblingirl");
            }
            skeleton.SetSlotsToSetupPose();             // Without this the skin attachments won't be attached. See SetSkin.

            // Define mixing between animations.
            AnimationStateData stateData = new AnimationStateData(skeleton.Data);

            if (name == "spineboy")
            {
                stateData.SetMix("walk", "jump", 0.2f);
                stateData.SetMix("jump", "walk", 0.4f);
            }

            state = new AnimationState(stateData);
            state.SetAnimation("walk", false);
            state.AddAnimation("jump", false);
            state.AddAnimation("walk", true);

            skeleton.RootBone.X = 320;
            skeleton.RootBone.Y = 440;
            skeleton.UpdateWorldTransform();
        }
 public AnimationPlayer(SkeletonData skeletonData)
 {
     this.skeletonData = skeletonData;
     skeleton = new Skeleton(skeletonData);
     skeleton.SetSlotsToSetupPose();
     animationDataPool = new ObjectPool<AnimationData>(() => new AnimationData(), 10);
 }
예제 #4
0
        protected override void LoadContent()
        {
            skeletonRenderer = new SkeletonRenderer(GraphicsDevice);
            skeletonRenderer.PremultipliedAlpha = true;

            String name = "spineboy";             // "goblins";

            Atlas        atlas = new Atlas("data/" + name + ".atlas", new XnaTextureLoader(GraphicsDevice));
            SkeletonJson json  = new SkeletonJson(atlas);

            skeleton = new Skeleton(json.ReadSkeletonData("data/" + name + ".json"));
            if (name == "goblins")
            {
                skeleton.SetSkin("goblingirl");
            }
            skeleton.SetSlotsToSetupPose();             // Without this the skin attachments won't be attached. See SetSkin.

            // Define mixing between animations.
            AnimationStateData stateData = new AnimationStateData(skeleton.Data);

            if (name == "spineboy")
            {
                stateData.SetMix("walk", "jump", 0.2f);
                stateData.SetMix("jump", "walk", 0.4f);
            }

            state = new AnimationState(stateData);

            if (true)
            {
                // Event handling for all animations.
                state.Start    += Start;
                state.End      += End;
                state.Complete += Complete;
                state.Event    += Event;

                state.SetAnimation(0, "drawOrder", true);
            }
            else
            {
                state.SetAnimation(0, "walk", false);
                TrackEntry entry = state.AddAnimation(0, "jump", false, 0);
                entry.End += End;                 // Event handling for queued animations.
                state.AddAnimation(0, "walk", true, 0);
            }

            skeleton.X = 320;
            skeleton.Y = 440;
            skeleton.UpdateWorldTransform();

            headSlot = skeleton.FindSlot("head");
        }
    public virtual void Initialize()
    {
        mesh = new Mesh();
        GetComponent<MeshFilter>().mesh = mesh;
        mesh.name = "Skeleton Mesh";
        mesh.hideFlags = HideFlags.HideAndDontSave;

        skeleton = new Skeleton(skeletonDataAsset.GetSkeletonData(false));

        if (initialSkinName != null && initialSkinName.Length > 0) {
            skeleton.SetSkin(initialSkinName);
            skeleton.SetSlotsToSetupPose();
        }
    }
예제 #6
0
 static int SetSlotsToSetupPose(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 1);
         Spine.Skeleton obj = (Spine.Skeleton)ToLua.CheckObject <Spine.Skeleton>(L, 1);
         obj.SetSlotsToSetupPose();
         return(0);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
예제 #7
0
파일: SpinePlayer.cs 프로젝트: hgrandry/Mgx
        public SpinePlayer(string atlasPath, string jsonPath)
        {
            Name = jsonPath;

            _skeletonRenderer = new SkeletonRenderer(Render.Device);

            var atlas = new Atlas(atlasPath, new XnaTextureLoader(Render.Device));
            var json = new SkeletonJson(atlas);

            Skeleton = new Skeleton(json.ReadSkeletonData(jsonPath));
            Skeleton.SetSlotsToSetupPose(); // Without this the skin attachments won't be attached. See SetSkin.

            var stateData = new AnimationStateData(Skeleton.Data);
            State = new AnimationState(stateData);
            IsVisible = true;
        }
예제 #8
0
        protected override void LoadContent()
        {
            Effect spriteBatchEffect = Content.Load<Effect>("SpriteBatchEffect");
            spriteBatch = new SpriteBatchEx(GraphicsDevice, spriteBatchEffect);

            Bone.yDown = true;
            skeletonData = Content.Load<SkeletonData>("spineboy/spineboy");
            skeleton = new Skeleton(skeletonData);
            skeleton.SetSlotsToSetupPose();

            AnimationStateData stateData = new AnimationStateData(skeleton.Data);
            animationState = new AnimationState(stateData);
            animationState.SetAnimation(0, "walk", true);

            skeleton.UpdateWorldTransform();
        }
예제 #9
0
    public virtual void Initialize()
    {
        mesh = new Mesh();
        GetComponent<MeshFilter>().mesh = mesh;
        mesh.name = "Skeleton Mesh";
        mesh.hideFlags = HideFlags.HideAndDontSave;
        mesh.MarkDynamic();

        renderer.sharedMaterial = skeletonDataAsset.atlasAsset.material;

        vertices = new Vector3[0];

        skeleton = new Skeleton(skeletonDataAsset.GetSkeletonData(false));

        if (initialSkinName != null && initialSkinName.Length > 0) {
            skeleton.SetSkin(initialSkinName);
            skeleton.SetSlotsToSetupPose();
        }
    }
예제 #10
0
        public Avatar(string AnimationFile)
        {
            SkeletonRenderer = new SkeletonRenderer(Vector3.UnitY, Vector3.UnitZ);

            String name = AnimationFile;

            Atlas atlas = new Atlas(name + ".atlas", new OpenTKTextureLoader());
            SkeletonJson json = new SkeletonJson(atlas);
            Skeleton = new Skeleton(json.ReadSkeletonData(name + ".json"));
            Skeleton.SetSlotsToSetupPose();

            // Define mixing between animations.
            StateData = new AnimationStateData(Skeleton.Data);
            State = new AnimationState(StateData);

            Skeleton.X = 0;
            Skeleton.Y = 0;
            Skeleton.UpdateWorldTransform();
        }
예제 #11
0
        protected override void LoadContent()
        {
            skeletonRenderer = new SkeletonRenderer(GraphicsDevice);

            String name = "spineboy"; // "goblins";

            Atlas atlas = new Atlas("data/" + name + ".atlas", new XnaTextureLoader(GraphicsDevice));
            SkeletonJson json = new SkeletonJson(atlas);
            skeleton = new Skeleton(json.ReadSkeletonData("data/" + name + ".json"));
            if (name == "goblins") skeleton.SetSkin("goblingirl");
            skeleton.SetSlotsToSetupPose(); // Without this the skin attachments won't be attached. See SetSkin.

            // Define mixing between animations.
            AnimationStateData stateData = new AnimationStateData(skeleton.Data);
            if (name == "spineboy") {
                stateData.SetMix("walk", "jump", 0.2f);
                stateData.SetMix("jump", "walk", 0.4f);
            }

            state = new AnimationState(stateData);

            if (true) {
                // Event handling for all animations.
                state.Start += new EventHandler(Start);
                state.End += new EventHandler(End);
                state.Complete += new EventHandler<CompleteArgs>(Complete);
                state.Event += new EventHandler<EventTriggeredArgs>(Event);

                state.SetAnimation("drawOrder", true);
            } else {
                state.SetAnimation("walk", false);
                QueueEntry entry = state.AddAnimation("jump", false);
                entry.End += new EventHandler(End); // Event handling for queued animations.
                state.AddAnimation("walk", true);
            }

            skeleton.X = 320;
            skeleton.Y = 440;
            skeleton.UpdateWorldTransform();

            headSlot = skeleton.FindSlot("head");
        }
예제 #12
0
    public virtual void Initialize()
    {
        if (Initialized) return;

        meshFilter = GetComponent<MeshFilter>();
        mesh1 = newMesh();
        mesh2 = newMesh();

        vertices = new Vector3[0];

        skeleton = new Skeleton(skeletonDataAsset.GetSkeletonData(false));

        if (initialSkinName != null && initialSkinName.Length > 0 && initialSkinName != "default") {
            skeleton.SetSkin(initialSkinName);
            skeleton.SetSlotsToSetupPose();
        }
    }
예제 #13
0
        public void Load()
        {
            mSkeletonRenderer = new SkeletonRenderer(EngineSettings.Graphics.GraphicsDevice);
            mBounds = new SkeletonBounds();

            mSkeleton = SpineDataManager.Instance.NewSkeleton(mName, mScale); //Fixed Scale from here. Main instanciation.
            mSkeleton.SetSlotsToSetupPose(); // Without this the skin attachments won't be attached. See SetSkin.
            mAnimationState = SpineDataManager.Instance.NewAnimationState(mSkeleton.Data);
            mSkeleton.X = mInitPosition.X;
            mSkeleton.Y = mInitPosition.Y;
        }
예제 #14
0
        protected override void LoadContent()
        {
            skeletonRenderer = new SkeletonRenderer(GraphicsDevice);

            String name = "spineboy"; // "goblins";

            Atlas atlas = new Atlas("data/" + name + ".atlas", new XnaTextureLoader(GraphicsDevice));
            SkeletonJson json = new SkeletonJson(atlas);
            skeleton = new Skeleton(json.ReadSkeletonData("data/" + name + ".json"));
            if (name == "goblins") skeleton.SetSkin("goblingirl");
            skeleton.SetSlotsToSetupPose(); // Without this the skin attachments won't be attached. See SetSkin.

            // Define mixing between animations.
            AnimationStateData stateData = new AnimationStateData(skeleton.Data);
            if (name == "spineboy") {
                stateData.SetMix("walk", "jump", 0.2f);
                stateData.SetMix("jump", "walk", 0.4f);
            }

            state = new AnimationState(stateData);
            state.SetAnimation("walk", false);
            state.AddAnimation("jump", false);
            state.AddAnimation("walk", true);

            skeleton.RootBone.X = 320;
            skeleton.RootBone.Y = 440;
            skeleton.UpdateWorldTransform();
        }