Example #1
0
        public void FillContent(ref List <T> content)
        {
            if (content == null || scroll == null)
            {
                return;
            }

            for (int i = 1; i < multiplyNumberElements; i++)
            {
                content.AddRange(content);
            }

            var transforms = new List <Transform>();

            foreach (var info in content)
            {
                GameObjectExtend.CreateUIlement(prefab, out GameObject obj, CanvasTipology.Null);

                var element = obj.GetComponent <IElement <T, F> >();
                if (element != null)
                {
                    element.SetContent(info);
                }
                transforms.Add(obj.transform);
            }


            _contentList = content;

            scroll.SetNewItems(ref transforms);
        }
        protected override void Start()
        {
            base.Start();

            if (DebugManager.GetActiveDebug("debugScreen"))
            {
                GameObjectExtend.CreateUIlement(debugScreenPrefab, out _debugScreenParent, CanvasTipology.Debug);
                CreateDebugScreen();
                _isDebugScreen = true;
            }
        }
Example #3
0
        protected override void OnExecute()
        {
            if (widget.IsExist(out var prefab) && canvasTipology != null && typeSibilling != null)
            {
                Transform aux = CanvasManager.GetWidget(prefab.name, canvasTipology.value);

                if (aux == null)
                {
                    GameObjectExtend.CreateUIlement(prefab, out aux, canvasTipology.value);
                }

                if (aux != null)
                {
                    if (saveIstanceLocation != null)
                    {
                        saveIstanceLocation.value = aux.gameObject;
                    }


                    aux.gameObject.SetActive(!isDisabled.value);

                    int pos = positionChild != null ? positionChild.value : 0;
                    aux.SetSibilling(typeSibilling.value, pos);


                    if (mode != null && !string.IsNullOrWhiteSpace(mode.value))
                    {
                        var genericPage = aux.GetComponent <GenericPage>();
                        if (genericPage)
                        {
                            genericPage.Mode = mode.value;
                        }
                    }
                }
            }
            EndAction();
        }