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

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

The rules governing the returned name are not simple. The only time a blank name is returned is if the target prim has a blank name. If no prim with the given link number can be found then usually NULL_KEY is returned but there are exceptions. In a single unlinked prim, A call with 0 returns the name, all other values for link number return NULL_KEY In link sets it is more complicated. If the script is in the root prim:- A zero link number returns NULL_KEY. Positive link numbers return the name of the prim, or NULL_KEY if a prim does not exist at that position. Negative link numbers return the name of the first child prim. If the script is in a child prim:- Link numbers 0 or 1 return the name of the root prim. Positive link numbers return the name of the prim or NULL_KEY if a prim does not exist at that position. Negative numbers return the name of the root prim. References http://lslwiki.net/lslwiki/wakka.php?wakka=llGetLinkName Mentions NULL_KEY being returned http://wiki.secondlife.com/wiki/LlGetLinkName Mentions using the LINK_* constants, some of which are negative
public llGetLinkName ( int linknum ) : Aurora.ScriptEngine.AuroraDotNetEngine.LSL_Types.LSLString
linknum int
Результат Aurora.ScriptEngine.AuroraDotNetEngine.LSL_Types.LSLString
        public LSL_String llGetLinkName(int linknum)
        {
            if (!ScriptProtection.CheckThreatLevel(ThreatLevel.None, "LSL", m_host, "LSL", m_itemID)) return "";


            // simplest case, this prims link number
            if (m_host.LinkNum == linknum)
                return m_host.Name;

            // Single prim
            if (m_host.LinkNum == 0)
            {
                if (linknum == 1)
                    return m_host.Name;
                IEntity entity = m_host.ParentEntity.GetLinkNumPart(linknum);
                if (entity != null)
                    return entity.Name;
                return UUID.Zero.ToString();
            }
            // Link set
            IEntity part = null;
            part = m_host.LinkNum == 1 ? m_host.ParentEntity.GetLinkNumPart(linknum < 0 ? 2 : linknum) : m_host.ParentEntity.GetLinkNumPart(linknum < 2 ? 1 : linknum);
            if (part != null)
                return part.Name;
            return UUID.Zero.ToString();
        }
LSL_Api