Esempio n. 1
0
        public override void OnInspectorGUI()
        {
            base.OnInspectorGUI();
            try
            {
                bool passThroughChanged = false;
                EditorGUI.BeginChangeCheck();
                {
                    EditorGUI.BeginChangeCheck();
                    {
                        EditorGUILayout.PropertyField(passThroughProp);
                    }
                    if (EditorGUI.EndChangeCheck())
                    {
                        passThroughChanged = true;
                    }
                    if (!passThroughProp.boolValue)
                    {
                        EditorGUILayout.PropertyField(operationProp);
                    }
                }
                if (EditorGUI.EndChangeCheck())
                {
                    serializedObject.ApplyModifiedProperties();
                    if (passThroughChanged)
                    {
                        foreach (var target in serializedObject.targetObjects)
                        {
                            var operation = target as ChiselOperation;
                            if (!operation)
                            {
                                continue;
                            }

                            CSGNodeHierarchyManager.UpdateAvailability(operation);
                        }
                    }
                }
            }
            catch (ExitGUIException) { }
            catch (Exception ex) { Debug.LogException(ex); }
        }
 protected void OnDisable()
 {
     // Note: cannot call OnCleanup here
     CSGNodeHierarchyManager.UpdateAvailability(this);
 }
 protected void OnEnable()
 {
     OnInitialize(); // Awake is not reliable, so we initialize here
     CSGNodeHierarchyManager.UpdateAvailability(this);
 }