Skip to content

Commit

Permalink
Added Camera Feature Inspector Component
Browse files Browse the repository at this point in the history
  • Loading branch information
szylis committed Mar 28, 2024
1 parent d5787e6 commit 6d4d2ef
Show file tree
Hide file tree
Showing 6 changed files with 414 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ MonoBehaviour:
m_OverrideState: 0
m_Value: {fileID: 0}
intensity:
m_OverrideState: 0
m_OverrideState: 1
m_Value: 0
min: 0
max: 1
Expand All @@ -202,10 +202,10 @@ MonoBehaviour:
active: 0
m_AdvancedMode: 0
quality:
m_OverrideState: 1
m_OverrideState: 0
m_Value: 2
focusMode:
m_OverrideState: 1
m_OverrideState: 0
m_Value: 1
focusDistance:
m_OverrideState: 1
Expand All @@ -228,33 +228,33 @@ MonoBehaviour:
m_Value: 20
min: 0
m_NearSampleCount:
m_OverrideState: 1
m_OverrideState: 0
m_Value: 8
min: 3
max: 8
m_NearMaxBlur:
m_OverrideState: 1
m_OverrideState: 0
m_Value: 7
min: 0
max: 8
m_FarSampleCount:
m_OverrideState: 1
m_OverrideState: 0
m_Value: 14
min: 3
max: 16
m_FarMaxBlur:
m_OverrideState: 1
m_OverrideState: 0
m_Value: 13
min: 0
max: 16
m_HighQualityFiltering:
m_OverrideState: 1
m_OverrideState: 0
m_Value: 1
m_Resolution:
m_OverrideState: 1
m_OverrideState: 0
m_Value: 1
m_PhysicallyBased:
m_OverrideState: 1
m_OverrideState: 0
m_Value: 0
--- !u!114 &-2696452528647907726
MonoBehaviour:
Expand All @@ -268,10 +268,10 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: bcf384b154398e341b6b29969c078198, type: 3}
m_Name: MotionBlur
m_EditorClassIdentifier:
active: 1
active: 0
m_AdvancedMode: 0
quality:
m_OverrideState: 1
m_OverrideState: 0
m_Value: 2
intensity:
m_OverrideState: 1
Expand All @@ -283,7 +283,7 @@ MonoBehaviour:
min: 0
max: 1500
minimumVelocity:
m_OverrideState: 1
m_OverrideState: 0
m_Value: 0
min: 0
max: 64
Expand Down Expand Up @@ -314,7 +314,7 @@ MonoBehaviour:
min: 0
max: 20
m_SampleCount:
m_OverrideState: 1
m_OverrideState: 0
m_Value: 12
min: 2
--- !u!114 &-1020721212055412715
Expand All @@ -332,7 +332,7 @@ MonoBehaviour:
active: 0
m_AdvancedMode: 0
quality:
m_OverrideState: 1
m_OverrideState: 0
m_Value: 2
threshold:
m_OverrideState: 0
Expand Down Expand Up @@ -365,13 +365,13 @@ MonoBehaviour:
m_OverrideState: 0
m_Value: 1
m_Resolution:
m_OverrideState: 1
m_OverrideState: 0
m_Value: 2
m_HighQualityPrefiltering:
m_OverrideState: 1
m_OverrideState: 0
m_Value: 1
m_HighQualityFiltering:
m_OverrideState: 1
m_OverrideState: 0
m_Value: 1
--- !u!114 &11400000
MonoBehaviour:
Expand Down
8 changes: 8 additions & 0 deletions Assets/AWSIM/Scripts/Editor/Sensors.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

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();
}
}


}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 6d4d2ef

Please sign in to comment.