public void SetParams(MusicTrack track) { AdjustTrigger(); AdjustObstacleHolder(track); // Doesn't work (Delete in prefab instance) // DestroyHolderChildren(); CreateRandomObstacle(); }
public void AdjustObstacleHolder(MusicTrack track) { if (!obstacleHolder) { return; } var z = obstacleSecsOffset * track.BeatPerSec * track.ZPerBeat; var oldPos = obstacleHolder.transform.localPosition; var pos = new Vector3(oldPos.x, oldPos.y, z); obstacleHolder.transform.localPosition = pos; }