chunk 2: remaining non-audio non-NewImport assets

This commit is contained in:
2026-04-06 11:25:19 +03:00
parent 0d11a097d8
commit ed675b9f4a
3742 changed files with 1640416 additions and 0 deletions

View File

@@ -0,0 +1,54 @@
#if UNITY_EDITOR
using UnityEditor;
using UnityEngine;
namespace FirstGearGames.SmoothCameraShaker.EditorDesign
{
[CustomEditor(typeof(CameraShaker))]
public class CameraShakerEditor : UnityEditor.Editor
{
private MonoScript _script;
private SerializedProperty _shakeTechnique;
private SerializedProperty _makeDefaultOnEnable;
private SerializedProperty _limitMagnitude;
private SerializedProperty _positionalMagnitudeLimit;
private SerializedProperty _rotationalMagnitudeLimit;
private void OnEnable()
{
_script = MonoScript.FromMonoBehaviour((CameraShaker)target);
_shakeTechnique = serializedObject.FindProperty("_shakeTechnique");
_makeDefaultOnEnable = serializedObject.FindProperty("_makeDefaultOnEnable");
_limitMagnitude = serializedObject.FindProperty("_limitMagnitude");
_positionalMagnitudeLimit = serializedObject.FindProperty("_positionalMagnitudeLimit");
_rotationalMagnitudeLimit = serializedObject.FindProperty("_rotationalMagnitudeLimit");
}
public override void OnInspectorGUI()
{
serializedObject.Update();
EditorGUI.BeginDisabledGroup(true);
_script = EditorGUILayout.ObjectField("Script:", _script, typeof(MonoScript), false) as MonoScript;
EditorGUI.EndDisabledGroup();
EditorGUILayout.PropertyField(_shakeTechnique, new GUIContent("Shake Technique", "Sets the shake technique to use. Changing this value while shakes are occurring may create unwanted results."));
EditorGUILayout.PropertyField(_makeDefaultOnEnable, new GUIContent("Make Default On Enable", "True for this CameraShaker to be set as the default shaker when enabled."));
//Limit magnitude.
EditorGUILayout.PropertyField(_limitMagnitude, new GUIContent("Limit Magnitude", "True to limit how much magnitude can be applied to this CameraShaker."));
if (_limitMagnitude.boolValue == true)
{
EditorGUI.indentLevel++;
EditorGUILayout.PropertyField(_positionalMagnitudeLimit, new GUIContent("Positional Magnitude Limit", "How much positional magnitude to limit this CameraShaker to."));
EditorGUILayout.PropertyField(_rotationalMagnitudeLimit, new GUIContent("Rotational Magnitude Limit", "How much rotational magnitude to limit this CameraShaker to."));
EditorGUI.indentLevel--;
}
//EditorGUILayout.Space();
serializedObject.ApplyModifiedProperties();
}
}
}
#endif

View File

@@ -0,0 +1,18 @@
fileFormatVersion: 2
guid: 39673e360e66d1a439ff2d7b3bc8cdce
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
AssetOrigin:
serializedVersion: 1
productId: 162991
packageName: Smooth Camera Shaker
packageVersion: 2.12
assetPath: Assets/FirstGearGames/SmoothCameraShaker/Scripts/Editor/CameraShakerEditor.cs
uploadId: 376379

View File

