/// <summary> /// Implement this function to make a custom inspector. /// </summary> public override void OnInspectorGUI() { BDDExtensionRunner bddExtensionRunner = ((Component)target).gameObject.GetComponent <BDDExtensionRunner>(); string openComponentButtonTextureFullPath = Utilities.GetAssetFullPath(bddExtensionRunner, this.MainTexturePath); BaseBDDComponent script = (BaseBDDComponent)target; if (EditorApplication.isCompiling) { script.Checking = true; } BDDExtensionRunner runner = script.gameObject.GetComponent <BDDExtensionRunner>(); if (runner != null) { this.unityInterface.EditorGUILayoutBeginHorizontal(); Texture2D texture = this.unityInterface.AssetDatabaseLoadAssetAtPath(openComponentButtonTextureFullPath, typeof(Texture2D)); GUILayoutOption[] options = new GUILayoutOption[1] { this.unityInterface.GUILayoutHeight(70) }; GUIContent label = new GUIContent(texture); EditorGUILayout.LabelField(label, options); this.unityInterface.EditorGUILayoutEndHorizontal(); ComponentsChecker checkForErrors = new ComponentsChecker(); script.Errors = checkForErrors.Check(script); if (script.Errors.Count > 0) { BaseBDDComponentEditorBusinessLogic businessLogic = new BaseBDDComponentEditorBusinessLogic(script); businessLogic.Errors(script.Errors, this.unityInterface); } else { this.DrawDefaultInspector(); } script.Checking = false; } else { this.DrawDefaultInspector(); } }
/// <summary> /// Awakes this instance. /// </summary> public void Awake() { BaseBDDComponent script = (BaseBDDComponent)target; script.Checking = true; }