private void ResetBPM() { ResetTimer.Stop(); if (BPMTimer.IsRunning) { BPMTimer.Stop(); } IsFirstTap = true; TimesTapped = 0; AverageBPM = 0; MetronomeImage.Image = Properties.Resources.Metronome0; AvgBPM.Text = NearestWhole.Text = TapTimes.Text = "-"; }
// Use this for initialization void Start() { grid = GameObject.Find("SequencerGrid").GetComponent <SequencerGrid>(); clock = GameObject.Find("Timer").GetComponent <BPMTimer>(); _cells = new SequencerPad[grid.xSize, grid.ySize]; _nextCells = new int[grid.xSize, grid.ySize]; for (int x = 0, i = 0; x < grid.xSize; ++x) { for (int y = 0; y < grid.ySize; ++y, ++i) { _cells[x, y] = grid.mainGrid[i]; } } BPMTimer.stepOccurred += incrementBeat; clearCells(); }
// Use this for initialization void Start() { // Cannot access Unity random from Audio Thread so we have to use var r = new System.Random(); randomSeed = (ulong)r.Next(); grid = GameObject.Find("SequencerGrid").GetComponent <SequencerGrid>(); clock = GameObject.Find("Timer").GetComponent <BPMTimer>(); BPMTimer.stepOccurred += incrementStep; totalSteps = (grid.xSize * grid.ySize); awake = true; currentTick += InitialOffset; firstStep -= 1; currentTick = 0; lastTick = 0; }
// Use this for initialization void Awake() { audioSource = GetComponent <AudioSource>(); timer = GameObject.Find("Timer").GetComponent <BPMTimer>(); osc = GameObject.Find("OSC").GetComponent <OSC>(); if (DrumVoiceSource == null) { DrumVoiceSource = GameObject.Find("DrumVoices"); } rend = GetComponent <Renderer>(); noise = DrumVoiceSource.GetComponentInChildren <NoiseGenerator>(); voiceChannels = DrumVoiceSource.GetComponentsInChildren <DrumVoice>(); if (voiceChannels != null) { voice = voiceChannels[channel]; } message.address = "/block/" + OscID; message.values.Add("bang"); UpdateSample(currentSample = (int)Random.Range(0, Samples.Count)); if (PlaybackMode == Mode.Sample) { audioSource.loop = false; audioSource.playOnAwake = false; } if (spawnManager == null) { spawnManager = GameObject.Find("BlockSpawnManager").GetComponent <BlockSpawnManager>(); } }
private void Awake() { Quantiser = GameObject.Find("Timer").GetComponent <BPMTimer>(); audioSFX = GetComponent <AudioSource>(); bullets = new GameObject[MaxBullets]; }
// Use this for initialization void Start() { Clock = GameObject.Find("Timer").GetComponent <BPMTimer>(); GenerateSteps(NumberOfSteps); }
private void Awake() { Quantiser = GameObject.Find("Timer").GetComponent <BPMTimer>(); }
// Use this for initialization void Start() { Quantiser = GameObject.Find("Timer").GetComponent <BPMTimer>(); rend = GetComponent <Renderer> (); audioSfx = GetComponent <AudioSource> (); }