@@ -0,0 +1,54 @@
#if UNITY_EDITOR
using UnityEditor;
using UnityEngine;
namespace FirstGearGames.SmoothCameraShaker.EditorDesign
{
[CustomEditor(typeof(ObjectShaker))]
public class ObjectShakerEditor : UnityEditor.Editor
{
private MonoScript _script;
private SerializedProperty _removeFromManagerOnDisable;
private SerializedProperty _limitMagnitude;
private SerializedProperty _positionalMagnitudeLimit;
private SerializedProperty _rotationalMagnitudeLimit;
private SerializedProperty _shakeOnEnable;
private void OnEnable()
{
_script = MonoScript.FromMonoBehaviour((ObjectShaker)target);
_removeFromManagerOnDisable = serializedObject.FindProperty("_removeFromManagerOnDisable");
_limitMagnitude = serializedObject.FindProperty("_limitMagnitude");
_positionalMagnitudeLimit = serializedObject.FindProperty("_positionalMagnitudeLimit");
_rotationalMagnitudeLimit = serializedObject.FindProperty("_rotationalMagnitudeLimit");
_shakeOnEnable = serializedObject.FindProperty("_shakeOnEnable");
}
public override void OnInspectorGUI()
{
serializedObject.Update();
EditorGUI.BeginDisabledGroup(true);
_script = EditorGUILayout.ObjectField("Script:", _script, typeof(MonoScript), false) as MonoScript;
EditorGUI.EndDisabledGroup();
EditorGUILayout.PropertyField(_removeFromManagerOnDisable, new GUIContent("Remove From Manager On Disable", "True to remove this shakers reference from it's handler when disabled. Useful if you have a lot of these shakers in your scene, but objects are not always enabled."));
//Limit magnitude.
EditorGUILayout.PropertyField(_limitMagnitude, new GUIContent("Limit Magnitude", "True to limit how much magnitude can be applied to this CameraShaker."));
if (_limitMagnitude.boolValue == true)
{
EditorGUI.indentLevel++;
EditorGUILayout.PropertyField(_positionalMagnitudeLimit, new GUIContent("Positional Magnitude Limit", "How much positional magnitude to limit this CameraShaker to."));
EditorGUILayout.PropertyField(_rotationalMagnitudeLimit, new GUIContent("Rotational Magnitude Limit", "How much rotational magnitude to limit this CameraShaker to."));
EditorGUI.indentLevel--;
}
EditorGUILayout.Space();
EditorGUILayout.PropertyField(_shakeOnEnable, new GUIContent("Shake On Enable", "ShakeData to run when enabled. Leave empty to not use this feature."));
serializedObject.ApplyModifiedProperties();
}
}
}
#endif

View File

@@ -0,0 +1,18 @@
fileFormatVersion: 2
guid: 24aa2069ec449a44ebb549753ac1a40b
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
AssetOrigin:
serializedVersion: 1
productId: 162991
packageName: Smooth Camera Shaker
packageVersion: 2.12
assetPath: Assets/FirstGearGames/SmoothCameraShaker/Scripts/Editor/ObjectShakerEditor.cs
uploadId: 376379

View File

@@ -0,0 +1,79 @@
#if UNITY_EDITOR
using UnityEditor;
using UnityEngine;
namespace FirstGearGames.SmoothCameraShaker.EditorDesign
{
[CustomEditor(typeof(ShakableCanvas))]
public class ShakableCanvasEditor : UnityEditor.Editor
{
private MonoScript _script;
private SerializedProperty _shakerType;
private SerializedProperty _useDefaultCameraShaker;
private SerializedProperty _cameraShaker;
private SerializedProperty _encapsulateChildren;
private SerializedProperty _monitorEncapsulation;
private SerializedProperty _positionalMultiplier;
private SerializedProperty _rotationalMultiplier;
private SerializedProperty _randomizeDirections;
private void OnEnable()
{
_script = MonoScript.FromMonoBehaviour((ShakableCanvas)target);
//ShakableBase.
_shakerType = serializedObject.FindProperty("_shakerType");
//ShakableCanvas.
_positionalMultiplier = serializedObject.FindProperty("_positionalMultiplier");
_rotationalMultiplier = serializedObject.FindProperty("_rotationalMultiplier");
_useDefaultCameraShaker = serializedObject.FindProperty("_useDefaultCameraShaker");
_cameraShaker = serializedObject.FindProperty("_cameraShaker");
_encapsulateChildren = serializedObject.FindProperty("_encapsulateChildren");
_monitorEncapsulation = serializedObject.FindProperty("_monitorEncapsulation");
_randomizeDirections = serializedObject.FindProperty("_randomizeDirections");
}
public override void OnInspectorGUI()
{
serializedObject.Update();
EditorGUI.BeginDisabledGroup(true);
_script = EditorGUILayout.ObjectField("Script:", _script, typeof(MonoScript), false) as MonoScript;
EditorGUI.EndDisabledGroup();
//Only allow changing when not in play mode. This will be done for all scripts once their editors are made.
EditorGUI.BeginDisabledGroup(Application.isPlaying);
EditorGUILayout.PropertyField(_shakerType, new GUIContent("Shaker Type", "Shaker type to use. CameraShaker will subscribe to your current or otherwise configured CameraShaker. ObjectShaker will subscribe to the first ObjectShaker found on or in parented objects."));
EditorGUI.EndDisabledGroup();
//If using CameraShaker type.
if ((ShakableBase.ShakerTypes)_shakerType.intValue == ShakableBase.ShakerTypes.CameraShaker)
{
EditorGUILayout.PropertyField(_useDefaultCameraShaker, new GUIContent("Use Default CameraShaker", "True to shake when the default camera shaker does. False to specify a camera shaker to monitor."));
if (_useDefaultCameraShaker.boolValue == false)
{
EditorGUI.indentLevel++;
EditorGUILayout.PropertyField(_cameraShaker, new GUIContent("Camera Shaker", "Camera shaker to monitor."));
EditorGUI.indentLevel--;
}
}
EditorGUILayout.PropertyField(_encapsulateChildren, new GUIContent("Encapsulate Children", "True to create a parent object and attach children to it. The parent object will be shaken instead of each individual canvas child. If your direct children move at all this value must be true. Setting value as false may incur extra cost as well."));
if (_encapsulateChildren.boolValue == true)
{
EditorGUI.indentLevel++;
EditorGUILayout.PropertyField(_monitorEncapsulation, new GUIContent("Monitor Encapsulation", "True to watch for additional children to encapsulate. This may be false if you do not add direct children to this canvas at runtime."));
EditorGUI.indentLevel--;
}
EditorGUILayout.Space();
EditorGUILayout.PropertyField(_positionalMultiplier, new GUIContent("Positional Multiplier", "Positional shakes are multiplied by this value. Lower values will result in a lower positional magnitude."));
EditorGUILayout.PropertyField(_rotationalMultiplier, new GUIContent("Rotational Multiplier", "Rotational shakes are multiplied by this value. Lower values will result in a lower rotational magnitude."));
EditorGUILayout.Space();
EditorGUILayout.PropertyField(_randomizeDirections, new GUIContent("Randomize Directions", "True to randomly change influence direction when shaking starts."));
serializedObject.ApplyModifiedProperties();
}
}
}
#endif

