Aurora.ScriptEngine.AuroraDotNetEngine.APIs.LSL_Api.llList2Float C# (CSharp) Метод

llList2Float() публичный Метод

public llList2Float ( Aurora.ScriptEngine.AuroraDotNetEngine.LSL_Types.list src, int index ) : Aurora.ScriptEngine.AuroraDotNetEngine.LSL_Types.LSLFloat
src Aurora.ScriptEngine.AuroraDotNetEngine.LSL_Types.list
index int
Результат Aurora.ScriptEngine.AuroraDotNetEngine.LSL_Types.LSLFloat
        public LSL_Float llList2Float(LSL_List src, int index)
        {
            if (!ScriptProtection.CheckThreatLevel(ThreatLevel.None, "LSL", m_host, "LSL", m_itemID)) return new LSL_Float();

            if (index < 0)
            {
                index = src.Length + index;
            }
            if (index >= src.Length || index < 0)
            {
                return 0.0;
            }
            try
            {
                if (src.Data[index] is LSL_Integer)
                    return Convert.ToDouble(((LSL_Integer)src.Data[index]).value);
                if (src.Data[index] is LSL_Float)
                    return Convert.ToDouble(((LSL_Float)src.Data[index]).value);
                if (src.Data[index] is LSL_String)
                    return Convert.ToDouble(((LSL_String)src.Data[index]).m_string);
                return Convert.ToDouble(src.Data[index]);
            }
            catch (FormatException)
            {
                return 0.0;
            }
            catch (InvalidCastException)
            {
                return 0.0;
            }
        }
LSL_Api