void Start()
        {
            logWindow = IgniteWindow.Create("Log", open: false)
                        .SetRightTopPos();

            var test = IgniteWindow.Create("base");

            test
            .AddButton("fit", () => test.Fit())
            .AddButton("add", () =>
            {
                test.AddLabel("add");
            });
            test.AddButton("create", () =>
            {
                var bottom = IgniteWindow.Create("bottom");
                bottom.SetWindowBottom(test);
                var top = IgniteWindow.Create("top");
                top.SetWindowTop(test);
                var left = IgniteWindow.Create("left");
                left.SetWindowLeft(test);
                var right = IgniteWindow.Create("right");
                right.SetWindowRight(test);
            });

            var fixedWindow = IgniteWindow.Create("fixed", fixedSize: true);

            ATweening.ATween.To(() => sliderValue, v => sliderValue = v, 1f, 1f).SetLoops(-1, ATweening.LoopType.Yoyo);
            ExampleWindow();
        }
Beispiel #2
0
        public static IgniteWindow SetRightBottomPos(this IgniteWindow window)
        {
            window.StartCoroutine(DelayAction(() =>
            {
                window.RectTransform.SetAnchoredPosition(Screen.safeArea.size.x - window.RectTransform.sizeDelta.x, window.RectTransform.sizeDelta.y - Screen.safeArea.size.y);
            }));

            return(window);
        }
Beispiel #3
0
        public static IgniteWindow SetLeftTopPos(this IgniteWindow window)
        {
            window.StartCoroutine(DelayAction(() =>
            {
                window.RectTransform.SetAnchoredPosition(0f, 0f);
            }));

            return(window);
        }
        public static IgniteWindow SetLeftBottomPos(this IgniteWindow window)
        {
            window.StartCoroutine(IgniteGUIUtility.DelayedAction(() =>
            {
                window.RectTransform.SetAnchoredPosition(0f, window.RectTransform.sizeDelta.y - Screen.safeArea.size.y);
            }));

            return(window);
        }
        public static IgniteWindow SetRightTopPos(this IgniteWindow window)
        {
            window.StartCoroutine(IgniteGUIUtility.DelayedAction(() =>
            {
                window.RectTransform.SetAnchoredPosition(Screen.safeArea.size.x - window.RectTransform.sizeDelta.x, 0f);
            }));

            return(window);
        }
 void SetWindowPos()
 {
     IgniteWindow.Create("SetPos")
     .AddButton("LeftTop", () => IgniteWindow.Create("LeftTop").SetLeftTopPos())
     .AddButton("LeftBottom", () => IgniteWindow.Create("LeftBottom").SetLeftBottomPos())
     .AddButton("RightTop", () => IgniteWindow.Create("RightTop").SetRightTopPos())
     .AddButton("RightBottom", () => IgniteWindow.Create("RightBottom").SetRightBottomPos())
     ;
 }
        public static IgniteWindow SetWindowRight(this IgniteWindow rightWindow, IgniteWindow baseWindow)
        {
            rightWindow.StartCoroutine(IgniteGUIUtility.DelayedAction(() =>
            {
                rightWindow.RectTransform.SetAnchoredLeftPosition(baseWindow.RectTransform.AnchoredRight());
                rightWindow.RectTransform.SetAnchoredTopPosition(baseWindow.RectTransform.AnchoredTop());
            }));

            return(rightWindow);
        }
        public static IgniteWindow SetWindowTop(this IgniteWindow topWindow, IgniteWindow baseWindow)
        {
            topWindow.StartCoroutine(IgniteGUIUtility.DelayedAction(() =>
            {
                topWindow.RectTransform.SetAnchoredBottomPosition(baseWindow.RectTransform.AnchoredTop());
                topWindow.RectTransform.SetAnchoredLeftPosition(baseWindow.RectTransform.AnchoredLeft());
            }));

            return(topWindow);
        }
Beispiel #9
0
        public static IgniteWindow SetCenterPos(this IgniteWindow window)
        {
            window.StartCoroutine(DelayAction(() =>
            {
                var pos = new Vector2(Screen.safeArea.size.x * 0.5f, -Screen.safeArea.size.y * 0.5f);
                pos    -= new Vector2(window.RectTransform.sizeDelta.x * 0.5f, window.RectTransform.sizeDelta.x * -0.5f);
                window.RectTransform.anchoredPosition = pos;
            }));

            return(window);
        }