View File

@@ -0,0 +1,18 @@
fileFormatVersion: 2
guid: e9dbe6ce96c96db4891c82856e589da3
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
AssetOrigin:
serializedVersion: 1
productId: 162991
packageName: Smooth Camera Shaker
packageVersion: 2.12
assetPath: Assets/FirstGearGames/SmoothCameraShaker/Scripts/Editor/ShakableCanvasEditor.cs
uploadId: 376379

View File

@@ -0,0 +1,73 @@
#if UNITY_EDITOR
using UnityEditor;
using UnityEngine;
namespace FirstGearGames.SmoothCameraShaker.EditorDesign
{
[CustomEditor(typeof(ShakableRigidbody2D))]
public class ShakableRigidbody2DEditor : UnityEditor.Editor
{
private MonoScript _script;
private SerializedProperty _shakerType;
private SerializedProperty _positionalMultiplier;
private SerializedProperty _rotationalMultiplier;
private SerializedProperty _requireInView;
private SerializedProperty _includeChildren;
private SerializedProperty _ignoreSelf;
private SerializedProperty _includeInactive;
private SerializedProperty _localizeShake;
private SerializedProperty _randomizeDirections;
private void OnEnable()
{
_script = MonoScript.FromMonoBehaviour((ShakableRigidbody2D)target);
//ShakableBase.
_shakerType = serializedObject.FindProperty("_shakerType");
//ShakableRigidbody2D
_positionalMultiplier = serializedObject.FindProperty("_positionalMultiplier");
_rotationalMultiplier = serializedObject.FindProperty("_rotationalMultiplier");
_requireInView = serializedObject.FindProperty("_requireInView");
_includeChildren = serializedObject.FindProperty("_includeChildren");
_ignoreSelf = serializedObject.FindProperty("_ignoreSelf");
_includeInactive = serializedObject.FindProperty("_includeInactive");
_localizeShake = serializedObject.FindProperty("_localizeShake");
_randomizeDirections = serializedObject.FindProperty("_randomizeDirections");
}
public override void OnInspectorGUI()
{
serializedObject.Update();
EditorGUI.BeginDisabledGroup(true);
_script = EditorGUILayout.ObjectField("Script:", _script, typeof(MonoScript), false) as MonoScript;
EditorGUI.EndDisabledGroup();
//Only allow changing when not in play mode. This will be done for all scripts once their editors are made.
EditorGUI.BeginDisabledGroup(Application.isPlaying);
EditorGUILayout.PropertyField(_shakerType, new GUIContent("Shaker Type", "Shaker type to use. CameraShaker will subscribe to your current or otherwise configured CameraShaker. ObjectShaker will subscribe to the first ObjectShaker found on or in parented objects."));
EditorGUI.EndDisabledGroup();
EditorGUILayout.Space();
EditorGUILayout.PropertyField(_positionalMultiplier, new GUIContent("Positional Multiplier", "Positional shakes are multiplied by this value. Lower values will result in a lower positional magnitude."));
EditorGUILayout.PropertyField(_rotationalMultiplier, new GUIContent("Rotational Multiplier", "Rotational shakes are multiplied by this value. Lower values will result in a lower rotational magnitude."));
EditorGUILayout.Space();
EditorGUILayout.PropertyField(_requireInView, new GUIContent("Require In View", "Only shake when in view of a camera."));
EditorGUILayout.PropertyField(_includeChildren, new GUIContent("Include Children", "True to find transforms in children too. This allows you to use one ShakableTransform on the parent if all children transforms should shake as well."));
if (_includeChildren.boolValue == true)
{
EditorGUI.indentLevel++;
EditorGUILayout.PropertyField(_ignoreSelf, new GUIContent("Ignore Self", "True to ignore the transform this component resides, and only shake children."));
EditorGUILayout.PropertyField(_includeInactive, new GUIContent("Include Inactive", "True to also find inactive children."));
EditorGUI.indentLevel--;
}
//EditorGUILayout.Space();
EditorGUILayout.PropertyField(_localizeShake, new GUIContent("Localize Shake", "True to convert forces to local space before applying."));
EditorGUILayout.PropertyField(_randomizeDirections, new GUIContent("Randomize Directions", "True to randomly change influence direction when shaking starts."));
serializedObject.ApplyModifiedProperties();
}
}
}
#endif

