Example #1
0
        public void SetValue(float value)
        {
#if USE_HEX_FLOAT
            // It is more precise technic but output looks vague and less readable
            uint hex = BitConverterExtensions.ToUInt32(value);
            m_string     = $"0x{hex.ToHexString()}({value.ToString(CultureInfo.InvariantCulture)})";
            m_objectType = ScalarType.String;
#else
            m_value      = BitConverterExtensions.ToUInt32(value);
            m_objectType = ScalarType.Single;
#endif
        }
Example #2
0
        public void SetValue(float value)
        {
            uint hex = BitConverterExtensions.ToUInt32(value);

#if USE_HEX_SINGLE
            // As Unity says it is more precise technic but output looks vague and less readable
            m_value = $"0x{hex.ToString("X8")}({value.ToString(CultureInfo.InvariantCulture)})";
#else
            m_value = value;
#endif
            m_objectType = ScalarType.Single;
        }
        public static string ToHexString(this float _this)
        {
            uint value = BitConverterExtensions.ToUInt32(_this);

            return(ToHexString(value));
        }
Example #4
0
 public static Emitter WriteHex(this Emitter _this, float value)
 {
     return(WriteHex(_this, BitConverterExtensions.ToUInt32(value)));
 }