Public Variable vs Public Property

Remember to always use a public property over a public variable. Public variables such as below are potentially dangerous; //bad practice public float myFloat = 0.1f; Instead use; //public variable – the best solution public float myFloat { get; set; } Why use a...

Player Input

public class ButtonInput : MonoBehaviour { void Update () {  bool down = Input.GetKeyDown(KeyCode.Space);         bool held = Input.GetKey(KeyCode.Space);         bool up = Input.GetKeyUp(KeyCode.Space); if(down) { } else if(held) { } else if(up) { } else { } } }...

Lerp Lerp Lerp

Linear interpolation known as Lerp. Why it’s called Lerp I do not know! Is it L for “Linear” with an erp for ‘ERPolation? Who knows. Take three inputs. A start value, and end value, and a percentage value between the start and the end. // In...

Splat Prototypes is Obsolete

So it looks as though after learning all about SplatPrototype’s in Unity it turns out that the SplatPrototype is now depreciated!       The (old) method I (just) learned using Unity 2018 goes something like: SplatPrototype[] newSplatPrototypes;...