Aurora.ScriptEngine.AuroraDotNetEngine.APIs.LSL_Api.KeyOrName C# (CSharp) Method

KeyOrName() protected method

accepts a valid UUID, -or- a name of an inventory item. Returns a valid UUID or UUID.Zero if key invalid and item not found in prim inventory.
protected KeyOrName ( string k, bool throwExceptionIfDoesNotExist ) : UUID
k string
throwExceptionIfDoesNotExist bool
return UUID
        protected UUID KeyOrName(string k, bool throwExceptionIfDoesNotExist)
        {
            UUID key = UUID.Zero;

            // if we can parse the string as a key, use it.
            if (UUID.TryParse(k, out key))
            {
                return key;
            }
            // else try to locate the name in inventory of object. found returns key,
            // not found returns UUID.Zero which will translate to the default particle texture
            return InventoryKey(k, throwExceptionIfDoesNotExist);
        }
LSL_Api