Beispiel #1
0
    void laneTriggerDown(bool rightController)
    {
        if (isAlreadyInside)
        {
            return;
        }
        triggeredByRightController = rightController;

        isAlreadyInside = true;
        mat.SetColor("_BaseColor", AssetManager.instance.getHitBoxColor(true));
        //lastLaneHit = currentTime(false);
        lastLaneHit = currentTime();

        //Debug.Log("laneTriggerDown at " + lastLaneHit);

        SongRow.BoxType boxType = SongRow.BoxType.REGULAR;

        //TODO quite problematic to do calculation for hold... let's drop it for now and require action key
        if (InputUtils.isHoldKeyPressed(rightController))
        {
            boxType = SongRow.BoxType.HOLD;
        }

        int direction = InputUtils.getDirectionalPress(rightController);

        if (direction >= 0)
        {
            boxType = SongRow.BoxType.DIR_N + direction;
        }
        //if (InputUtils.isBlockHKeyPressed(rightController))
        //    boxType = SongRow.BoxType.BLOCK_H;
        //if (InputUtils.isBlockVKeyPressed(rightController))
        //    boxType = SongRow.BoxType.BLOCK_V;
        //if (InputUtils.isBombKeyPressed(rightController))
        //    boxType = SongRow.BoxType.BOMB;

        //TODO if recording beats...
        registeredBeat.timestamp = currentTime() - seekOffset();
        registeredBeat.type      = boxType;

        //Debug.Log("TRIGGER DOWN " + registeredBeat.timestamp + " " + registeredBeat.type);
        if (isEnabledLaneAudio)
        {
            if (wasAudioTriggered)//triggered acting as a switch (for loop)
            {
                wasAudioTriggered = false;
            }
            else
            {
                wasAudioTriggered = true;
            }

            if (InputUtils.isLoopKeyPressed(rightController))
            {
                switchLooping();
            }
        }
    }
Beispiel #2
0
 public void clear()
 {
     timestamp = 0;
     type      = SongRow.BoxType.NONE;
 }
Beispiel #3
0
 public RegisteredBeat(float timestamp, SongRow.BoxType type)
 {
     this.timestamp = timestamp;
     this.type      = type;
 }