Beispiel #10
0
        public static void SetWindowPos(IgniteWindow window)
        {
            window.RectTransform.anchoredPosition = nextWindowPos;
            nextWindowPos += new Vector2(IgniteGUISettings.ElementHeight, -IgniteGUISettings.ElementHeight);
            setWindowCount++;

            if (setWindowCount >= 10)
            {
                setWindowCount = 0;
                nextWindowPos  = new Vector2(0, nextWindowPos.y - IgniteGUISettings.ElementHeight);
            }
        }
Beispiel #11
0
 public static void AddWindow(int key, IgniteWindow window)
 {
     window.Transform.SetParent(IgniteGUI.WindowRoot);
     ActiveWindow.Add(key, window);
     window.OnSelect.AddListener(() =>
     {
         foreach (var i in ActiveWindow.Where(kvp => kvp.Key != key))
         {
             i.Value.IsSelected = false;
         }
     });
 }
        void Grid()
        {
            var grid = IgniteWindow.Create("Grid")
                       .AddFoldout("Grid")
                       .LastNestedGroup
                       .AddGridGroup(new Vector2(100, 30))
                       .LastNestedGroup;

            for (int i = 0; i < 10; ++i)
            {
                var index = i;
                grid.AddButton(i.ToString("D8"), () => Debug.Log("Grid: " + index));
            }
        }
 void ExampleWindow()
 {
     IgniteWindow.Create("Window")
     .AddOperableMonitoringSlider("label", () => sliderValue, v => sliderValue = v)
     .AddOperableMonitoringSlider(() => sliderValue, v => sliderValue          = v, "label")
     .AddMonitoringSlider(() => sliderValue)
     .AddLabel("Label")
     .AddButton("Grid", () => Grid())
     .AddButton("SetPos", () => SetWindowPos())
     .AddRGBSlider(color => Camera.main.backgroundColor = color, Camera.main.backgroundColor)
     .AddMonitoringSlider(() => sliderValue)
     .AddVector2Field(vec => logWindow.AddLabel(vec.ToString()), initialValue: new Vector2(123, 456))
     .AddVector3Field("vector3", vec => logWindow.AddLabel(vec.ToString()), initialValue: new Vector2(123, 456))
     .AddEnumDropdown <ExampleEnum>(v => logWindow.AddLabel(v.ToString()))
     .AddButton("Clear LogWindow", () => logWindow.Clear())
     .AddButton("CreateWindow", () => ExampleWindow())
     .AddButton("ExampleButton", () => logWindow.AddLabel("Button Click"))
     .AddMonitoringLabel(() => System.DateTime.Now.ToString())
     .AddButton("Label", "Labelbutton", () => logWindow.AddLabel("Button Click"))
     .AddToggle(v => logWindow.AddLabel("Toggle: " + v))
     .AddToggle("Label", v => logWindow.AddLabel("Toggle: " + v))
     .AddToggleWithButton("Button", v => logWindow.AddLabel("Button Click: " + v))
     .AddSlider(v => logWindow.AddLabel("Slider Value Change" + v))
     .AddSlider("Slider", v => logWindow.AddLabel("Slider: " + v), -100f, 100f, true)
     .AddFoldout("Foldout")
     .LastNestedGroup
     .AddLabel("Label")
     .AddButton("Button", () => logWindow.AddLabel("Button Click"))
     .Parent
     .AddLabel("ToggleGroup")
     .AddToggleGroup()
     .LastNestedGroup
     .AddToggle("Toggle 1", v => logWindow.AddLabel("Toggle1: " + v), defaultValue: true)
     .AddToggle("Toggle 2", v => logWindow.AddLabel("Toggle2: " + v), defaultValue: false)
     .AddToggle("Toggle 3", v => logWindow.AddLabel("Toggle3: " + v), defaultValue: false)
     .Parent
     .AddDropdown(v => logWindow.AddLabel("Dropdown Value: " + v), "option A", "option B", "option C")
     .AddInputField(v => logWindow.AddLabel("InputField Value: " + v), v => logWindow.AddLabel("InptuField EndEdit:" + v), "Input", "PlaceHolder")
     .AddInputField("InputField", v => logWindow.AddLabel("InputField Value: " + v), v => logWindow.AddLabel("InptuField EndEdit:" + v), "Input", "PlaceHolder")
     .AddInputFieldWithButton("OpenURL", url => Application.OpenURL(url), initialValue: "https://www.youtube.com/channel/UCmgWMQkenFc72QnYkdxdoKA")
     ;
 }
Beispiel #14
0
 public static void SetWindowPos(IgniteWindow window)
 {
     window.RectTransform.anchoredPosition = nextWindowPos;
     nextWindowPos += new Vector2(IgniteGUISettings.ElementHeight, -IgniteGUISettings.ElementHeight);
 }