示例#1
0
        private void onProfileDataUpdated(ProfileData profileData)
        {
            DataEntityHandle entityByComponent = dataEntityCollection.GetEntityByComponent(profileData);

            if (entityByComponent == ownerHandle)
            {
                string displayName = dataEntityCollection.GetComponent <DisplayNameData>(entityByComponent).DisplayName;
                bool   isOnline    = getIsOnline(entityByComponent);
                ownerDisplay.SetOnlineStatus(isOnline);
                renderOwner(ownerDisplay, entityByComponent, displayName, isOnline);
            }
        }
    private void onMembershipDataUpdated(MembershipData membershipData)
    {
        DataEntityHandle entityByComponent = dataEntityCollection.GetEntityByComponent(membershipData);
        int incomingInvitationIndex        = getIncomingInvitationIndex(entityByComponent);

        if (incomingInvitationIndex >= 0 && incomingInvitationIndex < 4 && friendRequestItems != null && friendRequestItems[incomingInvitationIndex] != null)
        {
            friendRequestItems[incomingInvitationIndex].SetMembershipType(getMembershipType(entityByComponent));
        }
    }
        protected override IEnumerator runTest()
        {
            bool   addEntityPassed       = false;
            bool   removeEntityPassed    = false;
            bool   addComponentPassed    = false;
            bool   removeComponentPassed = false;
            string testEntity1           = "TestEntity1";

            dataEntityCollection.EventDispatcher.AddListener(delegate(DataEntityEvents.EntityAddedEvent evt)
            {
                if (evt.EntityHandle == dataEntityCollection.FindEntityByName(testEntity1))
                {
                    addEntityPassed = true;
                }
                return(false);
            });
            dataEntityCollection.EventDispatcher.AddListener(delegate(DataEntityEvents.EntityRemovedEvent evt)
            {
                if (evt.EntityHandle.Id == testEntity1)
                {
                    removeEntityPassed = true;
                }
                return(false);
            });
            dataEntityCollection.EventDispatcher.AddListener(delegate(DataEntityEvents.ComponentAddedEvent <MockComponent1> evt)
            {
                if (evt.Handle == dataEntityCollection.FindEntityByName(testEntity1) && evt.Component != null)
                {
                    addComponentPassed = true;
                }
                return(false);
            });
            dataEntityCollection.EventDispatcher.AddListener(delegate(DataEntityEvents.ComponentRemovedEvent evt)
            {
                if (dataEntityCollection.GetEntityByComponent(evt.Component) == dataEntityCollection.FindEntityByName(testEntity1) && evt.Component is MockComponent1)
                {
                    removeComponentPassed = true;
                }
                return(false);
            });
            DataEntityHandle handle = dataEntityCollection.AddEntity(testEntity1);

            dataEntityCollection.AddComponent <MockComponent1>(handle);
            dataEntityCollection.RemoveComponent <MockComponent1>(handle);
            dataEntityCollection.RemoveEntityByName(testEntity1);
            yield return(null);

            IntegrationTestEx.FailIf(!addEntityPassed, "Add Entity Failed");
            IntegrationTestEx.FailIf(!removeEntityPassed, "Remove Entity Failed");
            IntegrationTestEx.FailIf(!addComponentPassed, "Add Component Failed");
            IntegrationTestEx.FailIf(!removeComponentPassed, "Remove Component Failed");
        }
        private void onAvatarDetailsInitialized(AvatarDetailsData avatarDetailsData)
        {
            avatarDetailsData.OnInitialized -= onAvatarDetailsInitialized;
            DataEntityHandle entityByComponent = dataEntityCollection.GetEntityByComponent(avatarDetailsData);
            string           displayName       = dataEntityCollection.GetComponent <DisplayNameData>(entityByComponent).DisplayName;

            if (pendingRenderRequests.ContainsKey(displayName))
            {
                RenderRequest renderRequest = pendingRenderRequests[displayName];
                renderRequest.AvatarDetailsData = avatarDetailsData;
                getImage(displayName, renderRequest);
            }
        }