当前位置: 首页>>代码示例>>C#>>正文


C# Spine.AnimationState类代码示例

本文整理汇总了C#中Spine.AnimationState的典型用法代码示例。如果您正苦于以下问题:C# AnimationState类的具体用法?C# AnimationState怎么用?C# AnimationState使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


AnimationState类属于Spine命名空间,在下文中一共展示了AnimationState类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: Initialize

    public override void Initialize()
    {
        base.Initialize(); // Call overridden method to initialize the skeleton.

        state = new Spine.AnimationState(skeletonDataAsset.GetAnimationStateData());
        if (_animationName != null && _animationName.Length > 0) state.SetAnimation(0, _animationName, loop);
    }
开发者ID:hzvs009,项目名称:spine-runtimes,代码行数:7,代码来源:SkeletonAnimation.cs

示例3: Entity

 public Entity(Skeleton skeleton, Vector2 position)
     : this(position)
 {
     Skeleton = skeleton;
     skeletonBoundingBox = ResourceManager.GetSkeletonBoundingBox(skeleton.Data.Name);
     AnimationState = new AnimationState(new AnimationStateData(skeleton.Data));
     RenderShadow = true;
 }
开发者ID:supermaximo93,项目名称:SuperFantasticSteampunk,代码行数:8,代码来源:Entity.cs

示例4: Reset

	public override void Reset () {
		base.Reset();
		if (!valid) return;

		state = new Spine.AnimationState(skeletonDataAsset.GetAnimationStateData());
		if (_animationName != null && _animationName.Length > 0) {
			state.SetAnimation(0, _animationName, loop);
			Update(0);
		}
	}
开发者ID:Bee-Cave-Games,项目名称:spine-runtimes,代码行数:10,代码来源:SkeletonAnimation.cs

示例5: Initialize

	override public void Initialize () {
		if (Initialized) return;

		base.Initialize();
		
		state = new Spine.AnimationState(skeletonDataAsset.GetAnimationStateData());
		if (_animationName != null && _animationName.Length > 0) state.SetAnimation(0, _animationName, loop);
	}
开发者ID:rtumelty,项目名称:toyrescuestory,代码行数:8,代码来源:SkeletonAnimation.cs

示例6: Start

	void Start () {
		// Make sure you get these AnimationState and Skeleton references in Start or Later. Getting and using them in Awake is not guaranteed by default execution order.
		skeletonAnimation = GetComponent<SkeletonAnimation>();
		spineAnimationState = skeletonAnimation.state;
		skeleton = skeletonAnimation.skeleton;

		StartCoroutine(DoDemoRoutine());
	}
开发者ID:X-Ray-Jin,项目名称:spine-runtimes,代码行数:8,代码来源:SpineBeginnerTwo.cs

示例7: SpineSkeleton

		public SpineSkeleton(string atlasName, string skeletonName, Rectangle originAndScale)
		{
			skeleton = CreateSkeleton(atlasName, skeletonName);
			skeleton.SetBonesToSetupPose();
			stateData = new AnimationStateData(skeleton.Data);
			state = new AnimationState(stateData);
			LastOriginAndScale = OriginAndScale = originAndScale;
			OnDraw<SpineRenderer>();
		}
开发者ID:whztt07,项目名称:DeltaEngine,代码行数:9,代码来源:SpineSkeleton.cs

示例8: Initialize

    /*
     */
    private void Initialize()
    {
        mesh = new Mesh();
        GetComponent<MeshFilter>().mesh = mesh;
        mesh.name = "tk2dSkeleton Mesh";
        mesh.hideFlags = HideFlags.HideAndDontSave;

        state = new Spine.AnimationState(skeletonDataAsset.GetAnimationStateData());
        skeleton = new Skeleton(skeletonDataAsset.GetSkeletonData());
    }
开发者ID:eldynguyen,项目名称:spine-runtimes,代码行数:12,代码来源:tk2dSpineSkeleton.cs

示例9: Subscribe

		void Subscribe (Spine.AnimationState state, Spine.EventData eventDataReference, bool unsubscribe) {
			if (state == null || eventDataReference == null) {
				m_WasFired = true;
			} else {
				m_AnimationState = state;
				m_TargetEvent = eventDataReference;
				state.Event += HandleAnimationStateEvent;

				m_unsubscribeAfterFiring = unsubscribe;
			}
		}
开发者ID:ClazzX1,项目名称:BussStopOCD,代码行数:11,代码来源:WaitForSpineEvent.cs

示例10: SubscribeByName

		void SubscribeByName (Spine.AnimationState state, string eventName, bool unsubscribe) {
			if (state == null || string.IsNullOrEmpty(eventName)) {
				m_WasFired = true;
			} else {
				m_AnimationState = state;
				m_EventName = eventName;
				state.Event += HandleAnimationStateEventByName;

				m_unsubscribeAfterFiring = unsubscribe;
			}
		}
开发者ID:ClazzX1,项目名称:BussStopOCD,代码行数:11,代码来源:WaitForSpineEvent.cs

示例11: SetAnimationStateData

        public void SetAnimationStateData (AnimationStateData stateData ) {
	        
	        if (stateData!=null)

	        OwnsAnimationStateData = false;
	        State = new AnimationState(stateData);
            State.Event += OnEvent;
            State.Start += OnStart;
            State.Complete += OnComplete;
            State.End += OnEnd;

        }
开发者ID:460189852,项目名称:cocos-sharp-samples,代码行数:12,代码来源:CCSkeletonAnimation.cs

示例12: 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

示例13: 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

示例14: 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

示例15: Subscribe

		void Subscribe (Spine.AnimationState state, Spine.EventData eventDataReference, bool unsubscribe) {
			#if PREUNITY_5_3
			Debug.LogWarning("Unity 5.3 or later is required for Spine Unity custom yield instructions to function correctly.");
			#endif

			if (state == null) {
				Debug.LogWarning("AnimationState argument was null. Coroutine will continue immediately.");
				m_WasFired = true;
				return;
			} else if (eventDataReference == null) {
				Debug.LogWarning("eventDataReference argument was null. Coroutine will continue immediately.");
				m_WasFired = true;
				return;
			}

			m_AnimationState = state;
			m_TargetEvent = eventDataReference;
			state.Event += HandleAnimationStateEvent;

			m_unsubscribeAfterFiring = unsubscribe;

		}
开发者ID:czlc,项目名称:spine-runtimes,代码行数:22,代码来源:WaitForSpineEvent.cs


注:本文中的Spine.AnimationState类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。