// 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; }