Exemplo n.º 1
0
    // Inside of PullTowardsHand

    private void getHuman()
    {
        // Grab the owner of this blarp
        int ownerID = _realtimeView.ownerID;

        if (ownerID == -1)
        {
            print("NOOOOOOO");
        }                                    // No owner, this is a bug.

        print(ownerID);


        // Get a reference to the avatar manager that lives on the same game object as Realtime
        Realtime realtime = _realtimeView.realtime;
        RealtimeAvatarManager realtimeAvatarManager = realtime.GetComponent <RealtimeAvatarManager>();

        print(realtimeAvatarManager.avatars.Count);

        // Get a reference to the avatar, blarpatar, and then human
        RealtimeAvatar realtimeAvatar  = realtimeAvatarManager.avatars[ownerID];
        Blarpatar      avatarBlarpatar = realtimeAvatar.GetComponent <Blarpatar>();
        Human          h = avatarBlarpatar.human;


        // Here's your human
        human   = h;
        started = true;
    }