當前位置: 首頁>>代碼示例>>C#>>正文


C# Skeleton.SetSlotsToSetupPose方法代碼示例

本文整理匯總了C#中Spine.Skeleton.SetSlotsToSetupPose方法的典型用法代碼示例。如果您正苦於以下問題:C# Skeleton.SetSlotsToSetupPose方法的具體用法?C# Skeleton.SetSlotsToSetupPose怎麽用?C# Skeleton.SetSlotsToSetupPose使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Spine.Skeleton的用法示例。


在下文中一共展示了Skeleton.SetSlotsToSetupPose方法的11個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: Animation

        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;
        }
開發者ID:CloneDeath,項目名稱:PokemonSmash,代碼行數:25,代碼來源:Animation.cs

示例2: AnimationPlayer

 public AnimationPlayer(SkeletonData skeletonData)
 {
     this.skeletonData = skeletonData;
     skeleton = new Skeleton(skeletonData);
     skeleton.SetSlotsToSetupPose();
     animationDataPool = new ObjectPool<AnimationData>(() => new AnimationData(), 10);
 }
開發者ID:ThirdPartyNinjas,項目名稱:NinjaSharp,代碼行數:7,代碼來源:AnimationPlayer.cs

示例3: Initialize

    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();
        }
    }
開發者ID:antonholmquist,項目名稱:spine-runtimes,代碼行數:14,代碼來源:SkeletonComponent.cs

示例4: SpinePlayer

        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;
        }
開發者ID:hgrandry,項目名稱:Mgx,代碼行數:16,代碼來源:SpinePlayer.cs

示例5: LoadContent

        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();
        }
開發者ID:ThirdPartyNinjas,項目名稱:NinjaSharp,代碼行數:16,代碼來源:TestGame.cs

示例6: Initialize

    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();
        }
    }
開發者ID:sominha,項目名稱:spine-runtimes,代碼行數:19,代碼來源:SkeletonComponent.cs

示例7: Avatar

        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();
        }
開發者ID:CloneDeath,項目名稱:spine-runtimes,代碼行數:19,代碼來源:Avatar.cs

示例8: LoadContent

        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");
        }
開發者ID:jaimeBokoko,項目名稱:spine-runtimes,代碼行數:42,代碼來源:ExampleGame.cs

示例9: Initialize

    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();
        }
    }
開發者ID:netonjm,項目名稱:spine-runtimes,代碼行數:17,代碼來源:SkeletonComponent.cs

示例10: Load

        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;
        }
開發者ID:jrichter42,項目名稱:KryptonEngine,代碼行數:11,代碼來源:SpineObject.cs

示例11: LoadContent

        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();
        }
開發者ID:kamaliang,項目名稱:spine-runtimes,代碼行數:28,代碼來源:ExampleGame.cs


注:本文中的Spine.Skeleton.SetSlotsToSetupPose方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。