public override void OnInspectorGUI() { this.serializedObject.Update(); Effector2D target = this.target as Effector2D; this.m_ShowColliderMask.target = target.useColliderMask; EditorGUILayout.PropertyField(this.m_UseColliderMask); if (EditorGUILayout.BeginFadeGroup(this.m_ShowColliderMask.faded)) { EditorGUILayout.PropertyField(this.m_ColliderMask); } EditorGUILayout.EndFadeGroup(); this.serializedObject.ApplyModifiedProperties(); base.OnInspectorGUI(); if (((IEnumerable <Collider2D>)target.GetComponents <Collider2D>()).Any <Collider2D>((Func <Collider2D, bool>)(collider => { if (collider.enabled) { return(collider.usedByEffector); } return(false); }))) { return; } if (target.requiresCollider) { EditorGUILayout.HelpBox("This effector will not function until there is at least one enabled 2D collider with 'Used by Effector' checked on this GameObject.", MessageType.Warning); } else { EditorGUILayout.HelpBox("This effector can optionally work without a 2D collider.", MessageType.Info); } }
public override void OnInspectorGUI() { base.serializedObject.Update(); Effector2D effector2D = this.target as Effector2D; this.m_ShowColliderMask.target = effector2D.useColliderMask; EditorGUILayout.PropertyField(this.m_UseColliderMask, new GUILayoutOption[0]); if (EditorGUILayout.BeginFadeGroup(this.m_ShowColliderMask.faded)) { EditorGUILayout.PropertyField(this.m_ColliderMask, new GUILayoutOption[0]); } EditorGUILayout.EndFadeGroup(); base.serializedObject.ApplyModifiedProperties(); base.OnInspectorGUI(); if (effector2D.GetComponents <Collider2D>().Any((Collider2D collider) => collider.enabled && collider.usedByEffector)) { return; } if (effector2D.requiresCollider) { EditorGUILayout.HelpBox("This effector will not function until there is at least one enabled 2D collider with 'Used by Effector' checked on this GameObject.", MessageType.Warning); } else { EditorGUILayout.HelpBox("This effector can optionally work without a 2D collider.", MessageType.Info); } }
public override void OnInspectorGUI() { base.OnInspectorGUI(); Effector2D effector2D = this.target as Effector2D; if (effector2D.GetComponents <Collider2D>().Any((Collider2D collider) => collider.enabled && collider.usedByEffector)) { return; } if (effector2D.requiresCollider) { EditorGUILayout.HelpBox("This effector will not function until there is at least one enabled 2D collider with 'Used by Effector' checked on this GameObject.", MessageType.Warning); } else { EditorGUILayout.HelpBox("This effector can optionally work without a 2D collider.", MessageType.Info); } }