Exemple #1
0
        public void UpdateLandCorrectly()
        {
            const string startingName = "Temptation";
            const string updatedName  = "New Temptation";

            SectionLandController controller      = new SectionLandController(view);
            ILandsListener        landsListener   = controller;
            LandElementView       landElementView = view.GetLandElementeBaseView();

            landsListener.OnSetLands(new [] { new LandData()
                                              {
                                                  id   = "1",
                                                  name = startingName
                                              } });
            Assert.AreEqual(1, GetVisibleChildrenAmount(view.GetLandElementsContainer()));
            Assert.AreEqual(startingName, landElementView.landName.text);

            landsListener.OnSetLands(new [] { new LandData()
                                              {
                                                  id   = "1",
                                                  name = updatedName
                                              } });
            Assert.AreEqual(1, GetVisibleChildrenAmount(view.GetLandElementsContainer()));
            Assert.AreEqual(updatedName, landElementView.landName.text);


            controller.Dispose();
        }
        public void SetUp()
        {
            var prefab = AssetDatabase.LoadAssetAtPath <LandElementView>(
                "Assets/Scripts/MainScripts/DCL/Controllers/HUD/BuilderProjectsPanel/Prefabs/LandElementView.prefab");

            view = Object.Instantiate(prefab);
        }
Exemple #3
0
    private void PoolView(LandElementView landView)
    {
        landView.OnSettingsPressed   -= OnSettingsPressed;
        landView.OnJumpInPressed     -= OnJumpInPressed;
        landView.OnOpenInDappPressed -= OnOpenInDappPressed;
        landView.OnEditorPressed     -= OnEditPressed;

        landView.SetActive(false);
        landElementViewsPool.Enqueue(landView);
    }
Exemple #4
0
 private void PoolView(LandElementView view)
 {
     view.SetActive(false);
     landElementViewsPool.Enqueue(view);
 }