Exemplo n.º 1
0
        private void OnSelectImageButtonClicked(XmlElement button)
        {
            if (_selectingImage == false)
            {
                string view = button.id.Remove(0, 6);

                ReferenceImage refimage = GetReferenceImage(view);
                if (refimage?.view != null)
                {
                    if (refimage.active)
                    {
                        refimage.EditMode(true);
                    }
                    if (refimage.editModeOn)
                    {
                        _xmlLayout.GetElementById("Select" + view).SetActive(false);
                        _xmlLayout.GetElementById("EditModeSettings" + view).SetActive(true);
                    }
                    else
                    {
                        _xmlLayout.GetElementById("Select" + view).SetActive(true);
                        _xmlLayout.GetElementById("EditModeSettings" + view).SetActive(false);
                    }
                    return;
                }

                _selectingImage = true;
                _imageSelector.SetActive(true);
                _imageConfirmButton.SetActive(false);
                UpdateList("Image", _images);
                selectedView = view;
            }
        }
Exemplo n.º 2
0
        public void OnUIValueChanged(ReferenceImage image)
        {
            String prefix = image.view + "-";

            _xmlLayout.GetElementById <InputField> (prefix + "OffsetX")?.SetTextWithoutNotify((image.offsetX).ToString());
            _xmlLayout.GetElementById <InputField> (prefix + "OffsetY")?.SetTextWithoutNotify((image.offsetY).ToString());
            _xmlLayout.GetElementById <InputField> (prefix + "Rotation")?.SetTextWithoutNotify(image.rotation.ToString());
            _xmlLayout.GetElementById <InputField> (prefix + "Scale")?.SetTextWithoutNotify(image.scale.ToString());
            _xmlLayout.GetElementById <InputField> (prefix + "Opacity")?.SetTextWithoutNotify(image.opacity.ToString());
        }
Exemplo n.º 3
0
        private void OnDeleteImageClicked(string view)
        {
            ReferenceImage refimage = GetReferenceImage(view);

            OnCloseEditMode(view);
            refimage?.Destroy();
            _referenceImages.Remove(refimage);

            _xmlLayout.GetElementById(view + "Settings").SetActive(false);
            _xmlLayout.GetElementById(view + "NoImageSelected").SetActive(true);
            _xmlLayout.GetElementById("Select" + view).GetComponentInChildren <TextMeshProUGUI> ().SetText("Select Image");
        }
Exemplo n.º 4
0
        private void OnToggleImageClicked(XmlElement image)
        {
            string         view     = image.id.Remove(0, 6);
            ReferenceImage refimage = GetReferenceImage(view);

            refimage?.Toggle();
            refimage?.EditMode(false);
            if (refimage.active)
            {
                image.SetAndApplyAttribute("color", "White");
            }
            else
            {
                image.SetAndApplyAttribute("color", "Button");
            }
        }
Exemplo n.º 5
0
        private void OnImageConfirm()
        {
            ReferenceImage refimage = GetReferenceImage(selectedView);

            if (refimage != null)
            {
                refimage.UpdateImage(selectedImage);
            }
            else
            {
                _referenceImages.Add(new ReferenceImage(selectedView, selectedImage, this));
            }

            _xmlLayout.GetElementById(selectedView + "Settings").SetActive(true);
            _xmlLayout.GetElementById(selectedView + "NoImageSelected").SetActive(false);
            _xmlLayout.GetElementById("Select" + selectedView).GetComponentInChildren <TextMeshProUGUI> ().SetText("Edit Image");

            _selectingImage = false;
            _imageSelector.SetActive(false);
        }