Example #1
0
 public void addAction(actionElement.actions actionType, float position, string argument1 = "")
 {
     if (argument1 == "")
     {
         actionList.Add(new actionElement(actionType, position, argument1));
         Debug.Log("An event has been added at beat number: " + position.ToString() + "." + "(" + actionType.ToString() + ")");
     }
     else if (argument1 != "")
     {
         surfaceActionList.Add(new actionElement(actionType, position, argument1));
         Debug.Log("An event has been added at beat number: " + position.ToString() + "." + "(" + actionType.ToString() + ") [SURFACE EVENT]");
     }
 }
Example #2
0
    IEnumerator performAction(actionElement.actions actionType, string[] args = null)
    {
        Debug.Log("Performing action: " + actionType.ToString());
        switch (actionType)
        {
        case actionElement.actions.Preparation:
        {
            //Prepare
            togglePrepare(int.Parse(args[0]), true, false);
            break;
        }

        case actionElement.actions.Active:
        {
            //Stop prepare
            togglePrepare(1, false, false);
            break;
        }

        case actionElement.actions.BeatSwitch:
        {
            //Switch beat
            switchStep(true);
            break;
        }

        case actionElement.actions.Tailswing:
        {
            //Swing tail
            break;
        }

        case actionElement.actions.CPUStill:
        {
            //Stay Still (Preparing) (Also affects CPU)
            togglePrepare(int.Parse(args[0]), true, true);
            break;
        }

        case actionElement.actions.CPUActive:
        {
            //Move Again (Preparing) (Also affects CPU)
            togglePrepare(int.Parse(args[0]), true, false);
            break;
        }

        case actionElement.actions.ToggleAuto:
        {
            //Toggle Auto
            autoMode = !autoMode;
            break;
        }

        case actionElement.actions.EndGame:
        {
            //End game
            break;
        }

        case actionElement.actions.PlaySound:
        {
            //playSound
            playSound(args[0]);
            break;
        }

        case actionElement.actions.SnapAdjust:
        {
            //Change snap
            snap = int.Parse(args[0]);
            break;
        }

        case actionElement.actions.Reset:
        {
            //Restart beatmap
            StartCoroutine(conductor.resetBeatmap());
            break;
        }

        case actionElement.actions.Pause:
        {
            //Pause
            conductor.resetStartOfSong(false);
            break;
        }

        case actionElement.actions.PauseAndReset:
        {
            //Reset, pause
            conductor.resetStartOfSong(true);
            break;
        }
        }
        yield return(null);
    }