yasirkula / UnityRuntimeInspector

Runtime Inspector and Hierarchy solution for Unity for debugging and runtime editing purposes
MIT License
1.68k stars 135 forks source link

Vector display error #43

Closed zhangping312 closed 2 years ago

zhangping312 commented 2 years ago

w value display error:

if( isQuaternion ) { Quaternion prevVal = (Quaternion) Value; base.Refresh(); Quaternion val = (Quaternion) Value;

            if( val.x != prevVal.x )
                inputX.Text = val.x.ToString( RuntimeInspectorUtils.numberFormat );
            if( val.y != prevVal.y )
                inputY.Text = val.y.ToString( RuntimeInspectorUtils.numberFormat );
            if( val.z != prevVal.z )
                inputZ.Text = val.z.ToString( RuntimeInspectorUtils.numberFormat );
            if( val.w != prevVal.w )
                inputW.Text = val.z.ToString( RuntimeInspectorUtils.numberFormat );
        }
        else
        {
            Vector4 prevVal = (Vector4) Value;
            base.Refresh();
            Vector4 val = (Vector4) Value;

            if( val.x != prevVal.x )
                inputX.Text = val.x.ToString( RuntimeInspectorUtils.numberFormat );
            if( val.y != prevVal.y )
                inputY.Text = val.y.ToString( RuntimeInspectorUtils.numberFormat );
            if( val.z != prevVal.z )
                inputZ.Text = val.z.ToString( RuntimeInspectorUtils.numberFormat );
            if( val.w != prevVal.w )
                inputW.Text = val.z.ToString( RuntimeInspectorUtils.numberFormat );
        }
yasirkula commented 2 years ago

Looks like I was a copy-paste victim 😞 Thanks for letting me know.