예제 #1
0
    public bool playbackInput(bool looped)
    {
        float inputX = 0;
        float inputY = 0;

        if (recordedInput.isPlaybackCompleted() && looped)
        {
            this.transform.position = recordedInput.resetForPlayback(this.transform.position);
        }
        else if (recordedInput.isPlaybackActive())
        {
            recordedInput.continuePlayback(out inputX, out inputY);
            handleInput(inputX, inputY);
        }
        else if (recordedInput.isPlaybackReady())
        {
            recordedInput.startPlayback();
        }
        else
        {
            this.transform.position = recordedInput.resetForPlayback(this.transform.position);
        }

        if (recordedInput.isPlaybackCompleted() && !looped)
        {
            return(false);
        }
        else
        {
            return(true);
        }
    }
예제 #2
0
    public bool playbackInput(bool looped)
    {
        if (recordedInput.getInputRecordingCount() == 0)
        {
            return(false);
        }
        float inputX = 0;
        float inputY = 0;

        if (recordedInput.isPlaybackCompleted() && looped)
        {
            this.transform.position = recordedInput.resetForPlayback(this.transform.position);
        }
        else if (recordedInput.isPlaybackActive())
        {
            recordedInput.continuePlayback(out inputX, out inputY);
        }
        else if (recordedInput.isPlaybackReady())
        {
            recordedInput.startPlayback();
        }
        else
        {
            Debug.Log("Old: " + this.transform.position);
            this.transform.position = recordedInput.resetForPlayback(this.transform.position);
            Debug.Log("New: " + this.transform.position);
        }
        handleInput(inputX, inputY);
        if (recordedInput.isPlaybackCompleted())
        {
            return(false);
        }
        else
        {
            return(true);
        }
    }