예제 #1
0
파일: Coin.cs 프로젝트: samueljc/widjacards
 private IEnumerator DoFlips(int flipCount)
 {
     this.flipCount = flipCount;
     this.flipping  = true;
     while (this.flipCount > 0)
     {
         yield return(new WaitForEndOfFrame());
     }
     OnFlipped?.Invoke(this, this.heads);
     this.flipping = false;
 }
예제 #2
0
    private void Flip()
    {
        // Switch the way the player is labelled as facing.
        m_FacingRight = !m_FacingRight;

        if (OnFlipped != null)
        {
            OnFlipped.Invoke(m_FacingRight);
        }

        // Multiply the player's x local scale by -1.
        Vector3 theScale = transform.localScale;

        theScale.x          *= -1;
        transform.localScale = theScale;
    }