コード例 #1
0
        private void Update()
        {
            PanelWithChildren panel = gameObject.GetComponent <PanelWithChildren> ();

            if (Input.GetMouseButtonDown(0))
            {
                panel.alignDirection = (Aligner.AlignDirection)((int)(panel.alignDirection + 1) % System.Enum.GetNames(typeof(Aligner.AlignDirection)).Length);
                Debug.Log(panel.alignDirection);
                panel.Rebuild();
            }

            if (Input.GetMouseButtonDown(1))
            {
                panel.inverted = !panel.inverted;
                Debug.Log(panel.inverted);
                panel.Rebuild();
            }

            if (Input.GetMouseButtonDown(2))
            {
                RectTransform rt = this.gameObject.transform as RectTransform;
                Debug.Log(panel.inverted);
                rt.offsetMax *= 1.1f;
                panel.Rebuild();
            }
        }
コード例 #2
0
    public static void Test_Pivot()
    {
        PanelWithChildren panel = Prepare();

        panel.SetAligner_Pivot();
        panel.Rebuild();
    }
コード例 #3
0
    public static void Test_AdaptiveTile()
    {
        PanelWithChildren panel = Prepare();

        panel.SetAligner_AdaptiveTile(5, 3);
        panel.Rebuild();
    }
コード例 #4
0
    public static void Test_FixedTile()
    {
        PanelWithChildren panel = Prepare();

        panel.SetAligner_FixedTile(new Vector2(0.5f, 0.75f));
        panel.Rebuild();
    }