ReplaySystem.PlayBack C# (CSharp) Method

PlayBack() private method

private PlayBack ( ) : void
return void
    void PlayBack()
    {
        rigidBody.isKinematic = true;
        int frame = Time.frameCount % bufferFrames;
        print ("Reading frame " + frame);
        transform.position = keyFrames [frame].position;
        transform.rotation = keyFrames [frame].rotation;
    }

Usage Example

Esempio n. 1
0
 // Update is called once per frame
 void Update()
 {
     if (CrossPlatformInputManager.GetButton("Fire1"))
     {
         recording = false; replaySystem.PlayBack();
     }
     else
     {
         recording = true; replaySystem.Record();
     }
     //if(recording){replaySystem.Record();}
 }