コード例 #1
0
        private void ProcessNote(int index)
        {
            Types.LevelComponent levelComp = levelJSON.sequence[index];

            if (NoteActionTable.TryGetValue(levelComp.type, out System.Action <Types.LevelComponent> action))
            {
                action(levelComp);
            }
        }
コード例 #2
0
        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);
        }
コード例 #3
0
        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);
        }
コード例 #4
0
        private void ProcessSpeedNote(Types.LevelComponent component)
        {
            Debug.Log($"Type {component.type}, Time {component.time}, Value {component.value}");

            system_speed = float.Parse(component.value);
        }