Monthly Archives: February 2012

Realtime Cubemap for Reflections

A nice script for creating a real time cubemap from an object position for use with a reflection shader to create realtime reflections in Unity. Converted from the JavaScript example. Note: This script requires the Unity Pro license. using UnityEngine; using System.Collections; public class RealtimeCubemap : MonoBehaviour {     public int cubemapSize = 128;    [...]

String formatting

Something small but usefull is the String.Format function, with which you can format your numerical outputs: using System; using System.Collections; … // formatted float with three zero padded digits // in front of the “.” and three digits after it. debugText += String.Format(“H{0:000.000}\n”, heading); // formatted int with formats for positive;negative;zero values debugText += String.Format(“S{0:+000;-000; [...]