예제 #1
0
        public static void AddButton(DebugButtonPanel btnPanel, string btnLabel, Action onClickFunction, out GameObject debugBtnObj)
        {
            debugBtnObj = null;
            if (LC_Utils.IsBuildForProduction())
            {
                return;
            }

            Vector3 btnPos = btnPanel.transform.position;

            btnPos += btnPanel.transform.up * (btnPanel.ButtonQuantity * LC_Utils.GetDefaultButtonSize().y);

            if (btnPanel.ButtonQuantity != 0)
            {
                btnPos += btnPanel.transform.up * btnPanel.ButtonQuantity * LC_Utils.GetDefaultButtonPanelOffset();
            }

            GameObject newBtn = LC_Debug.CreateDebugButton(btnLabel, btnPos, onClickFunction, false);

            newBtn.transform.rotation = btnPanel.transform.rotation;
            newBtn.transform.parent   = btnPanel.transform;

            btnPanel.ButtonQuantity++;
            debugBtnObj = newBtn;
        }
예제 #2
0
 public static void AddButton(DebugButtonPanel btnPanel, string btnLabel, Action onClickFunction)
 {
     AddButton(btnPanel, btnLabel, onClickFunction, out GameObject suppObj);
 }