View File

@@ -0,0 +1,18 @@
fileFormatVersion: 2
guid: 3ae79d1bef841b042bf9b598d3f3a25e
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
AssetOrigin:
serializedVersion: 1
productId: 162991
packageName: Smooth Camera Shaker
packageVersion: 2.12
assetPath: Assets/FirstGearGames/SmoothCameraShaker/Scripts/Editor/ShakableRigidbody2DEditor.cs
uploadId: 376379

View File

@@ -0,0 +1,73 @@
#if UNITY_EDITOR
using UnityEditor;
using UnityEngine;
namespace FirstGearGames.SmoothCameraShaker.EditorDesign
{
[CustomEditor(typeof(ShakableRigidbody))]
public class ShakableRigidbodyEditor : UnityEditor.Editor
{
private MonoScript _script;
private SerializedProperty _shakerType;
private SerializedProperty _positionalMultiplier;
private SerializedProperty _rotationalMultiplier;
private SerializedProperty _requireInView;
private SerializedProperty _includeChildren;
private SerializedProperty _ignoreSelf;
private SerializedProperty _includeInactive;
private SerializedProperty _localizeShake;
private SerializedProperty _randomizeDirections;
private void OnEnable()
{
_script = MonoScript.FromMonoBehaviour((ShakableRigidbody)target);
//ShakableBase.
_shakerType = serializedObject.FindProperty("_shakerType");
//ShakableRigidbody
_positionalMultiplier = serializedObject.FindProperty("_positionalMultiplier");
_rotationalMultiplier = serializedObject.FindProperty("_rotationalMultiplier");
_requireInView = serializedObject.FindProperty("_requireInView");
_includeChildren = serializedObject.FindProperty("_includeChildren");
_ignoreSelf = serializedObject.FindProperty("_ignoreSelf");
_includeInactive = serializedObject.FindProperty("_includeInactive");
_localizeShake = serializedObject.FindProperty("_localizeShake");
_randomizeDirections = serializedObject.FindProperty("_randomizeDirections");
}
public override void OnInspectorGUI()
{
serializedObject.Update();
EditorGUI.BeginDisabledGroup(true);
_script = EditorGUILayout.ObjectField("Script:", _script, typeof(MonoScript), false) as MonoScript;
EditorGUI.EndDisabledGroup();
//Only allow changing when not in play mode. This will be done for all scripts once their editors are made.
EditorGUI.BeginDisabledGroup(Application.isPlaying);
EditorGUILayout.PropertyField(_shakerType, new GUIContent("Shaker Type", "Shaker type to use. CameraShaker will subscribe to your current or otherwise configured CameraShaker. ObjectShaker will subscribe to the first ObjectShaker found on or in parented objects."));
EditorGUI.EndDisabledGroup();
EditorGUILayout.Space();
EditorGUILayout.PropertyField(_positionalMultiplier, new GUIContent("Positional Multiplier", "Positional shakes are multiplied by this value. Lower values will result in a lower positional magnitude."));
EditorGUILayout.PropertyField(_rotationalMultiplier, new GUIContent("Rotational Multiplier", "Rotational shakes are multiplied by this value. Lower values will result in a lower rotational magnitude."));
EditorGUILayout.Space();
EditorGUILayout.PropertyField(_requireInView, new GUIContent("Require In View", "Only shake when in view of a camera."));
EditorGUILayout.PropertyField(_includeChildren, new GUIContent("Include Children", "True to find transforms in children too. This allows you to use one ShakableTransform on the parent if all children transforms should shake as well."));
if (_includeChildren.boolValue == true)
{
EditorGUI.indentLevel++;
EditorGUILayout.PropertyField(_ignoreSelf, new GUIContent("Ignore Self", "True to ignore the transform this component resides, and only shake children."));
EditorGUILayout.PropertyField(_includeInactive, new GUIContent("Include Inactive", "True to also find inactive children."));
EditorGUI.indentLevel--;
}
//EditorGUILayout.Space();
EditorGUILayout.PropertyField(_localizeShake, new GUIContent("Localize Shake", "True to convert influences to local space before applying."));
EditorGUILayout.PropertyField(_randomizeDirections, new GUIContent("Randomize Directions", "True to randomly change influence direction when shaking starts."));
serializedObject.ApplyModifiedProperties();
}
}
}
#endif

