-
Notifications
You must be signed in to change notification settings - Fork 120
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added Camera Feature Inspector Component
- Loading branch information
Showing
6 changed files
with
414 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
115 changes: 115 additions & 0 deletions
115
Assets/AWSIM/Scripts/Editor/Sensors/CameraSensorFeatureManagerEditor.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,115 @@ | ||
using UnityEngine; | ||
using UnityEditor; | ||
|
||
namespace AWSIM | ||
{ | ||
|
||
[CustomEditor(typeof(CameraSensorFeatureManager))] | ||
public class CameraSensorFeatureManagerEditor : Editor | ||
{ | ||
|
||
private CameraSensorFeatureManager manager; | ||
|
||
private SerializedProperty hueProperty; | ||
private SerializedProperty saturationProperty; | ||
private SerializedProperty contrastProperty; | ||
private SerializedProperty postExposureProperty; | ||
|
||
private SerializedProperty exposureModeProperty; | ||
|
||
private SerializedProperty bloomEffectProperty; | ||
private SerializedProperty chromaticAberrationProperty; | ||
private SerializedProperty depthOfFieldProperty; | ||
private SerializedProperty motionBlurProperty; | ||
|
||
|
||
private void OnEnable() | ||
{ | ||
manager = (CameraSensorFeatureManager)target; | ||
|
||
hueProperty = serializedObject.FindProperty("hue"); | ||
saturationProperty = serializedObject.FindProperty("saturation"); | ||
contrastProperty = serializedObject.FindProperty("contrast"); | ||
postExposureProperty =serializedObject.FindProperty("postExposure"); | ||
|
||
exposureModeProperty = serializedObject.FindProperty("exposureMode"); | ||
|
||
bloomEffectProperty = serializedObject.FindProperty("bloomEffect"); | ||
chromaticAberrationProperty = serializedObject.FindProperty("chromaticAberration"); | ||
depthOfFieldProperty = serializedObject.FindProperty("depthOfField"); | ||
motionBlurProperty = serializedObject.FindProperty("motionBlur"); | ||
} | ||
|
||
public override void OnInspectorGUI() | ||
{ | ||
// ------ Components ------- // | ||
EditorGUILayout.PropertyField(serializedObject.FindProperty("camera"), true); | ||
EditorGUILayout.PropertyField(serializedObject.FindProperty("cameraSensor"), true); | ||
EditorGUILayout.PropertyField(serializedObject.FindProperty("volume"), true); | ||
EditorGUILayout.PropertyField(serializedObject.FindProperty("profile"), true); | ||
|
||
// ------ Image Adjustment ------- // | ||
EditorGUILayout.PropertyField(serializedObject.FindProperty("hue"), true); | ||
if(hueProperty.boolValue) | ||
{ | ||
EditorGUILayout.PropertyField(serializedObject.FindProperty("hueValue"), true); | ||
} | ||
|
||
EditorGUILayout.PropertyField(serializedObject.FindProperty("saturation"), true); | ||
if(saturationProperty.boolValue) | ||
{ | ||
EditorGUILayout.PropertyField(serializedObject.FindProperty("saturationValue"), true); | ||
} | ||
|
||
EditorGUILayout.PropertyField(serializedObject.FindProperty("contrast"), true); | ||
if(contrastProperty.boolValue) | ||
{ | ||
EditorGUILayout.PropertyField(serializedObject.FindProperty("contrastValue"), true); | ||
} | ||
|
||
EditorGUILayout.PropertyField(serializedObject.FindProperty("postExposure"), true); | ||
if(postExposureProperty.boolValue) | ||
{ | ||
EditorGUILayout.PropertyField(serializedObject.FindProperty("postExposureValue"), true); | ||
} | ||
|
||
// ------ Exposure Settings ------- // | ||
EditorGUILayout.PropertyField(serializedObject.FindProperty("exposureMode"), true); | ||
if(exposureModeProperty.enumValueIndex != 0) | ||
{ | ||
EditorGUILayout.PropertyField(serializedObject.FindProperty("ISO"), true); | ||
EditorGUILayout.PropertyField(serializedObject.FindProperty("shutterSpeed"), true); | ||
EditorGUILayout.PropertyField(serializedObject.FindProperty("aperture"), true); | ||
} | ||
|
||
|
||
// ------ Additonal Effect ------- // | ||
|
||
EditorGUILayout.PropertyField(serializedObject.FindProperty("bloomEffect"), true); | ||
if(bloomEffectProperty.boolValue) | ||
{ | ||
EditorGUILayout.PropertyField(serializedObject.FindProperty("bloomValue"), true); | ||
} | ||
|
||
EditorGUILayout.PropertyField(serializedObject.FindProperty("chromaticAberration"), true); | ||
if(chromaticAberrationProperty.boolValue) | ||
{ | ||
EditorGUILayout.PropertyField(serializedObject.FindProperty("chromaticAberrationValue"), true); | ||
} | ||
|
||
EditorGUILayout.PropertyField(serializedObject.FindProperty("depthOfField"), true); | ||
if(depthOfFieldProperty.boolValue) | ||
{ | ||
EditorGUILayout.PropertyField(serializedObject.FindProperty("focusDistance"), true); | ||
} | ||
|
||
EditorGUILayout.PropertyField(serializedObject.FindProperty("motionBlur"), true); | ||
|
||
|
||
serializedObject.ApplyModifiedProperties(); | ||
} | ||
} | ||
|
||
|
||
} | ||
|
11 changes: 11 additions & 0 deletions
11
Assets/AWSIM/Scripts/Editor/Sensors/CameraSensorFeatureManagerEditor.cs.meta
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.