📜  如何在统一 2d 中翻转字符 - 无论代码示例

📅  最后修改于: 2022-03-11 14:55:54.044000             🧑  作者: Mango

代码示例1
Put this in Update() = 

    //Flip the player's localScale.x 
    if the move speed is greater than .01 or less than -.01

        if (targetVelocity.x < -.01)
        {
            transform.eulerAngles = new Vector3(0, 180, 0); // Flipped
        }
        else if (targetVelocity.x > .01)
        {
            transform.eulerAngles = new Vector3(0, 0, 0); // Normal
        }