View File

@@ -0,0 +1,18 @@
fileFormatVersion: 2
guid: 32abf3630024ea945b2e0b74588ea34e
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
AssetOrigin:
serializedVersion: 1
productId: 162991
packageName: Smooth Camera Shaker
packageVersion: 2.12
assetPath: Assets/FirstGearGames/SmoothCameraShaker/Scripts/Editor/ShakableRigidbodyEditor.cs
uploadId: 376379

View File

@@ -0,0 +1,73 @@
#if UNITY_EDITOR
using UnityEditor;
using UnityEngine;
namespace FirstGearGames.SmoothCameraShaker.EditorDesign
{
[CustomEditor(typeof(ShakableTransform2D))]
public class ShakableTransform2DEditor : UnityEditor.Editor
{
private MonoScript _script;
private SerializedProperty _shakerType;
private SerializedProperty _positionalMultiplier;
private SerializedProperty _rotationalMultiplier;
private SerializedProperty _requireInView;
private SerializedProperty _includeChildren;
private SerializedProperty _ignoreSelf;
private SerializedProperty _includeInactive;
private SerializedProperty _localizeShake;
private SerializedProperty _randomizeDirections;
private void OnEnable()
{
_script = MonoScript.FromMonoBehaviour((ShakableTransform2D)target);
//ShakableBase.
_shakerType = serializedObject.FindProperty("_shakerType");
//ShakableTransform2D
_positionalMultiplier = serializedObject.FindProperty("_positionalMultiplier");
_rotationalMultiplier = serializedObject.FindProperty("_rotationalMultiplier");
_requireInView = serializedObject.FindProperty("_requireInView");
_includeChildren = serializedObject.FindProperty("_includeChildren");
_ignoreSelf = serializedObject.FindProperty("_ignoreSelf");
_includeInactive = serializedObject.FindProperty("_includeInactive");
_localizeShake = serializedObject.FindProperty("_localizeShake");
_randomizeDirections = serializedObject.FindProperty("_randomizeDirections");
}
public override void OnInspectorGUI()
{
serializedObject.Update();
EditorGUI.BeginDisabledGroup(true);
_script = EditorGUILayout.ObjectField("Script:", _script, typeof(MonoScript), false) as MonoScript;
EditorGUI.EndDisabledGroup();
//Only allow changing when not in play mode. This will be done for all scripts once their editors are made.
EditorGUI.BeginDisabledGroup(Application.isPlaying);
EditorGUILayout.PropertyField(_shakerType, new GUIContent("Shaker Type", "Shaker type to use. CameraShaker will subscribe to your current or otherwise configured CameraShaker. ObjectShaker will subscribe to the first ObjectShaker found on or in parented objects."));
EditorGUI.EndDisabledGroup();
EditorGUILayout.Space();
EditorGUILayout.PropertyField(_positionalMultiplier, new GUIContent("Positional Multiplier", "Positional shakes are multiplied by this value. Lower values will result in a lower positional magnitude."));
EditorGUILayout.PropertyField(_rotationalMultiplier, new GUIContent("Rotational Multiplier", "Rotational shakes are multiplied by this value. Lower values will result in a lower rotational magnitude."));
EditorGUILayout.Space();
EditorGUILayout.PropertyField(_requireInView, new GUIContent("Require In View", "Only shake when in view of a camera."));
EditorGUILayout.PropertyField(_includeChildren, new GUIContent("Include Children", "True to find transforms in children too. This allows you to use one ShakableTransform on the parent if all children transforms should shake as well."));
if (_includeChildren.boolValue == true)
{
EditorGUI.indentLevel++;
EditorGUILayout.PropertyField(_ignoreSelf, new GUIContent("Ignore Self", "True to ignore the transform this component resides, and only shake children."));
EditorGUILayout.PropertyField(_includeInactive, new GUIContent("Include Inactive", "True to also find inactive children."));
EditorGUI.indentLevel--;
}
//EditorGUILayout.Space();
EditorGUILayout.PropertyField(_localizeShake, new GUIContent("Localize Shake", "True to convert forces to local space before applying."));
EditorGUILayout.PropertyField(_randomizeDirections, new GUIContent("Randomize Directions", "True to randomly change influence direction when shaking starts."));
serializedObject.ApplyModifiedProperties();
}
}
}
#endif

