private void ProcessNote(int index) { Types.LevelComponent levelComp = levelJSON.sequence[index]; if (NoteActionTable.TryGetValue(levelComp.type, out System.Action <Types.LevelComponent> action)) { action(levelComp); } }
private void ProcessSnakeNote(Types.LevelComponent component) { Debug.Log($"Type {component.type}, Time {component.time}, Value {component.value}"); SnakeMesh snakeNote = SpawnSnakeMesh(component); NoteStruct noteStruct = new NoteStruct(); noteStruct.snakeMesh = snakeNote; noteStruct.component = component; noteStruct.velocity = ((default_distance - snakeNote.snakePath[0].z) / default_time) * deltaTime; noteList.Add(noteStruct); }
private SnakeMesh SpawnSnakeMesh(Types.LevelComponent component) { SnakeMesh spawnEmptySnake = UtilityMethod.CreateObjectToParent <SnakeMesh>(SnakeHolder, snakePrefab.gameObject); SnakePath snakePathData = LevelSRP.GetSnakePath(component.value); if (snakePathData != null) { spawnEmptySnake.SetUp(); spawnEmptySnake.SetSnakePath(snakePathData, false); spawnEmptySnake.RenderMesh(); spawnEmptySnake.transform.position = new Vector3(snakePathData.OffsetPosition.x, -0.8f, default_distance - snakePathData[0].z); } return(spawnEmptySnake); }
private void ProcessSpeedNote(Types.LevelComponent component) { Debug.Log($"Type {component.type}, Time {component.time}, Value {component.value}"); system_speed = float.Parse(component.value); }