void StartPeripheral() { peripheralTimer += Time.deltaTime; if (peripheralTimer > timeBetweenPeripheralSpawn && bothSideSpawn) { m_SpawnPeriperal.SpawnFromBothColumns(); peripheralTimer = 0; } if (peripheralTimer > timeBetweenPeripheralSpawn && !bothSideSpawn) { m_SpawnPeriperal.SpawnLeftwardMotion(); peripheralTimer = 0; } }
////////////////////////////////////////////////////////////////////////////////////////////////// // Appendix Methods ////////////////////////////////////////////////////////////////////////////////////////////////// void StartPeripheral(string direction) { peripheralTimer += Time.deltaTime; if (peripheralTimer > timeBetweenPeripheralSpawn) { timeBetweenPeripheralSpawn = Random.Range(0.1f, 0.15f); // **hard coded time range for now** if (direction == "Right") { m_SpawnPeriperal.SpawnRightwardMotion(); } if (direction == "Left") { m_SpawnPeriperal.SpawnLeftwardMotion(); } if (direction == "Null") { m_SpawnPeriperal.SpawnFromBothColumns(); } peripheralTimer = 0; } }