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


C# tk2dSpriteAnimator.GetClipByName方法代码示例

本文整理汇总了C#中tk2dSpriteAnimator.GetClipByName方法的典型用法代码示例。如果您正苦于以下问题:C# tk2dSpriteAnimator.GetClipByName方法的具体用法?C# tk2dSpriteAnimator.GetClipByName怎么用?C# tk2dSpriteAnimator.GetClipByName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在tk2dSpriteAnimator的用法示例。


在下文中一共展示了tk2dSpriteAnimator.GetClipByName方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Init

 public void Init(tk2dSpriteAnimator anim) {
     idleClip = anim.GetClipByName(idle);
     fireClip = anim.GetClipByName(fire);
 }
开发者ID:PushoN,项目名称:game-off-2013,代码行数:4,代码来源:EnemyTurret.cs

示例2: Awake

    void Awake()
    {
        MainCamera = GameObject.FindWithTag("MainCamera");

        if (this.tag == "Creature") //All objects are of type GameObject. Use tags instead of the usual typeOf() check.
            {
            if (GetComponent<Movement>() != null)
                {movement = GetComponent<Movement>();}			//Determine if attached script is Movement or PlayerMovement
            if (GetComponent<PlayerMovement>() != null)
                {movement = GetComponent<PlayerMovement>();}
            }

        animLib = GetComponent<tk2dSpriteAnimator>();
        setAction("stand");
        absoluteFacing = relativeFacing = initialFacing; //Later on, facing will also be randomized if a player drops the item.
                                                        //The constructor will take an int argument for the direction to give it.
                                                        //That way you can place objects in the editor with set directions, but it will
                                                        //also randomize if the player moves it around.

        MAP = new Dictionary<string, tk2dSpriteAnimationClip>();

            MAP["stand0"] = animLib.GetClipByName("standU");
            MAP["stand45"] = animLib.GetClipByName("standUR");		//Map clips to strings, so I can assemble
            MAP["stand90"] = animLib.GetClipByName("standR");		//them piece by piece rather than use a ton of ifs.
            MAP["stand135"] = animLib.GetClipByName("standDR");
            MAP["stand180"] = animLib.GetClipByName("standD");
            MAP["stand225"] = animLib.GetClipByName("standDL");
            MAP["stand270"] = animLib.GetClipByName("standL");
            MAP["stand315"] = animLib.GetClipByName("standUL");

            MAP["walk0"] = animLib.GetClipByName("walkU");
            MAP["walk45"] = animLib.GetClipByName("walkUR");
            MAP["walk90"] = animLib.GetClipByName("walkR");
            MAP["walk135"] = animLib.GetClipByName("walkDR");
            MAP["walk180"] = animLib.GetClipByName("walkD");
            MAP["walk225"] = animLib.GetClipByName("walkDL");
            MAP["walk270"] = animLib.GetClipByName("walkL");
            MAP["walk315"] = animLib.GetClipByName("walkUL");

            MAP["swing0"] = animLib.GetClipByName("swingU");
            MAP["swing45"] = animLib.GetClipByName("swingUR");
            MAP["swing90"] = animLib.GetClipByName("swingR");
            MAP["swing135"] = animLib.GetClipByName("swingDR");
            MAP["swing180"] = animLib.GetClipByName("swingD");
            MAP["swing225"] = animLib.GetClipByName("swingDL");
            MAP["swing270"] = animLib.GetClipByName("swingL");
            MAP["swing315"] = animLib.GetClipByName("swingUL");
    }
开发者ID:NoSoup4you,项目名称:UntitledHodsFinnProject,代码行数:48,代码来源:AnimationManager.cs

示例3: AnimAfterDash

    public void AnimAfterDash(tk2dSpriteAnimator anim, tk2dSpriteAnimationClip clip)
    {
        anim.AnimationCompleted = null;

        if (clip != anim.GetClipByName(a_endDash) || !grounded) return;

        if (controller.getL || controller.getR){
            anim.Play(a_walk);
        }
        else{
            anim.Play(a_idle);
        }
                    //reset the completed delegate so it doesn't pull this every time an animation ends
    }
开发者ID:TimuSumisu,项目名称:recess-race,代码行数:14,代码来源:Fitz.cs


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