示例#1
0
    public void PlayAnimationCPeonFem(CPeonFem c, float frameRate, int times, int flip, bool goOn, bool reverse)
    {
        frameArray  = gameAssets.GetCPeonFemAnimationSprite(c);
        loopCounter = 0;
        isPlaying   = true;
        if (!goOn)
        {
//         Debug.Log("赋值为0");
            reserve        = reverse;
            this.frameRate = frameRate;
            currentFrame   = 0;
            timer          = 0f;
            this.times     = times;
            if (reverse)
            {
                spriteRenderer.sprite = frameArray[frameArray.Length - currentFrame - 1];
            }
            else
            {
                spriteRenderer.sprite = frameArray[currentFrame];
            }
            //判断是否翻转
            if (flip == 1)
            {
                spriteRenderer.flipX = true;
            }
            else if (flip == 2)
            {
                spriteRenderer.flipY = true;
            }
            else
            {
                spriteRenderer.flipX = false;
                spriteRenderer.flipY = false;
            }
        }
    }