Ejemplo n.º 1
0
        protected override void OnGUI()
        {
            base.OnGUI();

            var rect  = Rectangle;
            var arrow = new Rect(rect.x + rect.width / 2 - 7, rect.y + rect.height, 15, 15);

            GUI.DrawTexture(arrow, Assets["arrowdown"]);
            if (Input.ButtonReleased(Editor.EMouseButton.Left))
            {
                if (arrow.Contains(Input.MousePosition))
                {
                    if (LineOut2 != null)
                    {
                        LineOut2.Remove();
                        LineOut2 = null;
                    }

                    LineOut2 = LoopableLine.HookLineOut2(this);
                    Window.AddControl(LineOut2);
                    Input.Use();
                }
            }
            else if (Input.ButtonReleased(Editor.EMouseButton.Right))
            {
                if (arrow.Contains(Input.MousePosition))
                {
                    if (LineOut2 != null)
                    {
                        LineOut2.Remove();
                        LineOut2 = null;
                    }

                    Input.Use();
                }
            }
        }