protected override IEnumerator SetUp()
        {
            yield return(base.SetUp());

            avatarModel = new AvatarModel()
            {
                name      = " test",
                hairColor = Color.white,
                eyeColor  = Color.white,
                skinColor = Color.white,
                bodyShape = WearableLiterals.BodyShapes.FEMALE,
                wearables = new List <string>()
                {
                }
            };

            AvatarAssetsTestHelpers.CreateTestCatalogLocal();

            var avatarShape = AvatarShapeTestHelpers.CreateAvatarShape(scene, avatarModel);

            yield return(new DCL.WaitUntil(() => avatarShape.everythingIsLoaded, 20));

            avatarRenderer = avatarShape.avatarRenderer;
            animator       = avatarRenderer.animator;
        }
        protected override IEnumerator SetUp()
        {
            yield return(base.SetUp());

            if (controller == null)
            {
                skinColorList = Resources.Load <ColorList>("SkinTone");
                hairColorList = Resources.Load <ColorList>("HairColor");
                eyeColorList  = Resources.Load <ColorList>("EyeColor");

                userProfile = ScriptableObject.CreateInstance <UserProfile>();
            }

            catalog    = AvatarAssetsTestHelpers.CreateTestCatalogLocal();
            controller = new AvatarEditorHUDController_Mock();
            controller.Initialize(userProfile, catalog);
            controller.SetVisibility(true);
            DataStore.i.isPlayerRendererLoaded.Set(true);

            userProfile.UpdateData(new UserProfileModel()
            {
                name   = "name",
                email  = "mail",
                avatar = new AvatarModel()
                {
                    bodyShape = WearableLiterals.BodyShapes.FEMALE,
                    wearables = new List <string>()
                    {
                    },
                }
            }, false);
        }
Пример #3
0
        public IEnumerator MaterialsSetCorrectly()
        {
            AvatarAssetsTestHelpers.CreateTestCatalogLocal();
            AvatarShape avatar = AvatarShapeTestHelpers.CreateAvatarShape(scene, "Joan Darteis", "TestAvatar.json");

            yield return(new DCL.WaitUntil(() => avatar.everythingIsLoaded, 20));

            AssertMaterialsAreCorrect(avatar.transform);
        }
        protected override IEnumerator SetUp()
        {
            yield return(base.SetUp());

            bodyShapeController = Substitute.For <IBodyShapeController>();
            bodyShapeController.bodyShapeId.Returns(WearableLiterals.BodyShapes.FEMALE);

            catalog = AvatarAssetsTestHelpers.CreateTestCatalogLocal();
        }
Пример #5
0
        protected override IEnumerator SetUp()
        {
            yield return(base.SetUp());

            catalog = AvatarAssetsTestHelpers.CreateTestCatalogLocal();

            toCleanUp.Clear();
            wearableHolder = CreateTestGameObject("_Holder").transform;
        }
    protected override IEnumerator SetUp()
    {
        yield return(base.SetUp());

        catalog = AvatarAssetsTestHelpers.CreateTestCatalogLocal();
        toCleanUp.Clear();

        avatarMaterial = Resources.Load <Material>("Materials/Avatar Material");
        Assert.IsTrue(ColorUtility.TryParseHtmlString("#F2C2A5", out skinColor));
        Assert.IsTrue(ColorUtility.TryParseHtmlString("#1C1C1C", out hairColor));
        Assert.NotNull(avatarMaterial);
    }
        public IEnumerator NameBackgroundHasCorrectSize()
        {
            AvatarAssetsTestHelpers.CreateTestCatalogLocal();
            AvatarShape avatar = AvatarShapeTestHelpers.CreateAvatarShape(scene, "Maiqel Yacson", "TestAvatar.json");

            yield return(new DCL.WaitUntil(() => avatar.everythingIsLoaded, 20));

            avatar.transform.position = new Vector3(13, 0, 4);

            RectTransform rt = avatar.avatarName.uiContainer.GetComponent <RectTransform>();

            Assert.IsTrue((int)Mathf.Abs(rt.sizeDelta.x) == 190 && (int)Mathf.Abs(rt.sizeDelta.y) == 40, $"Avatar name dimensions are incorrect!. Current: {rt.sizeDelta}");
        }
Пример #8
0
        public IEnumerator WhenTwoAvatarsLoadAtTheSameTimeTheyHaveProperMaterials()
        {
            //NOTE(Brian): Avatars must be equal to share their meshes.
            AvatarAssetsTestHelpers.CreateTestCatalogLocal();
            AvatarShape avatar  = AvatarShapeTestHelpers.CreateAvatarShape(scene, "Naicholas Keig", "TestAvatar.json");
            AvatarShape avatar2 = AvatarShapeTestHelpers.CreateAvatarShape(scene, "Naicholas Keig", "TestAvatar2.json");

            avatar.transform.position  = new Vector3(-5, 0, 0);
            avatar2.transform.position = new Vector3(5, 0, 0);

            yield return(new DCL.WaitUntil(() => avatar.everythingIsLoaded && avatar2.everythingIsLoaded, 25));

            AssertMaterialsAreCorrect(avatar.transform);
            AssertMaterialsAreCorrect(avatar2.transform);
        }
