December 2013
Beginner
320 pages
8h 22m
English
Let's get started with a single script to control our background music.
FadeIn.public float maxVolume = 1f; public float fadeLength = 1f; private float fadeStartTime = -1f;
Awake function. It begins by looking at the audio variable, which is automatically supplied by Unity, to check for an attached Audio Source component. If one cannot be found, the gameObject is destroyed and the function is exited.public void Awake() { if(audio ...Read now
Unlock full access