public void Awake() { sineScript = this.GetComponent <SineController>(); samplingFrequency = AudioSettings.outputSampleRate; print("Audio Sample Rate: " + samplingFrequency); waves = new Wave[sineScript.maxParents]; waves[0] = new Wave(sineScript.getFrequency(), sineScript.getAmplitude(), 0f, samplingFrequency); waveCount = 1; if (SceneManager.GetActiveScene().name == "Learn2D") { inLearn2D = true; leftScale = 1f; rightScale = 1f; } else { inLearn2D = false; } camera = GameObject.Find("ARCamera"); }
public void SetText() { float num = Mathf.Round(sineScript.getFrequency() * 100) / 100f; Fnum.GetComponent <TextMesh>().text = num.ToString(); }