Beispiel #1
0
        /// <summary>
        /// Flips our card state so that we are now facing according to the inputted flip state
        /// </summary>
        public void Flip(CardFlipState flipState)
        {
            CardFlipState oldFlipState = FlipState;

            FlipState = flipState;

            // Call our on flip event if it's not null
            OnFlip?.Invoke(this, FlipState, oldFlipState);
        }
Beispiel #2
0
    /// <summary>
    /// Flips this character to have they looking at the opposite side.
    /// </summary>
    public virtual void Flip()
    {
        isFacingRight = !isFacingRight;
        transform.Rotate(Vector3.up, 180);
        transform.localScale = new Vector3(transform.localScale.x, transform.localScale.y, transform.localScale.z * -1);

        shadowTransform.localPosition = new Vector3(shadowTransform.localPosition.x, shadowTransform.localPosition.y, shadowTransform.localPosition.z * -1);

        OnFlip?.Invoke();
    }
Beispiel #3
0
    private void Flip()
    {
        m_facingRight = !m_facingRight;
        Vector3 l_LocalScale = transform.localScale;

        l_LocalScale.x      *= -1;
        transform.localScale = l_LocalScale;

        OnFlip?.Invoke(!m_facingRight);
    }