示例#1
0
        private void RotateTowardsVelocity()
        {
            Vector3 velocity = new Vector3(rb.velocity.x, rb.velocity.y, 0);
            Vector3 angle    = SelfRotation.ComputeTotalAngle(velocity, Vector3.right);

            transform.eulerAngles = angle;
        }
示例#2
0
    public override void OnInspectorGUI()
    {
        base.OnInspectorGUI();

        SelfRotation selfRotation = (SelfRotation)target;

        GUIContent arrayLabel = new GUIContent("Axises");

        selfRotation.AxisIndex = EditorGUILayout.Popup(arrayLabel, selfRotation.AxisIndex, selfRotation.Axises);
    }