I need to know how to make intros cut scenes etc with the butterfly effect during the game and a loading Screen when the game starts.
For a code-less solution inside Unity, use a cutscene editor such as uSequencer or Aperture:
http://u3d.as/content/kurt-loeffler/aperture-cutscene-editor/2F2
Or you can write a cutscene component class, something like (C#, but Javascript is similar):
public class Cutscene : MonoBehaviour {
public bool startImmediately = false;
private bool running = false;
void Start() {
if (startImmediately) StartCutscene();
}
void Update() {
if (running) UpdateCutscene();
}
public virtual void StartCutscene() {
running = true;
}
public virtual void UpdateCutcene() {
}
public virtual void StopCutscene() {
running = true;
}
}
This is an empty cutscene. You’ll need to define a subclass for each actual cutscene, something like:
// Fades a light in over time.
public class LightCutscene : Cutscene {
public Light light;
public float duration;
private float velocity = 0;
public override void StartCutscene() {
base.StartCutscene();
light.intensity = 0;
}
public override void UpdateCutscene() {
base.UpdateCutscene();
light.intensity = Mathf.SmoothDamp(light.intensity, 1, ref velocity, duration);
}
}
Then you can create a Loading scene, attach LightCutscene to the light source, set the Light, and check Start Immediately. When you run the scene, it should gradually turn on the light over 5 seconds.