Example #1
0
    public void Record()
    {
        rigidBody.isKinematic = false;
        int   frame = Time.frameCount % BufferFrames;
        float time  = Time.time;

        print("Writing Frame " + frame);

        KeyFrames[frame] = new myKeyFrame(time, transform.position, transform.rotation);
    }
Example #2
0
    private void Record()
    {
        myrigidbody.isKinematic = false;
        bufferSize        = bufferFrames;
        nextRecordedFrame = Time.frameCount;

        if (lastRecordedFrame > 0)
        {
            nextRecordedFrame = lastRecordedFrame++;
        }

        int   frame = nextRecordedFrame % bufferSize;
        float time  = Time.time;

        // print("writing time " + frame);
        keyframes[frame] = new myKeyFrame(time, transform.position, transform.rotation);
    }