My Unity repo's git config as of today.
For more complex and complete alternatives, look at:
| // example of how to move a current value towards a target value at a constant speed | |
| // without going over the target value | |
| // formula is the same for vectors of any dimension | |
| Vector3 Seek(Vector3 currentValue, Vector3 targetValue, float maxSpeed, float dt) | |
| { | |
| // delta/difference from current value to target value | |
| Vector3 delta = targetValue - currentValue; | |
| // don't take the square root of magnitude yet | |
| // so we can potentially early out on degenerate case of currenvValue ~= targetValue |
| // NOTE DONT put in an editor folder! | |
| using UnityEngine; | |
| public class AutohookAttribute : PropertyAttribute | |
| { | |
| } |
My Unity repo's git config as of today.
For more complex and complete alternatives, look at:
| using UnityEditor; | |
| using UnityEngine; | |
| using System.Reflection; | |
| namespace Framework.Core.EditorExtension | |
| { | |
| public class OpenAdditionalLockedInpsector : MonoBehaviour | |
| { | |
| private static EditorWindow lockedInspectorWindow = null; |
| using UnityEditor; | |
| using UnityEngine; | |
| namespace Framework.Core.EditorExtension | |
| { | |
| public class OpenAdditionalAnimatorWindow : MonoBehaviour | |
| { | |
| static EditorWindow window = null; |
| using UnityEngine; | |
| using UnityEditor; | |
| using System.IO; | |
| public class GradientToPng : EditorWindow | |
| { | |
| [SerializeField] | |
| private Gradient m_Gradient; | |
| [MenuItem("Tools/Gradient To Png")] |
| %YAML 1.1 | |
| %TAG !u! tag:unity3d.com,2011: | |
| --- !u!114 &1 | |
| MonoBehaviour: | |
| m_ObjectHideFlags: 52 | |
| m_CorrespondingSourceObject: {fileID: 0} | |
| m_PrefabInternal: {fileID: 0} | |
| m_GameObject: {fileID: 0} | |
| m_Enabled: 1 | |
| m_EditorHideFlags: 1 |
| %YAML 1.1 | |
| %TAG !u! tag:unity3d.com,2011: | |
| --- !u!114 &1 | |
| MonoBehaviour: | |
| m_ObjectHideFlags: 52 | |
| m_CorrespondingSourceObject: {fileID: 0} | |
| m_PrefabInternal: {fileID: 0} | |
| m_GameObject: {fileID: 0} | |
| m_Enabled: 1 | |
| m_EditorHideFlags: 1 |
| /// For this to work you need to copy these 2 files: | |
| /// "YOUR UNITY LOCATION"\Editor\Data\Mono\lib\mono\X.X\System.Drawing.dll | |
| /// "YOUR UNITY LOCATION"\Editor\Data\Mono\lib\mono\X.X\System.Windows.Forms.dll | |
| /// ..to a "Plugins" folder within your project | |
| /// | |
| /// For this example to work, you need to have a (UI) Canvas object in your scene | |
| /// Put this script on any object | |
| /// | |
| /// Tested on windows, not sure if it works on any other platform | |
| /// |