PlayTileAnim() public method

public PlayTileAnim ( int frame ) : void
frame int
return void
Beispiel #1
0
    void CutPlayerLife()
    {
        PlayerAnimation pl = GameObject.Find("SoldierBluePlayer").GetComponent <PlayerAnimation>();
        float           l  = (pl.life -= .025f);

        if (l < 0)
        {
            pl.life = 0;
        }
        l = Mathf.Min(l, 35);
        l = Mathf.Max(l, 0);
        int frame = Mathf.RoundToInt(l);

        if (pl.State != PlayerState.OVER)
        {
            pl.PlayTileAnim(frame);
            if (frame == 0)
            {
                pl.State = PlayerState.OVER;
            }
        }
    }