Insanely huge initial commit

This commit is contained in:
2026-02-21 16:40:15 -08:00
parent 2ba1c94b88
commit ee9aee0a1b
33825 changed files with 5213498 additions and 0 deletions

View File

@@ -0,0 +1,185 @@
using UnityEditor;
using UnityEngine;
namespace Com.LuisPedroFonseca.ProCamera2D
{
[CustomEditor(typeof(ProCamera2DTriggerBoundaries))]
[CanEditMultipleObjects]
public class ProCamera2DTriggerBoundariesEditor : Editor
{
MonoScript _script;
GUIContent _tooltip;
void OnEnable()
{
var proCamera2DTriggerBoundaries = (ProCamera2DTriggerBoundaries)target;
if (proCamera2DTriggerBoundaries.NumericBoundaries == null && proCamera2DTriggerBoundaries.ProCamera2D != null)
{
var numericBoundaries = proCamera2DTriggerBoundaries.ProCamera2D.GetComponent<ProCamera2DNumericBoundaries>();
proCamera2DTriggerBoundaries.NumericBoundaries = numericBoundaries == null ? proCamera2DTriggerBoundaries.ProCamera2D.gameObject.AddComponent<ProCamera2DNumericBoundaries>() : numericBoundaries;
}
_script = MonoScript.FromMonoBehaviour(proCamera2DTriggerBoundaries);
}
public override void OnInspectorGUI()
{
var proCamera2DTriggerBoundaries = (ProCamera2DTriggerBoundaries)target;
if (proCamera2DTriggerBoundaries.ProCamera2D == null)
EditorGUILayout.HelpBox("ProCamera2D is not set.", MessageType.Error, true);
serializedObject.Update();
// Show script link
GUI.enabled = false;
_script = EditorGUILayout.ObjectField("Script", _script, typeof(MonoScript), false) as MonoScript;
GUI.enabled = true;
// ProCamera2D
_tooltip = new GUIContent("Pro Camera 2D", "");
EditorGUILayout.PropertyField(serializedObject.FindProperty("_pc2D"), _tooltip);
// Update interval
_tooltip = new GUIContent("Update Interval", "Every X seconds detect collision. Smaller frequencies are more precise but also require more processing.");
EditorGUILayout.PropertyField(serializedObject.FindProperty("UpdateInterval"), _tooltip);
if (proCamera2DTriggerBoundaries.UpdateInterval <= 0.01f)
proCamera2DTriggerBoundaries.UpdateInterval = 0.01f;
// Trigger shape
_tooltip = new GUIContent("Trigger Shape", "");
EditorGUILayout.PropertyField(serializedObject.FindProperty("TriggerShape"), _tooltip);
// Boundaries relative
_tooltip = new GUIContent("Are boundaries relative", "Are the boundaries relative to this or are they world positions?");
EditorGUILayout.PropertyField(serializedObject.FindProperty("AreBoundariesRelative"), _tooltip);
// Top boundary
EditorGUILayout.BeginHorizontal();
_tooltip = new GUIContent("Use Top Boundary", "Should the camera top position be limited?");
EditorGUILayout.PropertyField(serializedObject.FindProperty("UseTopBoundary"), _tooltip);
if(proCamera2DTriggerBoundaries.UseTopBoundary)
{
_tooltip = new GUIContent(" ", "Camera top boundary");
EditorGUILayout.PropertyField(serializedObject.FindProperty("TopBoundary"), _tooltip);
}
EditorGUILayout.EndHorizontal();
// Bottom boundary
EditorGUILayout.BeginHorizontal();
_tooltip = new GUIContent("Use Bottom Boundary", "Should the camera bottom position be limited?");
EditorGUILayout.PropertyField(serializedObject.FindProperty("UseBottomBoundary"), _tooltip);
if(proCamera2DTriggerBoundaries.UseBottomBoundary)
{
_tooltip = new GUIContent(" ", "Camera bottom boundary");
EditorGUILayout.PropertyField(serializedObject.FindProperty("BottomBoundary"), _tooltip);
}
EditorGUILayout.EndHorizontal();
// Left boundary
EditorGUILayout.BeginHorizontal();
_tooltip = new GUIContent("Use Left Boundary", "Should the camera left position be limited?");
EditorGUILayout.PropertyField(serializedObject.FindProperty("UseLeftBoundary"), _tooltip);
if(proCamera2DTriggerBoundaries.UseLeftBoundary)
{
_tooltip = new GUIContent(" ", "Camera left boundary");
EditorGUILayout.PropertyField(serializedObject.FindProperty("LeftBoundary"), _tooltip);
}
EditorGUILayout.EndHorizontal();
// Right boundary
EditorGUILayout.BeginHorizontal();
_tooltip = new GUIContent("Use Right Boundary", "Should the camera right position be limited?");
EditorGUILayout.PropertyField(serializedObject.FindProperty("UseRightBoundary"), _tooltip);
if(proCamera2DTriggerBoundaries.UseRightBoundary)
{
_tooltip = new GUIContent(" ", "Camera right boundary");
EditorGUILayout.PropertyField(serializedObject.FindProperty("RightBoundary"), _tooltip);
}
EditorGUILayout.EndHorizontal();
// Transition duration
_tooltip = new GUIContent("Transition duration", "How many X seconds should the transition take?");
EditorGUILayout.PropertyField(serializedObject.FindProperty("TransitionDuration"), _tooltip);
if (proCamera2DTriggerBoundaries.TransitionDuration <= 0)
proCamera2DTriggerBoundaries.TransitionDuration = 0;
// Transition ease type
_tooltip = new GUIContent("Transition ease type", "The transition animation ease type");
EditorGUILayout.PropertyField(serializedObject.FindProperty("TransitionEaseType"), _tooltip);
// Trigger targets
EditorGUILayout.BeginHorizontal();
_tooltip = new GUIContent("Use Targets Mid Point", "If checked, the trigger will use the mid point of all your camera targets");
EditorGUILayout.PropertyField(serializedObject.FindProperty("UseTargetsMidPoint"), _tooltip);
if (!proCamera2DTriggerBoundaries.UseTargetsMidPoint)
{
_tooltip = new GUIContent("Trigger Target", "The target to use instead of the mid point of all camera targets");
EditorGUILayout.PropertyField(serializedObject.FindProperty("TriggerTarget"), _tooltip);
}
EditorGUILayout.EndHorizontal();
// Change zoom
_tooltip = new GUIContent("Change Zoom", "Change the camera zoom in/out?");
EditorGUILayout.PropertyField(serializedObject.FindProperty("ChangeZoom"), _tooltip);
if (proCamera2DTriggerBoundaries.ChangeZoom)
{
// Target zoom
_tooltip = new GUIContent("Zoom Amount", "");
EditorGUILayout.PropertyField(serializedObject.FindProperty("TargetZoom"), _tooltip);
// Zoom smoothness
_tooltip = new GUIContent("Zoom Smoothness", "");
EditorGUILayout.PropertyField(serializedObject.FindProperty("ZoomSmoothness"), _tooltip);
}
// Set as starting boundaries
_tooltip = new GUIContent("Set as starting boundaries", "Use this boundaries as the starting ones");
EditorGUILayout.PropertyField(serializedObject.FindProperty("_setAsStartingBoundaries"), _tooltip);
if(proCamera2DTriggerBoundaries._setAsStartingBoundaries)
{
var allBoundariesTriggers = FindObjectsOfType(typeof(ProCamera2DTriggerBoundaries));
foreach (ProCamera2DTriggerBoundaries trigger in allBoundariesTriggers)
{
trigger._setAsStartingBoundaries = false;
}
proCamera2DTriggerBoundaries._setAsStartingBoundaries = true;
}
// Limit boundaries
if (proCamera2DTriggerBoundaries.LeftBoundary > proCamera2DTriggerBoundaries.RightBoundary)
proCamera2DTriggerBoundaries.LeftBoundary = proCamera2DTriggerBoundaries.RightBoundary;
if (proCamera2DTriggerBoundaries.RightBoundary < proCamera2DTriggerBoundaries.LeftBoundary)
proCamera2DTriggerBoundaries.RightBoundary = proCamera2DTriggerBoundaries.LeftBoundary;
if (proCamera2DTriggerBoundaries.BottomBoundary > proCamera2DTriggerBoundaries.TopBoundary)
proCamera2DTriggerBoundaries.BottomBoundary = proCamera2DTriggerBoundaries.TopBoundary;
if (proCamera2DTriggerBoundaries.TopBoundary < proCamera2DTriggerBoundaries.BottomBoundary)
proCamera2DTriggerBoundaries.TopBoundary = proCamera2DTriggerBoundaries.BottomBoundary;
serializedObject.ApplyModifiedProperties();
}
}
}

