protected override void OnPreviewSettingGUI()
        {
            GUILayout.Label("UI", EditorStyles.boldLabel);

            Panel  targetPanel = TransformUtils.GetComponentByPath <Panel>(_tstpt.targetPath);
            string targetPath  = (EditorGUILayout.ObjectField(new GUIContent("Panel in Scene", "The target panel in current scene, this will be converted and saved as path string."), targetPanel, typeof(Panel), true) as Panel).ToPath();

            if (targetPanel == null && !string.IsNullOrEmpty(_tstpt.targetPath))
            {
                GUI.contentColor = Color.red;
            }
            string customTargetPath = EditorGUILayout.TextField(new GUIContent(string.IsNullOrEmpty(_tstpt.targetPath) ? "Enter Manually" : (targetPanel == null ? "Not Found" : " "), "Manually set the target path, use this for dynamically-loaded prefab."), _tstpt.targetPath);

            if (customTargetPath != _tstpt.targetPath)
            {
                EditorUtility.SetDirty(_tstpt);
                Undo.RegisterCompleteObjectUndo(_tstpt, "Reassign Custom Target Path");
                _tstpt.targetPath = customTargetPath;
                targetPath        = customTargetPath;
            }
            if (targetPanel == null && !string.IsNullOrEmpty(_tstpt.targetPath))
            {
                GUI.contentColor = Color.white;
            }
            if ((string.IsNullOrEmpty(_tstpt.targetPath) || targetPanel != null) && targetPath != _tstpt.targetPath)
            {
                EditorUtility.SetDirty(_tstpt);
                Undo.RegisterCompleteObjectUndo(_tstpt, "Reassign Target Path");
                _tstpt.targetPath = targetPath;
            }
        }
        public override bool Init()
        {
            if (checkTarget)
            {
                if (string.IsNullOrEmpty(targetPath))
                {
                    Debug.LogErrorFormat("{0}:{1}:Init - Target object not set, targetPath={2}", name, GetType(), targetPath);
                    return(false);
                }

                targetTF = TransformUtils.GetTransformByPath(targetPath);
                if (targetTF == null)
                {
                    Debug.LogErrorFormat("{0}:{1}:Init - Target transform not found, targetPath={2}", name, GetType(), targetPath);
                    return(false);
                }

                if (skipIfTargetInactive && !targetTF.gameObject.activeInHierarchy)
                {
                    Debug.LogErrorFormat("{0}:{1}:Init - Target object not active", name, GetType());
                    return(false);
                }
            }

            _disableButtons = new Button[disableButtonPaths.Length];
            for (int i = 0, imax = disableButtonPaths.Length; i < imax; i++)
            {
                Button b = TransformUtils.GetComponentByPath <Button>(disableButtonPaths[i]);
                if (b == null)
                {
                    Debug.LogErrorFormat("{0}:{1}:Init - Disable collider not found, disableButtonPaths={2}", name, GetType(), disableButtonPaths[i]);
                }
                _disableButtons[i] = b;
            }

            tutorialPanel = TutorialPanel.current;
            if (tutorialPanel == null)
            {
                Debug.LogErrorFormat("{0}:{1}:Init - TutorialPanel instance not found, targetPath={2}", name, GetType(), targetPath);
                return(false);
            }

            tutorialPanel.Reset(!showBackgroundMask);

            return(true);
        }
        protected virtual void OnDisableButtonsSettingGUI()
        {
            _showDisableButtons = EditorGUILayout.Foldout(_showDisableButtons, "Disable Buttons");
            EditorGUI.indentLevel++;

            if (_showDisableButtons)
            {
                int size = EditorGUILayout.IntField(new GUIContent("Size", "Number of button to be disabled."), _tht.disableButtonPaths.Length);

                if (size != _tht.disableButtonPaths.Length)
                {
                    EditorUtility.SetDirty(_tht);
                    Undo.RegisterCompleteObjectUndo(_tht, "Reassign Disable Buttons");
                    System.Array.Resize(ref _tht.disableButtonPaths, size);
                }

                for (int i = 0, imax = _tht.disableButtonPaths.Length; i < imax; i++)
                {
                    Button button     = TransformUtils.GetComponentByPath <Button>(_tht.disableButtonPaths[i]);
                    string buttonPath = TransformUtils.ToPath(EditorGUILayout.ObjectField("Button " + i, button, typeof(Button), true) as Button);
                    if (!string.IsNullOrEmpty(_tht.disableButtonPaths[i]) && button == null)                       // Set but targetTF not found, this may be because in wrong scene
                    {
                        GUI.contentColor = Color.red;
                        string customButtonPath = EditorGUILayout.TextField("Not Found!", _tht.disableButtonPaths[i]);
                        if (customButtonPath != _tht.disableButtonPaths[i])
                        {
                            EditorUtility.SetDirty(_tht);
                            Undo.RegisterCompleteObjectUndo(_tht, "Reassign Custom Button Path");
                            _tht.disableButtonPaths[i] = customButtonPath;
                        }
                        GUI.contentColor = Color.white;
                    }
                    if (!string.IsNullOrEmpty(buttonPath) && buttonPath != _tht.disableButtonPaths[i])
                    {
                        EditorUtility.SetDirty(_tht);
                        Undo.RegisterCompleteObjectUndo(_tht, "Reassign Button Path");
                        _tht.disableButtonPaths[i] = buttonPath;
                    }
                }
            }

            EditorGUI.indentLevel--;
        }