• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# Spine类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



Spine类属于命名空间,在下文中一共展示了Spine类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: WaitForSpineAnimationComplete

		public WaitForSpineAnimationComplete (Spine.TrackEntry trackEntry) {
			#if PREUNITY_5_3
			Debug.LogWarning("Unity 5.3 or later is required for Spine Unity custom yield instructions to function correctly.");
			#endif

			SafeSubscribe(trackEntry);
		}
开发者ID:czlc,项目名称:spine-runtimes,代码行数:7,代码来源:WaitForSpineAnimationComplete.cs


示例2: HandleEvent

	void HandleEvent (Spine.AnimationState state, int trackIndex, Spine.Event e) {
		//play some sound if footstep event fired
		if (e.Data.Name == footstepEventName) {
			footstepAudioSource.Stop();
			footstepAudioSource.Play();
		}
	}
开发者ID:fiskercui,项目名称:unity,代码行数:7,代码来源:BasicPlatformerController.cs


示例3: Event

    // DEFINE EVENT FUNCTIONS ---------------------------------------------------------------
    public void Event(Spine.AnimationState state, int trackIndex, Spine.Event e)
    {
        //Debug.Log(trackIndex + " " + state.GetCurrent(trackIndex) + ": event " + e + ", " + e.Int);

        // EVENT LISTENER
        switch (e.ToString()) {
            case "footstep" :
                fxFootstep.Play();
                break;
            case "charge" :
                if (charging) {
                    // CHARGE END
                    fxCharge.Stop();
                    charging = false;
                    cancelable = false;
                } else {
                    // START CHARGING
                    fxCharge.Play();
                    charging = true;
                }
                break;
            case "recovery" :
                cancelable = true;
                break;
        }
    }
开发者ID:VQZX,项目名称:TAG,代码行数:27,代码来源:SpineController1.cs


示例4: CreateAniResOrOther

    public static GameObject CreateAniResOrOther(string prefabPath, Subject2 owner, UserTriggerDelegate handleFunc, Spine.AnimationState.EventDelegate spineEvent)
    {
        GameObject gameObject = null;
        if (!string.IsNullOrEmpty(prefabPath))
        {
            gameObject = RecycleManager.Instance.Instantiate(prefabPath);

            if (gameObject != null)
            {
                AniResource aniRes = gameObject.GetComponent<AniResource>();
                if (aniRes != null)
                {
                    aniRes.owner = owner as Automaton;
                    aniRes.RegisterUserTriggerDelegate(handleFunc, spineEvent);
                }
            }

            if (gameObject == null)
            {
                Debug.LogWarning("prefabPath null: [" + prefabPath + "]");

                CubeTile.E_Pivot pivot = CubeTile.E_Pivot.BC;
                if (owner is Projectile)
                {
                    pivot = CubeTile.E_Pivot.MC;
                }
                gameObject = CubeTile.Create(pivot).gameObject;
                gameObject.transform.localScale = new Vector3(owner.Rect.width, owner.Rect.height, 0);
            }
        }
        return gameObject;
    }
开发者ID:pb0,项目名称:ID0_Test,代码行数:32,代码来源:AniResource.cs


示例5: Event

    public void Event(Spine.AnimationState state, int trackIndex, Spine.Event e)
    {
        // DEBUG event display
        debug_Event.text = e.ToString();
        debug_Event.fontSize = debug_Event.fontSize != 20 ? 20 : 15;
        //Debug.Log(trackIndex + " " + state.GetCurrent(trackIndex) + ": event " + e + ", " + e.Int);

        // EVENT LISTENER
        switch (e.ToString()) {
            case "footstep" :
                fxFootstep.Play();
                break;
            case "charge" :
                if (charging) {
                    // charge end
                    fxCharge.Stop();
                    charging = false;
                    cancelable = false;
                } else {
                    // start charging
                    fxCharge.Play();
                    charging = true;
                }
                break;
            case "recovery" :
                cancelable = true;
                break;
        }
    }
开发者ID:VQZX,项目名称:TAG,代码行数:29,代码来源:BattleInputController.cs


示例6: HandleEvent

 void HandleEvent(Spine.AnimationState state, int trackIndex, Spine.Event e)
 {
     if (e.Data.Name == groundcollide) {
         stepsound.Stop();
         stepsound.Play();
     }
 }
开发者ID:ArtofDrawingSwords,项目名称:GameofTheYear,代码行数:7,代码来源:Controller.cs


示例7: HandleEvent

 void HandleEvent(Spine.AnimationState state, int trackIndex, Spine.Event e)
 {
     if (e.Data.Name == footstepEvent) {
         footstepAudioSource.pitch = 0.5f + Random.Range(-0.2f, 0.2f);
         footstepAudioSource.Play();
     }
 }
开发者ID:WaveEngine,项目名称:spine-runtimes,代码行数:7,代码来源:Raptor.cs


示例8: EndEvent

 void EndEvent(Spine.AnimationState state, int trackIndex )
 {
     //		ZuDebug.Log ("EndEvent name = " + state );
     //		if( PLAYER_ATK_ANIN == state.ToString() )
     //		{
     //			//SetIdle ();
     //		}
 }
开发者ID:yanzuzu,项目名称:GreekBasketball,代码行数:8,代码来源:PlayerController.cs


示例9: GetAttachment

        public static Spine.Attachment GetAttachment(string attachmentPath, Spine.SkeletonData skeletonData)
        {
            var hierarchy = SpineAttachment.GetHierarchy(attachmentPath);
            if (hierarchy.name == "")
                return null;

            return skeletonData.FindSkin(hierarchy.skin).GetAttachment(skeletonData.FindSlotIndex(hierarchy.slot), hierarchy.name);
        }