View File

@@ -0,0 +1,18 @@
fileFormatVersion: 2
guid: b54ff1928c90bd44f94ab377385a3ddc
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
AssetOrigin:
serializedVersion: 1
productId: 162991
packageName: Smooth Camera Shaker
packageVersion: 2.12
assetPath: Assets/FirstGearGames/SmoothCameraShaker/Scripts/Editor/ShakableTransform2DEditor.cs
uploadId: 376379

View File

@@ -0,0 +1,73 @@
#if UNITY_EDITOR
using UnityEditor;
using UnityEngine;
namespace FirstGearGames.SmoothCameraShaker.EditorDesign
{
[CustomEditor(typeof(ShakableTransform))]
public class ShakableTransformEditor : UnityEditor.Editor
{
private MonoScript _script;
private SerializedProperty _shakerType;
private SerializedProperty _positionalMultiplier;
private SerializedProperty _rotationalMultiplier;
private SerializedProperty _requireInView;
private SerializedProperty _includeChildren;
private SerializedProperty _ignoreSelf;
private SerializedProperty _includeInactive;
private SerializedProperty _localizeShake;
private SerializedProperty _randomizeDirections;
private void OnEnable()
{
_script = MonoScript.FromMonoBehaviour((ShakableTransform)target);
//ShakableBase.
_shakerType = serializedObject.FindProperty("_shakerType");
//ShakableTransform
_positionalMultiplier = serializedObject.FindProperty("_positionalMultiplier");
_rotationalMultiplier = serializedObject.FindProperty("_rotationalMultiplier");
_requireInView = serializedObject.FindProperty("_requireInView");
_includeChildren = serializedObject.FindProperty("_includeChildren");
_ignoreSelf = serializedObject.FindProperty("_ignoreSelf");
_includeInactive = serializedObject.FindProperty("_includeInactive");
_localizeShake = serializedObject.FindProperty("_localizeShake");
_randomizeDirections = serializedObject.FindProperty("_randomizeDirections");
}
public override void OnInspectorGUI()
{
serializedObject.Update();
EditorGUI.BeginDisabledGroup(true);
_script = EditorGUILayout.ObjectField("Script:", _script, typeof(MonoScript), false) as MonoScript;
EditorGUI.EndDisabledGroup();
//Only allow changing when not in play mode. This will be done for all scripts once their editors are made.
EditorGUI.BeginDisabledGroup(Application.isPlaying);
EditorGUILayout.PropertyField(_shakerType, new GUIContent("Shaker Type", "Shaker type to use. CameraShaker will subscribe to your current or otherwise configured CameraShaker. ObjectShaker will subscribe to the first ObjectShaker found on or in parented objects."));
EditorGUI.EndDisabledGroup();
EditorGUILayout.Space();
EditorGUILayout.PropertyField(_positionalMultiplier, new GUIContent("Positional Multiplier", "Positional shakes are multiplied by this value. Lower values will result in a lower positional magnitude."));
EditorGUILayout.PropertyField(_rotationalMultiplier, new GUIContent("Rotational Multiplier", "Rotational shakes are multiplied by this value. Lower values will result in a lower rotational magnitude."));
EditorGUILayout.Space();
EditorGUILayout.PropertyField(_requireInView, new GUIContent("Require In View", "Only shake when in view of a camera."));
EditorGUILayout.PropertyField(_includeChildren, new GUIContent("Include Children", "True to find transforms in children too. This allows you to use one ShakableTransform on the parent if all children transforms should shake as well."));
if (_includeChildren.boolValue == true)
{
EditorGUI.indentLevel++;
EditorGUILayout.PropertyField(_ignoreSelf, new GUIContent("Ignore Self", "True to ignore the transform this component resides, and only shake children."));
EditorGUILayout.PropertyField(_includeInactive, new GUIContent("Include Inactive", "True to also find inactive children."));
EditorGUI.indentLevel--;
}
//EditorGUILayout.Space();
EditorGUILayout.PropertyField(_localizeShake, new GUIContent("Localize Shake", "True to convert influences to local space before applying."));
EditorGUILayout.PropertyField(_randomizeDirections, new GUIContent("Randomize Directions", "True to randomly change influence direction when shaking starts."));
serializedObject.ApplyModifiedProperties();
}
}
}
#endif

