Beispiel #1
0
        public IEnumerator SetTheCorrectMaterialWhenLoadingMultipleTimes()
        {
            avatarModel = AvatarShapeTestHelpers.GetTestAvatarModel("test", "TestAvatar.json");
            avatarShape.avatarRenderer.ApplyModel(avatarModel, null, null);
            avatarShape.avatarRenderer.ApplyModel(avatarModel, null, null);
            avatarShape.avatarRenderer.ApplyModel(avatarModel, null, null);

            bool lastUpdateIsDone = false;

            avatarShape.avatarRenderer.ApplyModel(avatarModel, () => lastUpdateIsDone = true, null);

            yield return(new DCL.WaitUntil(() => lastUpdateIsDone));

            var             wearableControllers = AvatarRenderer_Mock.GetWearableMockControllers(avatarShape.avatarRenderer);
            List <Material> materials           = new List <Material>();

            foreach (var wearableControllerMock in wearableControllers.Values)
            {
                if (wearableControllerMock.category == WearableLiterals.Categories.EYES || wearableControllerMock.category == WearableLiterals.Categories.EYEBROWS || wearableControllerMock.category == WearableLiterals.Categories.MOUTH)
                {
                    continue;
                }

                materials.AddRange(wearableControllerMock.myAssetContainer.GetComponentsInChildren <Renderer>().SelectMany(x => x.materials).ToList());
            }

            Assert.IsTrue(materials.All(x => x.shader.name == "DCL/Toon Shader"));
        }
        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;
        }
        public IEnumerator SetTheCorrectMaterial()
        {
            avatarModel = AvatarShapeTestHelpers.GetTestAvatarModel("test", "TestAvatar.json");
            yield return(avatarShape.ApplyChanges(JsonUtility.ToJson(avatarModel)));

            var             wearableControllers = AvatarRenderer_Mock.GetWearableMockControllers(avatarShape.avatarRenderer);
            List <Material> materials           = new List <Material>();

            foreach (var wearableControllerMock in wearableControllers.Values)
            {
                if (wearableControllerMock.category == WearableLiterals.Categories.EYES || wearableControllerMock.category == WearableLiterals.Categories.EYEBROWS || wearableControllerMock.category == WearableLiterals.Categories.MOUTH)
                {
                    continue;
                }

                materials.AddRange(wearableControllerMock.myAssetContainer.GetComponentsInChildren <Renderer>().SelectMany(x => x.materials).ToList());
            }

            Assert.IsTrue(materials.All(x => x.shader.name == "DCL/Toon Shader"));
        }
Beispiel #4
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));
            }
        }