Browsing articles in "scripts"
Jan
22
2017

Load AssetBundles with Caching

Small sample script to load assetbundles. Features: – It first loads bundle hash from the manifest file on server – Then uses that hash string as asset bundle loader parameter (to use cached version if available, see docs) – Instantiate gameobject after loading source: https://github.com/UnityCommunity/UnityLibrary/blob/master/Scripts/AssetBundles/AssetBundleLoader.cs […]

Sep
17
2016

Easy Threading with ThreadPool

Want to use simple threading? ThreadPool seems like an easy solution. Source: (c#) https://github.com/UnityCommunity/UnityLibrary/blob/master/Scripts/Threading/ThreadPoolTest.cs

Mar
27
2016

Shmup Bullet Pattern Editor

Started converting this old bullet pattern script by dhendrix from unityscript to c# and using 2D features.. *still work-in-progress* You can access the sources below (and post issues, or help translating/optimizing the scripts) Sources: https://github.com/unitycoder/BulletPatternEditorUnity

Mar
1
2016

Latitude Longitude Position On 3D Sphere (V2)

This is just a c# conversion and few updated notes for the old post : http://unitycoder.com/blog/2011/08/09/latitude-longitude-on-3d-sphere/ Instructions – Attach the script below to your sphere (Unity sphere UV mapping is not suitable so I downloaded this sphere model and scaled transform to 5) – Add […]

Dec
24
2015

Open & Play MIDI Files with winmm.dll in Unity

Yay – Playing Midi files in unity! Notes: – Works on PC only – If you make a build, midi files wont be included automatically (unless they are in StreamingAssets folder, havent tested it though..) References: – Midi code from http://www.codeguru.com/columns/dotnet/making-music-with-midi-and-c.html – MidiOutCaps c# struct […]

Dec
23
2015

Play Midi Sounds with midi-dot-net dll

Instructions: – Download midi-dot-net from https://code.google.com/p/midi-dot-net/ (from downloads section, midi-dot-net_1.1.0.zip) – Unzip and copy “Midi.dll” into your unity project folder, Assets/Plugins/ – Create c# script and use the source below for testing – Attach the script to gameobject in scene and hit play, should hear […]

Dec
17
2015

Get Angle Between 2 GameObjects in Degrees (0-360)

Small helper script to check angle between 2 objects in degrees (and in between 0-360). It also includes test code for atan2Approximation, have not measured if there are any benefits using it.. Also note [ExecuteInEditMode], so it runs in editor without playmode.

Dec
3
2015

UI Text TypeWriter Effect [Script]

Quick & simple UI text typewriter effect (displays UI text 1 character at a time) Assign to UI text component, it grabs the text from it at Awake() and clears it, then starts to type out the text 1 character at a time.

@unitycoder_com

Subscribe to Blog via Email

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