View File

@@ -0,0 +1,18 @@
fileFormatVersion: 2
guid: 091096d784b4dc744819aa6ce788716b
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
AssetOrigin:
serializedVersion: 1
productId: 162991
packageName: Smooth Camera Shaker
packageVersion: 2.12
assetPath: Assets/FirstGearGames/SmoothCameraShaker/Scripts/Editor/ShakableTransformEditor.cs
uploadId: 376379

View File

@@ -0,0 +1,142 @@
#if UNITY_EDITOR
using UnityEditor;
using UnityEngine;
namespace FirstGearGames.SmoothCameraShaker.EditorDesign
{
[CustomEditor(typeof(ShakeData))]
public class ShakeDataEditor : UnityEditor.Editor
{
private MonoScript _script;
private SerializedProperty _scaledTime;
private SerializedProperty _shakeCameras;
private SerializedProperty _shakeCanvases;
private SerializedProperty _shakeObjects;
private SerializedProperty _magnitude;
private SerializedProperty _magnitudeNoise;
private SerializedProperty _magnitudeCurve;
private SerializedProperty _roughness;
private SerializedProperty _roughnessNoise;
private SerializedProperty _roughnessCurve;
private SerializedProperty _totalDuration;
private SerializedProperty _unlimitedDuration;
private SerializedProperty _fadeInDuration;
private SerializedProperty _fadeOutDuration;
private SerializedProperty _positionalInfluence;
private SerializedProperty _positionalInverts;
private SerializedProperty _rotationalInfluence;
private SerializedProperty _rotationalInverts;
private SerializedProperty _randomSeed;
private void OnEnable()
{
_script = MonoScript.FromScriptableObject((ShakeData)target);
//Shakables.
_shakeCameras = serializedObject.FindProperty("_shakeCameras");
_shakeCanvases = serializedObject.FindProperty("_shakeCanvases");
_shakeObjects = serializedObject.FindProperty("_shakeObjects");
//Timing.
_scaledTime = serializedObject.FindProperty("_scaledTime");
_unlimitedDuration = serializedObject.FindProperty("_unlimitedDuration");
_totalDuration = serializedObject.FindProperty("_totalDuration");
_fadeInDuration = serializedObject.FindProperty("_fadeInDuration");
_fadeOutDuration = serializedObject.FindProperty("_fadeOutDuration");
//Force.
_magnitude = serializedObject.FindProperty("_magnitude");
_magnitudeNoise = serializedObject.FindProperty("_magnitudeNoise");
_magnitudeCurve = serializedObject.FindProperty("_magnitudeCurve");
_roughness = serializedObject.FindProperty("_roughness");
_roughnessNoise = serializedObject.FindProperty("_roughnessNoise");
_roughnessCurve = serializedObject.FindProperty("_roughnessCurve");
//Influence.
_positionalInfluence = serializedObject.FindProperty("_positionalInfluence");
_positionalInverts = serializedObject.FindProperty("_positionalInverts");
_rotationalInfluence = serializedObject.FindProperty("_rotationalInfluence");
_rotationalInverts = serializedObject.FindProperty("_rotationalInverts");
//Seed.
_randomSeed = serializedObject.FindProperty("_randomSeed");
}
public override void OnInspectorGUI()
{
ShakeData data = (ShakeData)target;
serializedObject.Update();
EditorGUI.BeginChangeCheck();
EditorGUI.BeginDisabledGroup(true);
_script = EditorGUILayout.ObjectField("Script:", _script, typeof(MonoScript), false) as MonoScript;
EditorGUI.EndDisabledGroup();
//Scaled time and unlimited duraiton.
EditorGUILayout.PropertyField(_scaledTime, new GUIContent("Scaled Time", "True to use scaled time, false to use unscaled."));
EditorGUILayout.Space();
//Affected shakables.
EditorGUILayout.LabelField("Shakables To Affect");
EditorGUI.indentLevel++;
EditorGUILayout.PropertyField(_shakeCameras, new GUIContent("Cameras", "True to shake cameras."));
EditorGUILayout.PropertyField(_shakeCanvases, new GUIContent("Canvases", "True to shake canvases. Canvases must have a ShakableCanvas component attached."));
EditorGUILayout.PropertyField(_shakeObjects, new GUIContent("Objects", "True to shake objects such as rigidbodies. Rigidbodies must have a ShakableRigidbody or ShakableRigidbody2D component attached."));
EditorGUI.indentLevel--;
EditorGUILayout.Space();
EditorGUILayout.PropertyField(_unlimitedDuration, new GUIContent("Unlimited Duration", "True to shake until stopped."));
//Total duration.
if (_unlimitedDuration.boolValue == false)
{
EditorGUI.indentLevel++;
EditorGUILayout.PropertyField(_totalDuration, new GUIContent("Total Duration", "How long the shake will last. If duration is less than fade out and fade in time combined then duration is adjusted to the total of those values."));
EditorGUI.indentLevel--;
}
//Fade in/out.
EditorGUILayout.PropertyField(_fadeInDuration, new GUIContent("Fade In Duration", "How long after the start of the shake until it reaches full magnitude. Used to ease into shakes. Works independently from curves. This value is not in addition to TotalDuration."));
EditorGUILayout.PropertyField(_fadeOutDuration, new GUIContent("Fade Out Duration", "How long at the end of the shake to ease out of shake. Works independently from curves. This value is not in addition to TotalDuration."));
EditorGUILayout.Space();
//Magnitude
EditorGUILayout.PropertyField(_magnitude, new GUIContent("Magnitude", "A multiplier to apply towards configured settings."));
EditorGUI.indentLevel++;
EditorGUILayout.PropertyField(_magnitudeNoise, new GUIContent("Magnitude Noise", "Larger noise values will result in more drastic ever-changing magnitude levels during the shake."));
EditorGUILayout.PropertyField(_magnitudeCurve, new GUIContent("Magnitude Curve", "Percentage curve applied to magnitude over the shake duration."));
EditorGUI.indentLevel--;
EditorGUILayout.Space();
//Roughness.
EditorGUILayout.PropertyField(_roughness, new GUIContent("Roughness", "How quickly to transition between shake offsets. Higher values will result in more violent shakes."));
EditorGUI.indentLevel++;
EditorGUILayout.PropertyField(_roughnessNoise, new GUIContent("Roughness Noise", "Larger noise values will result in more drastic ever-changing roughness levels during the shake."));
EditorGUILayout.PropertyField(_roughnessCurve, new GUIContent("Roughness Curve", "Percentage curve applied to roughness over the shake duration."));
EditorGUI.indentLevel--;
EditorGUILayout.Space();
//Influence.
EditorGUILayout.PropertyField(_positionalInfluence, new GUIContent("Positional Influence", "Values in either sign which the shake positioning will occur."));
EditorGUI.indentLevel++;
EditorGUILayout.PropertyField(_positionalInverts, new GUIContent("Invertible Axes", "Positional axes which may be randomly inverted when this ShakeData is instanced."));
EditorGUI.indentLevel--;
EditorGUILayout.PropertyField(_rotationalInfluence, new GUIContent("Rotational Influence", "Values in either sign which the shake rotation will occur."));
EditorGUI.indentLevel++;
EditorGUILayout.PropertyField(_rotationalInverts, new GUIContent("Invertible Axes", "Rotational axes which may be randomly inverted when this ShakeData is instanced."));
EditorGUI.indentLevel--;
EditorGUILayout.Space();
//RandomSeed.
EditorGUILayout.PropertyField(_randomSeed, new GUIContent("Random Seed", "While checked a new starting position and direction is used with every shake; shakes are more randomized. If unchecked shakes are guaranteed to start at the same position, and move the same direction with every shake; configured curves and noise are still applied."));
if (EditorGUI.EndChangeCheck())
{
data.PositionalInverts = (InvertibleAxes)_positionalInverts.intValue;
data.RotationalInverts = (InvertibleAxes)_rotationalInverts.intValue;
}
serializedObject.ApplyModifiedProperties();
}
}
}
#endif

View File

@@ -0,0 +1,18 @@
fileFormatVersion: 2
guid: b04fbf2ddfef6e4499d88a46aa9e29f7
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
AssetOrigin:
serializedVersion: 1
productId: 162991
packageName: Smooth Camera Shaker
packageVersion: 2.12
assetPath: Assets/FirstGearGames/SmoothCameraShaker/Scripts/Editor/ShakeDataEditor.cs
uploadId: 376379