View File

@@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: 6788b08df8aa14da38a16f5c742c1fda
timeCreated: 1429473345
licenseType: Store
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,81 @@
using UnityEditor;
using UnityEngine;
namespace Com.LuisPedroFonseca.ProCamera2D
{
[CustomEditor(typeof(ProCamera2DTriggerInfluence))]
[CanEditMultipleObjects]
public class ProCamera2DTriggerInfluenceEditor : Editor
{
MonoScript _script;
GUIContent _tooltip;
void OnEnable()
{
_script = MonoScript.FromMonoBehaviour((ProCamera2DTriggerInfluence)target);
}
public override void OnInspectorGUI()
{
var proCamera2DTriggerInfluence = (ProCamera2DTriggerInfluence)target;
if(proCamera2DTriggerInfluence.ProCamera2D == null)
EditorGUILayout.HelpBox("ProCamera2D is not set.", MessageType.Error, true);
serializedObject.Update();
// Show script link
GUI.enabled = false;
_script = EditorGUILayout.ObjectField("Script", _script, typeof(MonoScript), false) as MonoScript;
GUI.enabled = true;
// ProCamera2D
_tooltip = new GUIContent("Pro Camera 2D", "");
EditorGUILayout.PropertyField(serializedObject.FindProperty("_pc2D"), _tooltip);
// Update interval
_tooltip = new GUIContent("Update Interval", "Every X seconds detect collision. Smaller frequencies are more precise but also require more processing.");
EditorGUILayout.PropertyField(serializedObject.FindProperty("UpdateInterval"), _tooltip);
if (proCamera2DTriggerInfluence.UpdateInterval <= 0.01f)
proCamera2DTriggerInfluence.UpdateInterval = 0.01f;
// Trigger shape
_tooltip = new GUIContent("Trigger Shape", "");
EditorGUILayout.PropertyField(serializedObject.FindProperty("TriggerShape"), _tooltip);
// Focus point
_tooltip = new GUIContent("Focus Point", "If set, the focus point will be this instead of the center of the trigger");
EditorGUILayout.PropertyField(serializedObject.FindProperty("FocusPoint"), _tooltip);
// Influence smoothness
_tooltip = new GUIContent("Influence Smoothness", "How smoothly should the camera move towards the focus point?");
EditorGUILayout.PropertyField(serializedObject.FindProperty("InfluenceSmoothness"), _tooltip);
if (proCamera2DTriggerInfluence.InfluenceSmoothness < 0f)
proCamera2DTriggerInfluence.InfluenceSmoothness = 0f;
// Exclusive influence percentage
_tooltip = new GUIContent("Exclusive Influence Percentage", "After entering this area the camera will reach it's max zoom value");
EditorGUILayout.PropertyField(serializedObject.FindProperty("ExclusiveInfluencePercentage"), _tooltip);
// Trigger targets
EditorGUILayout.BeginHorizontal();
var tooltip = new GUIContent("Use Targets Mid Point", "If checked, the trigger will use the mid point of all your camera targets");
EditorGUILayout.PropertyField(serializedObject.FindProperty("UseTargetsMidPoint"), tooltip);
if (!proCamera2DTriggerInfluence.UseTargetsMidPoint)
{
tooltip = new GUIContent("Trigger Target", "The target to use instead of the mid point of all camera targets");
EditorGUILayout.PropertyField(serializedObject.FindProperty("TriggerTarget"), tooltip);
}
EditorGUILayout.EndHorizontal();
// Mode
_tooltip = new GUIContent("Influence Mode", "Choose what axis the influence affects");
EditorGUILayout.PropertyField(serializedObject.FindProperty("Mode"), _tooltip);
serializedObject.ApplyModifiedProperties();
}
}
}

