public static BeatmapObstacleContainer SpawnObstacle(BeatmapObstacle data, AudioTimeSyncController atsc, ref GameObject prefab, ref ObstacleAppearanceSO appearanceSO) { BeatmapObstacleContainer container = Instantiate(prefab).GetComponent <BeatmapObstacleContainer>(); container.obstacleData = data; container.obstacleAppearance = appearanceSO; container.atsc = atsc; appearanceSO.SetObstacleAppearance(container); return(container); }