开发者ID:yamido001,项目名称:spine-runtimes,代码行数:8,代码来源:SpineAttributes.cs


示例10: state_End

 //void state_Event(Spine.AnimationState state, int trackIndex, Spine.Event e)
 //{
 //    if (e + "" == "zhongjian")
 //    {
 //        Debug.Log("zhongjian!");
 //        Instantiate(m_arrowArea, new Vector2(0, 0), Quaternion.Euler(0, 0, 0));
 //        return;
 //    }
 //    if (e + "" == "tankai" )
 //    {
 //        isCheckBlock = true;
 //        checkTime = 0.05f;
 //        //try
 //        //{
 //        //    m_hit = Physics2D.Linecast(this.transform.position, playerObj.transform.position, 1 << LayerMask.NameToLayer("Block"));
 //        //    if (m_hit)
 //        //    {
 //        //        Debug.Log("block my arrow");
 //        //        beenBlock();
 //        //    }
 //        //}
 //        //catch {
 //        //    // exception
 //        //}
 //    }
 //}
 void state_End(Spine.AnimationState state, int trackIndex)
 {
     if (state.GetCurrent(trackIndex) + "" == "animation") {
         Instantiate(m_arrowStand, new Vector2(4.2f , 4.7f), Quaternion.Euler(0, 0, 0));
         m_audioManager.archerkill();
         Destroy(this.gameObject);
     }
 }
开发者ID:Venbb,项目名称:Games,代码行数:34,代码来源:ArcherManager.cs


示例11: SafeSubscribe

		void SafeSubscribe (Spine.TrackEntry trackEntry) {
			if (trackEntry == null) {
				// Break immediately if trackEntry is null.
				m_WasFired = true;
			} else {
				// Function normally.
				trackEntry.Complete += HandleComplete;
			}
		}
开发者ID:ClazzX1,项目名称:BussStopOCD,代码行数:9,代码来源:WaitForSpineAnimationComplete.cs


示例12: state_End

 void state_End(Spine.AnimationState state, int trackIndex)
 {
     if (state.GetCurrent(trackIndex) + "" == "animation") {
         changeAniamtion = true;
     }
     if (state.GetCurrent(trackIndex) + "" == "animation3") {
         Destroy(this.gameObject);
     }
 }
开发者ID:Venbb,项目名称:Games,代码行数:9,代码来源:CloudEffectManager.cs


示例13: SafeSubscribe

		void SafeSubscribe (Spine.TrackEntry trackEntry) {
			if (trackEntry == null) {
				// Break immediately if trackEntry is null.
				Debug.LogWarning("TrackEntry was null. Coroutine will continue immediately.");
				m_WasFired = true;
			} else {
				trackEntry.End += HandleEnd;
			}
		}
开发者ID:EsotericSoftware,项目名称:spine-runtimes,代码行数:9,代码来源:WaitForSpineTrackEntryEnd.cs


示例14: state_End

 void state_End(Spine.AnimationState state, int trackIndex)
 {
     if (state.GetCurrent(trackIndex) + "" == "zoom_out2")
     {
         bgAnimationScript.state.SetAnimation(5, "stay", false);
         GameObject.Find("EnemyCreator").GetComponent<EnemyManager>().isPause = false;
         m_TouchController.setTouchState("fight");
     }
 }
开发者ID:Venbb,项目名称:Games,代码行数:9,代码来源:CameraChange.cs


示例15: OnEvent

	//SkeletonAnimation
	/*
	 *	Int Value:		0 sets ghostingEnabled to false, 1 sets ghostingEnabled to true
	 *	Float Value:	Values greater than 0 set the spawnRate equal the float value
	 *	String Value:	Pass RGBA hex color values in to set the color property.  IE:   "A0FF8BFF"
	 */
	void OnEvent (Spine.AnimationState state, int trackIndex, Spine.Event e) {
		if (e.Data.Name == "Ghosting") {
			ghostingEnabled = e.Int > 0;
			if (e.Float > 0)
				spawnRate = e.Float;
			if (e.String != null) {
				this.color = HexToColor(e.String);
			}
		}
	}
开发者ID:Kikkur,项目名称:spine-runtimes,代码行数:16,代码来源:SkeletonGhost.cs


示例16: SafeSubscribe

		void SafeSubscribe (Spine.TrackEntry trackEntry) {
			if (trackEntry == null) {
				// Break immediately if trackEntry is null.
				Debug.LogWarning("TrackEntry was null. Coroutine will continue immediately.");
				m_WasFired = true;
			} else {
				// Function normally.
				trackEntry.Complete += HandleComplete;
			}
		}
开发者ID:czlc,项目名称:spine-runtimes,代码行数:10,代码来源:WaitForSpineAnimationComplete.cs


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


示例18: state_End

 void state_End(Spine.AnimationState state, int trackIndex)
 {
     if (state.GetCurrent(trackIndex) + "" == "zoom_out2")
     {
         bgAnimationScript.state.SetAnimation(5, "stay", false);
     }
     if (state.GetCurrent(trackIndex) + "" == "stay")
     {
         Application.LoadLevel("fighting");
     }
 }
开发者ID:Venbb,项目名称:Games,代码行数:11,代码来源:CameraChangeInterface.cs


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


示例20: state_Event

 void state_Event(Spine.AnimationState state, int trackIndex, Spine.Event e)
 {
     if (e + "" == "launch")
     {
         Vector2 m_position = m_transform.position;
         if (m_position.y <= 0) {
             m_position.y += 0.8f;
         }
         Instantiate(stone, m_position, m_transform.rotation);
     }
 }
开发者ID:Venbb,项目名称:Games,代码行数:11,代码来源:CrowMove.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# Spinner类代码示例发布时间:2022-05-24
下一篇:
C# SpinWait类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap