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; }
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; }