Ejemplo n.º 1
0
    public void play(string animSet, bool loop, float animSpeed, bool forcePlay = false)
    {
        // 如果动作名相同,并且不是强制重新播放,则不播放动作
        if (mCloth.getTextureSet() == animSet && mCloth.getPlayState() == PLAY_STATE.PS_PLAY && !forcePlay)
        {
            return;
        }
        mCloth.setTextureSet(animSet);
        mWeapon.setTextureSet(animSet);
        mCloth.stop(true, false);
        mCloth.play();
        setLoop(loop);
        setPlaySpeed(animSpeed);
        mCloth.addPlayingCallback(onAnimationPlaying);
        // 当方向大于4时,需要将武器深度设置到角色下面
        int direction = getLastNumber(animSet);

        if (direction <= 4 && direction > 0)
        {
            mCloth.setDepth(1);
            mWeapon.setDepth(2);
        }
        else
        {
            mCloth.setDepth(2);
            mWeapon.setDepth(1);
        }
    }
Ejemplo n.º 2
0
 public void play(string effect, List <Vector2> posList, bool loop, float animSpeed, bool forcePlay = false)
 {
     // 如果动作名相同,并且不是强制重新播放,则不播放动作
     if (mEffectNode.getTextureSet() == effect && mEffectNode.getPlayState() == PLAY_STATE.PS_PLAY && !forcePlay)
     {
         return;
     }
     mEffectNode.setTextureSet(effect);
     mEffectNode.stop(true, false);
     mEffectNode.play();
     setTexturePosList(posList);
     setLoop(loop);
     setPlaySpeed(animSpeed);
     mEffectNode.addPlayingCallback(onAnimationPlaying);
 }
Ejemplo n.º 3
0
 public override void onShow(bool immediately, string param)
 {
     mDiceAnim.stop();
     mDiceAnim.play();
     mDiceAnim.addPlayEndCallback(onDiceAnimDone);
 }