<commit_before>﻿using UnityEngine;

namespace UnityTouchRecorder
{
    public class TouchRecorderController : MonoBehaviour
    {
        UnityTouchRecorderPlugin plugin = new UnityTouchRecorderPlugin();

        [SerializeField]
        TouchRecorderView view;

        void Awake()
        {
            Object.DontDestroyOnLoad(gameObject);

            view.OpenMenuButton.onClick.AddListener(() =>
                {
                    view.SetMenuActive(!view.IsMenuActive);
                });

            view.StartRecordingButton.onClick.AddListener(() =>
                {
                    view.SetMenuActive(false);

                    view.OpenMenuButton.gameObject.SetActive(false);
                    view.StopButton.gameObject.SetActive(true);

                    plugin.StartRecording();
                });

            view.PlayButton.onClick.AddListener(() =>
                {
                    view.SetMenuActive(false);

                    view.OpenMenuButton.gameObject.SetActive(false);
                    view.StopButton.gameObject.SetActive(true);

                    plugin.Play(view.Repeat, view.Interval);
                });
            
            view.StopButton.onClick.AddListener(() =>
                {
                    view.OpenMenuButton.gameObject.SetActive(true);
                    view.StopButton.gameObject.SetActive(false);

                    plugin.StopRecording();
                    plugin.Stop();
                });
        }
    }
}<commit_msg>Clear record before start new recording<commit_after>﻿using UnityEngine;

namespace UnityTouchRecorder
{
    public class TouchRecorderController : MonoBehaviour
    {
        UnityTouchRecorderPlugin plugin = new UnityTouchRecorderPlugin();

        [SerializeField]
        TouchRecorderView view;

        void Awake()
        {
            Object.DontDestroyOnLoad(gameObject);

            view.OpenMenuButton.onClick.AddListener(() =>
                {
                    view.SetMenuActive(!view.IsMenuActive);
                });

            view.StartRecordingButton.onClick.AddListener(() =>
                {
                    view.SetMenuActive(false);

                    view.OpenMenuButton.gameObject.SetActive(false);
                    view.StopButton.gameObject.SetActive(true);

                    plugin.Clear();
                    plugin.StartRecording();
                });

            view.PlayButton.onClick.AddListener(() =>
                {
                    view.SetMenuActive(false);

                    view.OpenMenuButton.gameObject.SetActive(false);
                    view.StopButton.gameObject.SetActive(true);

                    plugin.Play(view.Repeat, view.Interval);
                });
            
            view.StopButton.onClick.AddListener(() =>
                {
                    view.OpenMenuButton.gameObject.SetActive(true);
                    view.StopButton.gameObject.SetActive(false);

                    plugin.StopRecording();
                    plugin.Stop();
                });
        }
    }
}
{'fraction_non_alphanumeric': 0.09320388349514563, 'fraction_numerical': 0.0, 'mean_word_length': 1.4073208722741433, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5394018', 'n_tokens_mistral': 773, 'n_tokens_neox': 704, 'n_words': 78}