Ejemplo n.º 1
0
    // Use this for initialization
    void Start()
    {
        Application.targetFrameRate = 60;

        if (!sampler)
        {
            sampler = FindObjectOfType <ColorSampler>();
        }

        drawing = false;
        time    = 0;
        //colors = new Color[365];
        //float bonus = 0.1f;

        //float RMin = 0.7f + bonus;
        //float RMax = 0.9f + bonus;
        //float GMin = 0.32f + bonus;
        //float GMax = 0.6f + bonus;
        //float BMin = 0.0f + bonus;
        //float BMax = 0.39f + bonus;

        //for (int j = 0; j < colors.Length; j++)
        //{
        //    colors[j] = new Color(Random.Range(RMin, RMax), Random.Range(GMin, GMax), Random.Range(BMin, BMax), 1);
        //}

        //StartCoroutine(appendNewColors());
    }
Ejemplo n.º 2
0
        private void InitializeSampler()
        {
            Sampler = new ColorSampler();
            Sampler.BeatDetected += SamplerOnBeatDetected;
            Sampler.Sample        = _captureRect;

            RefreshSampler();
        }
Ejemplo n.º 3
0
        public void WeCanChangeTheValueOfAPropertyOfAnObject()
        {
            SampleTester<Color> test = new SampleTester<Color>() { property = new Color(0.5f, 0.5f, 0.5f, 0.5f) };
            ColorSampler sampler = new ColorSampler(test, "property", r, null, null, null);

            Color oldValue = test.property;

            sampler.Sample(0.5f);

            Assert.That(test.property.r, Is.Not.EqualTo(oldValue.r));
            Assert.That(test.property.g, Is.EqualTo(oldValue.g));
            Assert.That(test.property.b, Is.EqualTo(oldValue.b));
            Assert.That(test.property.a, Is.EqualTo(oldValue.a));
        }
Ejemplo n.º 4
0
        public void WeCanChangeTheValueOfAPropertyOfAnObject()
        {
            SampleTester <Color> test = new SampleTester <Color>()
            {
                property = new Color(0.5f, 0.5f, 0.5f, 0.5f)
            };
            ColorSampler sampler = new ColorSampler(test, "property", r, null, null, null);

            Color oldValue = test.property;

            sampler.Sample(0.5f);

            Assert.That(test.property.r, Is.Not.EqualTo(oldValue.r));
            Assert.That(test.property.g, Is.EqualTo(oldValue.g));
            Assert.That(test.property.b, Is.EqualTo(oldValue.b));
            Assert.That(test.property.a, Is.EqualTo(oldValue.a));
        }
Ejemplo n.º 5
0
    // Use this for initialization
    void Start()
    {
        //Screen.SetResolution(3840, 600, true);

        // toggles
        emailSender.useThreading  = useThreading;
        videoPlayback.emailActive = emailActive;

        // enables ui canvas on launch
        uiCanvas.SetActive(isUIActive);

        // if this is the first time the app is run
        if (PlayerPrefs.GetInt("isFirstRun") == 0 || runFirstRun)
        {
            if (uiSettings._debugActive)
            {
                Debug.Log("FirstRun sequence is currently running...");
            }

            // resets the ui settings to default
            uiSettings.DefaultSettings();

            // save the ui settings
            uiSettings.SaveSettings();

            // switch toggle
            PlayerPrefs.SetInt("isFirstRun", 1);
        }
        else
        {
            // load in saved settings
            uiSettings.LoadSettings();
        }

        // Find the color sampler if there isn't one.
        if (!sampler)
        {
            sampler = FindObjectOfType <ColorSampler>();
        }

        // updates system variables
        UpdateSystemSettings();
    }