Exemple #1
0
 // Use this for initialization
 void OnLevelWasLoaded()
 {
     transitionprogress = audio.timeSamples;
     currenttracklength = audio.clip.length;
     liscript           = GameObject.Find("EventSystem").GetComponent <LevelInformationScript> ();
     if (liscript.levelmusic != null)
     {
         if (liscript.levelmusic != audio.clip)            //switch tracks
         {
             audio.Stop();
             difference        = liscript.levelmusic.length / currenttracklength * transitionprogress;
             changeto          = (int)difference;
             audio.clip        = liscript.levelmusic;
             audio.timeSamples = changeto;
             audio.Play();
             //Debug.Log (audio.clip.length);
         }
     }
     else if (audio.clip != defaultclip)        //Switch to Polka Waltz
     {
         audio.Stop();
         difference        = defaultclip.length / currenttracklength * transitionprogress;
         changeto          = (int)difference;
         audio.clip        = defaultclip;
         audio.timeSamples = changeto;
         audio.Play();
         //Debug.Log (audio.clip.length);
     }
 }
Exemple #2
0
 void Awake()
 {
     theball      = GameObject.Find("Plastic Ball");
     thegerbil    = GameObject.Find("Gerbil");
     ballscript   = theball.GetComponent <PlayerForce> ();
     liscript     = GameObject.Find("EventSystem").GetComponent <LevelInformationScript> ();
     gerbilcenter = new Vector3(-0.27f, 0f, 3f);
 }
Exemple #3
0
 // Use this for initialization
 void Awake()
 {
     base.Awake();
     camobj = GameObject.FindGameObjectWithTag("MainCamera");
     camcam = camobj.GetComponent <Camera> ();
     script = GameObject.Find("EventSystem").GetComponent <LevelInformationScript> ();
     //zoomto = script.fullzoom;
     zoomlocation = camobj.transform.position;
     startpanel   = GameObject.Find("Scene Start Panel");
 }
Exemple #4
0
 void Awake()
 {
     source = GameObject.Find("EventSystem").GetComponent <LevelInformationScript> ();
     title.GetComponent <Text>().text       = source.title;
     instruction.GetComponent <Text>().text = source.instructions;
     if (source.scoreistimed == false)
     {
         highscore.GetComponent <Text> ().text = "High Score\n" + PlayerPrefs.GetFloat("highscore" + Application.loadedLevelName);
     }
     else
     {
         highscore.GetComponent <Text> ().text = "Best Time\n" + PlayerPrefs.GetFloat("highscore" + Application.loadedLevelName);
     }
 }
Exemple #5
0
 // Use this for initialization
 public override void Awake()
 {
     base.Awake();
     script = GameObject.Find("EventSystem").GetComponent <LevelInformationScript> ();
 }
Exemple #6
0
 // Use this for initialization
 void Start()
 {
     destination = point1;
     script      = GameObject.Find("EventSystem").GetComponent <LevelInformationScript> ();
 }
Exemple #7
0
 void Awake()
 {
     script   = GameObject.Find("EventSystem").GetComponent <LevelInformationScript> ();
     pfscript = GameObject.Find("Plastic Ball").GetComponent <PlayerForce> ();
     dtext    = GameObject.Find("DeathText");
 }
Exemple #8
0
 // Use this for initialization
 void Start()
 {
     gcscript = GameObject.Find("EventSystem").GetComponent <LevelInformationScript> ();
 }
Exemple #9
0
 void Awake()
 {
     script = GameObject.Find("EventSystem").GetComponent <LevelInformationScript> ();
 }
Exemple #10
0
 void Awake()
 {
     rainbow = targetobj.GetComponent <TrailRenderer> ();
     script  = GameObject.Find("EventSystem").GetComponent <LevelInformationScript> ();
 }
Exemple #11
0
 // Use this for initialization
 void Awake()
 {
     infoscript  = GameObject.Find("EventSystem").GetComponent <LevelInformationScript> ();
     leftscript  = leftpit.GetComponent <ItemDetectScript> ();
     rightscript = rightpit.GetComponent <ItemDetectScript> ();
 }
Exemple #12
0
 // Use this for initialization
 void Awake()
 {
     camobj = GameObject.FindGameObjectWithTag("MainCamera");
     camcam = camobj.GetComponent <CamControl> ();
     script = GameObject.Find("EventSystem").GetComponent <LevelInformationScript> ();
 }