View File

@@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: 2a7f82f941621444d868baab8d8ce85e
timeCreated: 1436623618
licenseType: Store
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,76 @@
using UnityEditor;
using UnityEngine;
namespace Com.LuisPedroFonseca.ProCamera2D
{
[CustomEditor(typeof(ProCamera2DTriggerRails))]
[CanEditMultipleObjects]
public class ProCamera2DTriggerRailsEditor : Editor
{
MonoScript _script;
GUIContent _tooltip;
void OnEnable()
{
_script = MonoScript.FromMonoBehaviour((ProCamera2DTriggerRails)target);
var proCamera2DTriggerRails = (ProCamera2DTriggerRails)target;
if(proCamera2DTriggerRails.ProCamera2D != null && proCamera2DTriggerRails.ProCamera2DRails == null)
proCamera2DTriggerRails.ProCamera2DRails = proCamera2DTriggerRails.ProCamera2D.GetComponentInChildren<ProCamera2DRails>();
}
public override void OnInspectorGUI()
{
var proCamera2DTriggerRails = (ProCamera2DTriggerRails)target;
if(proCamera2DTriggerRails.ProCamera2D == null)
EditorGUILayout.HelpBox("ProCamera2D is not set.", MessageType.Error, true);
serializedObject.Update();
// Show script link
GUI.enabled = false;
_script = EditorGUILayout.ObjectField("Script", _script, typeof(MonoScript), false) as MonoScript;
GUI.enabled = true;
// ProCamera2D
_tooltip = new GUIContent("Pro Camera 2D", "");
EditorGUILayout.PropertyField(serializedObject.FindProperty("_pc2D"), _tooltip);
// Update interval
_tooltip = new GUIContent("Update Interval", "Every X seconds detect collision. Smaller frequencies are more precise but also require more processing.");
EditorGUILayout.PropertyField(serializedObject.FindProperty("UpdateInterval"), _tooltip);
if (proCamera2DTriggerRails.UpdateInterval <= 0.01f)
proCamera2DTriggerRails.UpdateInterval = 0.01f;
// Trigger shape
_tooltip = new GUIContent("Trigger Shape", "");
EditorGUILayout.PropertyField(serializedObject.FindProperty("TriggerShape"), _tooltip);
// Trigger targets
EditorGUILayout.BeginHorizontal();
_tooltip = new GUIContent("Use Targets Mid Point", "If checked, the trigger will use the mid point of all your camera targets");
EditorGUILayout.PropertyField(serializedObject.FindProperty("UseTargetsMidPoint"), _tooltip);
if (!proCamera2DTriggerRails.UseTargetsMidPoint)
{
_tooltip = new GUIContent("Trigger Target", "The target to use instead of the mid point of all camera targets");
EditorGUILayout.PropertyField(serializedObject.FindProperty("TriggerTarget"), _tooltip);
}
EditorGUILayout.EndHorizontal();
// Mode
_tooltip = new GUIContent("Mode", "Choose if you want this trigger to enable or disable the rails.");
EditorGUILayout.PropertyField(serializedObject.FindProperty("Mode"), _tooltip);
// Transition Duration
_tooltip = new GUIContent("Transition Duration", "The time it should take to transition from/to rails.");
EditorGUILayout.PropertyField(serializedObject.FindProperty("TransitionDuration"), _tooltip);
serializedObject.ApplyModifiedProperties();
}
}
}

