public ChildSpawnMessage(ChildIdentity obj, byte[] payload)
    {
        NetworkIdentity childIdentity = obj.GetComponent<NetworkIdentity>();
        m_id = childIdentity.netId;

        m_childId = obj.ChildId;
        m_position = obj.transform.position;

        NetworkIdentity parentId = null;
        Transform parent = obj.transform.parent;
        while (parentId == null && parent != null)
        {
            parentId = parent.GetComponent<NetworkIdentity>();
            parent = parent.parent;
        }
        if (parentId)
            m_parentId = parentId.netId;
        else
            Debug.LogError("Error: Child identity was placed on an object with no parent with a network identity");

        m_payload = payload;
    }
Example #2
0
 public static void AddChildToParent(UserInfo info, string KeyFromChild, string ChildUserLRI)
 {
     ChildIdentity cident = new ChildIdentity();
     cident.ChildGeneratedKey = KeyFromChild;
     cident.ChildLRI = ChildUserLRI;
     cident.ParentLRI = info.Identity.UserLRI;
     info.Children[ChildUserLRI] = cident;
     SaveIdentity(new LRI(info.Identity.UserLRI));
 }