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


C# Spine类代码示例

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


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

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

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

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

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


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