void Start()
        {
            // reset static state between games
            started = false;

            // link components together
            if (recorder == null)
            {
                recorder = FindObjectOfType <RecordingController> ();
            }
        }
Esempio n. 2
0
        public static void RecordingAwake(GameObject level)
        {
            // enable static recorders

            foreach (StaticRecorder rec in
                     level.GetComponentsInChildren <StaticRecorder>())
            {
                rec.enabled = true;
            }

            // enable dynamic recorders

            foreach (DynamicRecorder rec in
                     level.GetComponentsInChildren <DynamicRecorder>())
            {
                rec.enabled = true;
            }

            // enable the recorder and start the recording

            RecordingController recorder = FindObjectOfType <RecordingController>();

            recorder.enabled = true;
            recorder.level   = level.GetComponent <TiledMap>();


            // make sure the start line will start the recording

            foreach (RecordingStarter starter in level.GetComponentsInChildren <RecordingStarter>())
            {
                starter.enabled = true;
            }

            // make the finish line finish the recording

            foreach (RecordingEnder ender in level.GetComponentsInChildren <RecordingEnder>())
            {
                ender.enabled = true;
            }


            // actually, we should also set up the finish and start lines to light up

            foreach (StartLineLighter lighter in level.GetComponentsInChildren <StartLineLighter>())
            {
                lighter.enabled = true;
            }

            foreach (FinishLineLighter lighter in level.GetComponentsInChildren <FinishLineLighter>())
            {
                lighter.enabled = true;
            }
        }