ReplaySystem.PlayBack C# (CSharp) Méthode

PlayBack() private méthode

private PlayBack ( ) : void
Résultat 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

Exemple #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();}
 }