Esempio n. 1
0
        /// <summary>
        /// Sets up the components and variables to start recording
        /// </summary>
        public void PrepareForRecording()
        {
#if UNITY_IOS
            if (!ReplayKit.APIAvailable)
            {
                return;
            }

            preparingForRecording = true;
            RecordCountdownButton.SetActive(true);
            RecordButton.SetActive(false);
            Countdown();
            RecordCountdownButton.GetComponent <Animation>().Play();
#else
            Debug.LogWarning("Not impletmenting on the current platform");
#endif
        }
Esempio n. 2
0
        /// <summary>
        /// Sets up the components and variables to start recording.
        /// </summary>
        public void PrepareForRecording()
        {
#if UNITY_IOS
            if (!ReplayKit.APIAvailable)
            {
                return;
            }

            preparingForRecording = true;
            RecordCountdownButton.SetActive(true);
            RecordButton.SetActive(false);
            countDownNumber = 0;
            Countdown();
            //RecordCountdownButton.GetComponent<Animation>().Play();
#else
            Debug.LogWarning("ReplayKitRecorder PrepareForRecording() is not implemented on the current platform.");
#endif
        }
Esempio n. 3
0
        /// <summary>
        /// Displays a countdown before recording. At the end of it, it starts recording
        /// </summary>
        public void Countdown()
        {
#if UNITY_IOS
            RecordCountdownText.text = countDownNumber.ToString();
            if (countDownNumber != 0)
            {
                countDownNumber--;
                Invoke("Countdown", 1f);
            }
            else
            {
                countDownNumber = 3;
                RecordCountdownButton.SetActive(false);
                preparingForRecording = false;
                StartRecording();
            }
#else
            Debug.LogWarning("Not implemented on the current platform");
#endif
        }
Esempio n. 4
0
        private void Update()
        {
#if UNITY_IOS
            recording = ReplayKit.isRecording;
            //Debug.Log("ReplayKitRecorder#Update recording: " + recording + " error:" + ReplayKit.lastError);

            if (recording)
            {
                StopButton.SetActive(true);
                RecordButton.SetActive(false);
            }
            else
            {
                StopButton.SetActive(false);
            }

            // Check if theres any available recorded video
            if (ReplayKit.recordingAvailable)
            {
                ReplayButton.SetActive(true);
            }
            else
            {
                ReplayButton.SetActive(false);
            }

            if (preparingForRecording)
            {
                RecordCountdownButton.SetActive(true);
            }
            else
            {
                RecordCountdownButton.SetActive(false);
                if (!recording)
                {
                    RecordButton.SetActive(true);
                }
            }
#endif
        }
Esempio n. 5
0
 private void Start()
 {
     RecordCountdownButton.SetActive(false);
 }