Example #1
0
    private void OnEnable()
    {
        instance = FindObjectOfType <Demonstrator>();

        measurement = FindObjectOfType <Measurement>();

        if (EditorApplication.isPlaying)
        {
            parameter = instance.GetBall().param;
        }
    }
Example #2
0
    private void SamplePositionOfBall()
    {
        if (instance)
        {
            var currentBallHeight = instance.GetBall().transform.position.y;

            if (samples.Count >= 200)
            {
                samples.Dequeue();
                samples.Enqueue(currentBallHeight);
            }
            else
            {
                samples.Enqueue(currentBallHeight);
            }
        }
    }