Browsing articles in "scripts"
Dec
28
2021

Keep executable window always on top

While testing multiple client builds for multiplayer, its nice to have those client build windows to stay on top, so that can see them while using unity editor. Scripts source:https://github.com/UnityCommunity/UnityLibrary/blob/master/Assets/Scripts/Helpers/Windows/WindowAlwaysOnTop.cs *Was testing it here,https://www.youtube.com/watch?v=lINrN0j3wrc

Aug
27
2021

Boat Attack URP Water: Add Underwater surface flip

Just modify 2 lines from the scripts and you get visible waterplane when going below surface. The idea is to check camera Y position, if below 0, flip normal and flip matrix for mesh. Boat Attack Project:https://github.com/Unity-Technologies/BoatAttack Inside Water.cs & PlanarReflections.cs replace these 2 lines:

Nov
14
2020

Marching Squares

Unity version of the basic Marching Squares tutorial from The Coding Train https://www.youtube.com/watch?v=0ZONMNUKTfU Project: *Note: Enable Gizmos to see debug lines in Game Windowhttps://github.com/unitycoder/MarchingSquares recording from live streamhttps://www.youtube.com/watch?v=vR2fc7U9hME

Jul
7
2020

Find out which script Disabled or Enabled this GameObject?

Small script to help tracking who disabled or enabled gameobject,https://github.com/UnityCommunity/UnityLibrary/blob/master/Assets/Scripts/Helpers/Debug/WhoDisabledOrEnabled.cs Usage:– Add script to the gameobject you need to track– press play– see console for the error messages, select the error message row, and see stack trace for the calling script names and lines.

Feb
15
2020

Encode/Decode Audio To/From PNG Alpha Channel

Small test on embedding Audio data into PNG alpha channel.With added option to shuffle pixels to hide/”encrypt” original image and sound. To make sound file small enough, use this option to set low hz. Ideas for later:– Compress audio (tested RLE but didn’t do much […]

Dec
9
2019

Using raylib.dll in Unity

raylib is https://github.com/raysan5/raylibThere are c# bindings available at https://github.com/ChrisDill/Raylib-cs Steps:– Download raylib.dll from releases (i took raylib-2.5.0-Win64-msvc15.zip)– Unzip and copy \raylib-2.5.0-Win64-msvc15\bin\raylib.dll into your Unity project Plugins/ folder– Download c# bindings repository (click “clone or download” .. as zip)– Unzip and copy \Raylib-cs-master\Bindings\ folder into your […]

Jun
19
2019

Continue Coroutine after gameObject was disabled

So, customer wanted final changes few hours before deadline, to add hide/show feature (just regular disable-enable gameobject) for some animated UI elements. (Effects were using coroutine to set values and colors). To my horror, after you disable and then enable gameobject, the coroutine is dead! […]

Jun
10
2019

EditorScript: HDR Outline for WorldSpace UI Panel using LineRenderer

Needed hdr outline for ui panel, so here’s small editor helper script to assign linerenderer points around UI panel:https://github.com/UnityCommunity/UnityLibrary/blob/master/Assets/Scripts/Editor/ContextMenu/CreateOutlineForPanelEditor.cs *Note: i’m using UI always on top shader for the panel (it fixes the linerenderer z-fight issue, but also needed it for this project to display […]

Jun
8
2019

Set Quad Scale to Match VideoPlayer Aspect Ratio

Needed quick videoplayer quad mesh resizer, to match video size, so here’s a small editor helper script:https://github.com/UnityCommunity/UnityLibrary/blob/master/Assets/Scripts/Editor/ContextMenu/GetVideoAspectRatioEditor.cs It checks video width and height, and then scales transform Y axis to match aspect ratio.

May
26
2019

ffmpeg stream raw video into Unity Texture2D

Small proof-of-concept idea about streaming raw video from commandline ffmpeg into Unity, using UDP streaming. It works ok for small resolution and low fps rate, but breaks/goes out of sync if any udp data goes missing. Sources:https://github.com/unitycoder/ffmpegStreamToUnity Instructions:– Download ffmpeg https://ffmpeg.org/download.html– run from commandline: > […]

Pages:1234»

Connect

Twitter View LinkedIn profile Youtube Youtube Join Discord Twitch

UnityLauncherPro

Get UnityLauncherPRO and work faster with Unity Projects!
*free unity hub alternative

@unitycoder_com

Subscribe to Blog via Email

Enter your email address to subscribe to this blog and receive notifications of new posts by email.