Exemplo n.º 1
0
        protected override IEnumerator SetUp()
        {
            yield return(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     = AvatarTestHelpers.CreateTestCatalogLocal();
                avatarShape = AvatarTestHelpers.CreateAvatarShape(scene, avatarModel);

                yield return(new DCL.WaitUntil(() => avatarShape.everythingIsLoaded, 20));
            }
        }
Exemplo n.º 2
0
        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    = AvatarTestHelpers.CreateTestCatalogLocal();
            controller = new AvatarEditorHUDController_Mock();
            controller.Initialize(userProfile, catalog);
            controller.SetVisibility(true);

            userProfile.UpdateData(new UserProfileModel()
            {
                name   = "name",
                email  = "mail",
                avatar = new AvatarModel()
                {
                    bodyShape = WearableLiterals.BodyShapes.FEMALE,
                    wearables = new List <string>()
                    {
                    },
                }
            }, false);
        }
        protected override IEnumerator SetUp()
        {
            yield return(base.SetUp());

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

            catalog = AvatarTestHelpers.CreateTestCatalogLocal();
        }
Exemplo n.º 4
0
        protected override IEnumerator SetUp()
        {
            yield return(base.SetUp());

            catalog = AvatarTestHelpers.CreateTestCatalogLocal();

            toCleanUp.Clear();
            wearableHolder = CreateTestGameObject("_Holder").transform;
        }
Exemplo n.º 5
0
 private void ProcessCatalog(WearableDictionary catalog)
 {
     wearablesByCategory.Clear();
     view.RemoveAllWearables();
     using (var iterator = catalog.GetEnumerator())
     {
         while (iterator.MoveNext())
         {
             AddWearable(iterator.Current.Key, iterator.Current.Value);
         }
     }
 }
Exemplo n.º 6
0
    public void SetCatalog(WearableDictionary catalog)
    {
        if (this.catalog != null)
        {
            this.catalog.OnAdded   -= AddWearable;
            this.catalog.OnRemoved -= RemoveWearable;
        }

        this.catalog = catalog;

        ProcessCatalog(this.catalog);
        this.catalog.OnAdded   += AddWearable;
        this.catalog.OnRemoved += RemoveWearable;
    }
Exemplo n.º 7
0
    public void Initialize(UserProfile userProfile, WearableDictionary catalog, bool bypassUpdateAvatarPreview = false)
    {
        this.userProfile = userProfile;
        this.bypassUpdateAvatarPreview = bypassUpdateAvatarPreview;

        view = AvatarEditorHUDView.Create(this);

        skinColorList = Resources.Load <ColorList>("SkinTone");
        hairColorList = Resources.Load <ColorList>("HairColor");
        eyeColorList  = Resources.Load <ColorList>("EyeColor");
        view.SetColors(skinColorList.colors, hairColorList.colors, eyeColorList.colors);

        SetCatalog(catalog);

        LoadUserProfile(userProfile, true);
        this.userProfile.OnUpdate += LoadUserProfile;
    }
Exemplo n.º 8
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    = AvatarTestHelpers.CreateTestCatalogLocal();
            controller = new AvatarEditorHUDController_Mock();
            controller.Initialize(userProfile, catalog);
        }
Exemplo n.º 9
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    = AvatarTestHelpers.CreateTestCatalogLocal();
            controller = new AvatarEditorHUDController_Mock();
            controller.Initialize(userProfile, catalog);
        }
Exemplo n.º 10
0
        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>()
                {
                }
            };
            catalog = AvatarTestHelpers.CreateTestCatalog();

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

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

            avatarRenderer = avatarShape.avatarRenderer;
        }