示例#1
0
        public override void OnInspectorGUI()
        {
            base.OnInspectorGUI();

            GUITools.Space(2);
            EditorGUILayout.LabelField("Debug:", GUITools.boldLabel);
            debugMessage = EditorGUILayout.TextArea(debugMessage);
            buttons      = EditorGUILayout.IntField("Buttons Count", buttons);

            if (GUILayout.Button("Start Debug"))
            {
                ActionHintsPanel panel = target as ActionHintsPanel;
                panel.textUI.SetText(debugMessage);


                panel.RemoveAllHintElements();

                ActionHint actionHint = UnityTools.GameSettingsSystem.GameSettings.GetSettings <UISettings>().debugActionHintUI;
                for (int i = 0; i < buttons; i++)
                {
                    panel.AddHintElement(Instantiate(actionHint), "Buttons " + i, false);
                }
                panel.UpdateElementLayout();//true);
                EditorUtility.SetDirty(panel);
            }

            if (GUILayout.Button("End Debug"))
            {
                ActionHintsPanel panel = target as ActionHintsPanel;
                panel.RemoveAllHintElements();
                panel.UpdateElementLayout();//true);
                EditorUtility.SetDirty(panel);
            }
        }