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
| // https://discussions.unity.com/t/debug-draw-sphere-script/1550055 | |
| using System.Collections; | |
| using UnityEngine; | |
| public static class DebugUtilities | |
| { | |
| /// <summary> | |
| /// Draw primitive forms like capsule, cubes ecc... for a N time in a location. | |
| /// (similar to Debug.DrawRay) | |
| /// </summary> |
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; | |
| #if UNITY_EDITOR_WIN || UNITY_WEBGL | |
| using System.Runtime.InteropServices; | |
| #endif | |
| using UnityEngine; | |
| public static class CursorLock |
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
| #!/bin/bash | |
| # Function to display usage information | |
| usage() { | |
| echo "Usage: $0 /path/to/input.mp4 [ /path/to/output_directory ]" | |
| exit 1 | |
| } | |
| # Check if at least one argument (input file) is provided | |
| if [ $# -lt 1 ]; then |
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
| // https://web.archive.org/web/20150428033712/http://lexiconhub.tk/index/game-programming/projectile-motion-unity-3d/ | |
| using UnityEngine; | |
| using System.Collections; | |
| public class enemy : MonoBehaviour | |
| { | |
| public float MinSpeed; | |
| public float MaxSpeed; | |
| public float currentSpeed; | |
| private float x, y, z; |
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
| // source https://github.com/AlCh3mi/GameJamToolKit/blob/main/GameJamToolkit/ObjectPooling/Pool.cs | |
| using System; | |
| using UnityEngine; | |
| using UnityEngine.Pool; | |
| namespace UnityLibrary.ObjectPooling | |
| { | |
| public abstract class Pool<T> : MonoBehaviour where T : MonoBehaviour | |
| { |
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
| // https://docs.unity3d.com/2018.3/Documentation/ScriptReference/UI.Image-alphaHitTestMinimumThreshold.html | |
| // attach this script to UI Image gameobject | |
| // note the image/script needs to have [x] read write enabled in import settings | |
| using UnityEngine; | |
| using UnityEngine.EventSystems; | |
| using UnityEngine.UI; | |
| public class DontHitAlpha : MonoBehaviour, IPointerClickHandler, IPointerEnterHandler, IPointerExitHandler | |
| { |
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; | |
| using System.Runtime.InteropServices; | |
| class Program | |
| { | |
| [DllImport("winmm.dll", SetLastError = true)] | |
| private static extern uint waveInGetNumDevs(); | |
| [DllImport("winmm.dll", SetLastError = true, CharSet = CharSet.Auto)] | |
| private static extern uint waveInGetDevCaps(uint deviceId, ref WAVEINCAPS waveInCaps, uint size); |
One of the biggest pains in Unity when developing for WebGL is that if you want to profile it, you have to use the "Build and Run" menu option to do it, while it works, it can be very inconvenient and waste a lot of time recompiling everything, in this brief tutorial I present a way of attaching the profiler without having to recompile everything.
Click here to see the TL;DR (Too long; Didn't Read™) step-by-step if you are not patient enough to read everything
Note: This entire procedure was only tested with Unity 2021.3.29f1. The procedure might be the same in newer versions, but in case it's not, refer below for how I discovered it for this version.
As of 2023-09-28, the Unity documentation states:
OlderNewer