This file contains hidden or 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
| // This is a proof of concept for using GetRect/Simp in a resizable window that is updating while resizing and moving the window on Windows. | |
| // The goal is to make it easy to create a smooth resizable window with a decent timing for rendering. | |
| // The gist of it is that we render on WM_PAINT but force Windows to send WM_PAINT when we want from a separate thread | |
| // so we render even when moving or resizing the window. | |
| // Internet suggested to use SetTimer to make Windows send a timely message for you to render the application. while this works, | |
| // the granularity of SetTimer is at lowest 1ms. And Windows doesn't like applications that stall the message pump if we wanted to spin in place. | |
| // So instead we use a thread that does the timing. When we want to render a frame we tell Windows to send us a | |
| // WM_PAINT message. | |
| // | |
| // -Christoffer Enedahl, 30 march 2026 |
This file contains hidden or 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
| -- Makes a grid layer | |
| if app.activeSprite == nil then | |
| app.alert "There is no document open" | |
| else | |
| local settings = { | |
| xSize = 16, | |
| ySize = 16, | |
| nthLine = 10, | |
| opacity = 255, |
This file contains hidden or 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
| using UnityEngine; | |
| using System.Collections; | |
| public class SpringVector2 | |
| { | |
| public Vector2 target; | |
| public Vector2 current; | |
| public Vector2 velocity; | |
| public float spring = 100f; |
This file contains hidden or 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
| #if UNITY_EDITOR | |
| using UnityEditor; | |
| using UnityEngine; | |
| using System.Collections.Generic; | |
| using UnityEditor.SceneManagement; | |
| public class SceneLauncherLite : EditorWindow | |
| { | |
| private List<SceneData> scenes = new List<SceneData> (); | |
| string fallbackScenePath; |
This file contains hidden or 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
| public static class WindowsHelper | |
| { | |
| /// <summary> | |
| /// Selects the file in explorer. If it does not exist select the first parent directory that exists | |
| /// </summary> | |
| /// <param name="possibleFile">Possible file.</param> | |
| [System.Diagnostics.Conditional ("UNITY_EDITOR_WIN")] | |
| [System.Diagnostics.Conditional ("UNITY_STANDALONE_WIN")] | |
| public static void SelectFileInExplorer (string possibleFile) | |
| { |
This file contains hidden or 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
| using UnityEngine; | |
| using System.Collections; | |
| public static class ColliderExtensions | |
| { | |
| public static bool Overlaps (this BoxCollider box, SphereCollider sphere) | |
| { | |
| //Im sure there is a better way to do this, but it works for now. | |
| var sphereWorldCenter = sphere.transform.TransformPoint (sphere.center); |
This file contains hidden or 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
| using System.Collections; | |
| using System.Collections.Generic; | |
| using UnityEngine; | |
| using System; | |
| using UnityEngine.Audio; | |
| [ExecuteInEditMode] | |
| public class View : MonoBehaviour | |
| { | |
| public static float TransitionDuration = 0.3f; |
This file contains hidden or 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
| using UnityEngine; | |
| using System.Collections; | |
| [RequireComponent(typeof(View))] | |
| public class AnimatorViewTrigger : MonoBehaviour | |
| { | |
| public AnimationEvent[] events; | |
| View view; | |
| public bool debug; | |
| public bool OneActiveTriggerOnly; |
This file contains hidden or 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
| using UnityEngine; | |
| using System.Collections; | |
| using System.Collections.Generic; | |
| /// <summary> | |
| /// Bare bones sound handling. | |
| /// Init with AddSources(sources), supply the sources you want to be able to play. | |
| /// Depends on | |
| /// Pool: https://gist.github.com/drZool/f9a44489c5e8f815d408642d6d4c46f0 | |
| /// LerpHelper: https://gist.github.com/drZool/2938bc198ebccee0931d98798bd86cfa |
This file contains hidden or 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
| using UnityEngine; | |
| using System.Collections; | |
| using System.Collections.Generic; | |
| using System.Text; | |
| using System; | |
| public static class ListExtensions | |
| { | |
| static public string Join<T> (this IList<T> list, string separator) | |
| { |
NewerOlder