Пример #9
0
        public IEnumerator DestroyWhileLoading()
        {
            AvatarAssetsTestHelpers.CreateTestCatalogLocal();
            AvatarShape avatar = AvatarShapeTestHelpers.CreateAvatarShape(scene, "Abortit", "TestAvatar.json");

            GameObject goEntity = avatar.entity.gameObject;

            TestHelpers.RemoveSceneEntity(scene, avatar.entity);

            yield return(null);

            bool destroyedOrPooled = goEntity == null || !goEntity.activeSelf;

            Assert.IsTrue(destroyedOrPooled);
        }
Пример #10
0
        public IEnumerator AvatarShapeVisualTest2()
        {
            yield return(InitVisualTestsScene("AvatarShape_B"));

            AvatarAssetsTestHelpers.CreateTestCatalogLocal();
            AvatarShape avatar = AvatarShapeTestHelpers.CreateAvatarShape(scene, "Avatar #2", "TestAvatar2.json");

            Vector3 camPos    = new Vector3(-0.75f, 2.0f, 2.25f);
            Vector3 camTarget = avatar.transform.position + Vector3.up * 2.0f;

            VisualTestHelpers.RepositionVisualTestsCamera(camPos, camTarget);

            yield return(new DCL.WaitUntil(() => avatar.everythingIsLoaded, 20));

            yield return(VisualTestHelpers.TakeSnapshot());
        }
        public IEnumerator MouthWithMask()
        {
            yield return(InitVisualTestsScene("AvatarShapeVisualTests_MouthWithMask"));

            AvatarAssetsTestHelpers.CreateTestCatalogLocal();
            var         model  = AvatarShapeTestHelpers.GetTestAvatarModel("Avatar #1", "TestAvatar_MaskMouth.json");
            AvatarShape avatar = AvatarShapeTestHelpers.CreateAvatarShape(scene, model);

            Vector3 camPos    = new Vector3(-0.75f, 2.0f, 2.25f);
            Vector3 camTarget = avatar.transform.position + Vector3.up * 2.0f;

            VisualTestHelpers.RepositionVisualTestsCamera(camPos, camTarget);

            yield return(new WaitUntil(() => avatar.everythingIsLoaded, 20));

            yield return(VisualTestHelpers.TakeSnapshot());
        }
Пример #12
0
        private void Setup_AvatarEditorHUDController()
        {
            userProfile = ScriptableObject.CreateInstance <UserProfile>();
            userProfile.UpdateData(new UserProfileModel()
            {
                name   = "name",
                email  = "mail",
                avatar = new AvatarModel()
                {
                    bodyShape = WearableLiterals.BodyShapes.FEMALE,
                    wearables = new List <string>()
                    {
                    },
                }
            }, false);

            catalog    = AvatarAssetsTestHelpers.CreateTestCatalogLocal();
            controller = new AvatarEditorHUDController_Mock();
            controller.Initialize(userProfile, catalog);
        }
Пример #13
0
        protected override IEnumerator SetUp()
        {
            yield return(base.SetUp());

            userProfile = ScriptableObject.CreateInstance <UserProfile>();
            userProfile.UpdateData(new UserProfileModel()
            {
                name   = "name",
                email  = "mail",
                avatar = new AvatarModel()
                {
                    bodyShape = WearableLiterals.BodyShapes.FEMALE,
                    wearables = new List <string>()
                    {
                    }
                }
            }, false);

            catalog    = AvatarAssetsTestHelpers.CreateTestCatalogLocal();
            controller = new AvatarEditorHUDController_Mock();
            controller.Initialize(userProfile, catalog);
        }
Пример #14
0
        public IEnumerator InterpolatePosition()
        {
            AvatarAssetsTestHelpers.CreateTestCatalogLocal();
            AvatarShape avatar = AvatarShapeTestHelpers.CreateAvatarShape(scene, "Abortitus", "TestAvatar.json");

            // We must wait for the AvatarShape to finish or the OnTransformChanged event is not used
            yield return(new DCL.WaitUntil(() => avatar.everythingIsLoaded, 20));

            Assert.AreEqual(0f, avatar.entity.gameObject.transform.position.x);
            Assert.AreEqual(0f, avatar.entity.gameObject.transform.position.z);

            // Update position to the other end of the parcel
            var transformModel = new DCLTransform.Model {
                position = new Vector3(15, 2, 15)
            };

            TestHelpers.SetEntityTransform(scene, avatar.entity, transformModel);

            yield return(null);

            Assert.AreNotEqual(15f, avatar.entity.gameObject.transform.position.x);
            Assert.AreNotEqual(15f, avatar.entity.gameObject.transform.position.z);
        }
Пример #15
0
        protected override IEnumerator SetUp()
        {
            SetUp_SceneController();
            yield return(SetUp_CharacterController());

            if (avatarShape == null)
            {
                avatarModel = new AvatarModel()
                {
                    name      = " test",
                    hairColor = Color.white,
                    eyeColor  = Color.white,
                    skinColor = Color.white,
                    bodyShape = WearableLiterals.BodyShapes.FEMALE,
                    wearables = new List <string>()
                    {
                    }
                };
                catalog     = AvatarAssetsTestHelpers.CreateTestCatalogLocal();
                avatarShape = AvatarShapeTestHelpers.CreateAvatarShape(scene, avatarModel);

                yield return(new DCL.WaitUntil(() => avatarShape.everythingIsLoaded, 20));
            }
        }