by Yahwho | May 7, 2020 | Java
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...
by Yahwho | Apr 24, 2020 | Unity
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 { } } }...
by Yahwho | Apr 24, 2020 | C#
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...
by Yahwho | Apr 21, 2020 | Unity
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;...
by Yahwho | Apr 18, 2020 | Unity
Adding some basic water for the first time.