View File

@@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: 64990ab6dd6114e4eb011e7db84fa6e7
timeCreated: 1448989170
licenseType: Store
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,103 @@
using UnityEditor;
using UnityEngine;
namespace Com.LuisPedroFonseca.ProCamera2D
{
[CustomEditor(typeof(ProCamera2DTriggerZoom))]
[CanEditMultipleObjects]
public class ProCamera2DTriggerZoomEditor : Editor
{
MonoScript _script;
GUIContent _tooltip;
void OnEnable()
{
_script = MonoScript.FromMonoBehaviour((ProCamera2DTriggerZoom)target);
}
public override void OnInspectorGUI()
{
var proCamera2DTriggerZoom = (ProCamera2DTriggerZoom)target;
if(proCamera2DTriggerZoom.ProCamera2D == null)
EditorGUILayout.HelpBox("ProCamera2D is not set.", MessageType.Error, true);
serializedObject.Update();
// Show script link
GUI.enabled = false;
_script = EditorGUILayout.ObjectField("Script", _script, typeof(MonoScript), false) as MonoScript;
GUI.enabled = true;
// ProCamera2D
_tooltip = new GUIContent("Pro Camera 2D", "");
EditorGUILayout.PropertyField(serializedObject.FindProperty("_pc2D"), _tooltip);
// Update interval
_tooltip = new GUIContent("Update Interval", "Every X seconds detect collision. Smaller frequencies are more precise but also require more processing.");
EditorGUILayout.PropertyField(serializedObject.FindProperty("UpdateInterval"), _tooltip);
if (proCamera2DTriggerZoom.UpdateInterval <= 0.01f)
proCamera2DTriggerZoom.UpdateInterval = 0.01f;
// Trigger shape
_tooltip = new GUIContent("Trigger Shape", "");
EditorGUILayout.PropertyField(serializedObject.FindProperty("TriggerShape"), _tooltip);
// Set size as multiplier
_tooltip = new GUIContent("Set Size As Multiplier", "If checked, you set target size of the camera as a zoom multiplier of the initial camera size");
EditorGUILayout.PropertyField(serializedObject.FindProperty("SetSizeAsMultiplier"), _tooltip);
// Target zoom
if(proCamera2DTriggerZoom.SetSizeAsMultiplier)
_tooltip = new GUIContent("Zoom Multiplier", "The amount of zoom the camera should do when entering this trigger");
else if(proCamera2DTriggerZoom.ProCamera2D.GameCamera.orthographic)
_tooltip = new GUIContent("Target Ortho Size", "The target size of the camera when entering this trigger");
else
_tooltip = new GUIContent("Target FOV Size", "The target size of the camera when entering this trigger");
EditorGUILayout.PropertyField(serializedObject.FindProperty("TargetZoom"), _tooltip);
if (proCamera2DTriggerZoom.TargetZoom <= 0.01f)
proCamera2DTriggerZoom.TargetZoom = 0.01f;
// Zoom smoothness
_tooltip = new GUIContent("Zoom Smoothness", "How smooth should the zoom be?");
EditorGUILayout.PropertyField(serializedObject.FindProperty("ZoomSmoothness"), _tooltip);
if (proCamera2DTriggerZoom.ZoomSmoothness < 0f)
proCamera2DTriggerZoom.ZoomSmoothness = 0f;
// Exclusive influence percentage
_tooltip = new GUIContent("Exclusive Influence Percentage", "After entering this area the camera will reach it's max zoom value");
EditorGUILayout.PropertyField(serializedObject.FindProperty("ExclusiveInfluencePercentage"), _tooltip);
// Reset size on exit
EditorGUILayout.BeginHorizontal();
_tooltip = new GUIContent("Reset Size On Leave", "As the target leaves the trigger area the camera will reset its size to the start value");
EditorGUILayout.PropertyField(serializedObject.FindProperty("ResetSizeOnExit"), _tooltip);
if (proCamera2DTriggerZoom.ResetSizeOnExit)
{
// Reset size smoothness
_tooltip = new GUIContent("Smoothness", "How smoothly should the camera resit its size?");
EditorGUILayout.PropertyField(serializedObject.FindProperty("ResetSizeSmoothness"), _tooltip);
}
EditorGUILayout.EndHorizontal();
// Trigger targets
EditorGUILayout.BeginHorizontal();
_tooltip = new GUIContent("Use Targets Mid Point", "If checked, the trigger will use the mid point of all your camera targets");
EditorGUILayout.PropertyField(serializedObject.FindProperty("UseTargetsMidPoint"), _tooltip);
if (!proCamera2DTriggerZoom.UseTargetsMidPoint)
{
_tooltip = new GUIContent("Trigger Target", "The target to use instead of the mid point of all camera targets");
EditorGUILayout.PropertyField(serializedObject.FindProperty("TriggerTarget"), _tooltip);
}
EditorGUILayout.EndHorizontal();
serializedObject.ApplyModifiedProperties();
}
}
}

View File

@@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: c8db0f2a5b4c4434686eb71f1ee594a1
timeCreated: 1436610957
licenseType: Store
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant: