IMHOTEP Framework
 All Classes Namespaces Functions Variables Enumerations Enumerator Properties Pages
SceneAnimation.cs
1 using UnityEngine;
2 using System.Collections;
3 
4 public class SceneAnimation : MonoBehaviour {
5 
6  public static SceneAnimation instance;
7 
8  public GameObject sphereEmitters;
9  public GameObject sphere;
10  public GameObject logo;
11  public GameObject PatientSelector;
12 
13  public SceneAnimation()
14  {
15  if (instance != null) {
16  throw(new System.Exception ("Error: Cannot create more than one instance of SceneAnimation!"));
17  }
18  instance = this;
19  }
20 
21  // Use this for initialization
22  void OnEnable () {
23 
24  // If we're skipping the startup animations...
25  if (Config.instance.skipAnimations) {
26 
27  // Activate all the objects:
28  sphere.SetActive (true);
29  logo.SetActive (false);
30  PatientSelector.SetActive (true);
31  sphereEmitters.SetActive (true);
32 
33  // Start the animations of the objects, and set their normalized time to 1 (the end)
34  sphereEmitters.GetComponent<Animator> ().Play ("EnableSphereEmitters", -1, 1f);
35  sphere.GetComponent<Animator> ().Play ("EnableSphere", -1, 1f);
36  logo.GetComponent<Animator> ().Play ("LogoActivate", -1, 1f);
37 
38  } else {
39  sphere.SetActive (false);
40  logo.SetActive (false);
41  PatientSelector.SetActive (false);
42  }
43 
44  }
45 }
Definition: Config.cs:4