Exemplo n.º 1
0
        IEnumerator StepByStepMementoRecovery(GrabbedMemento memento)
        {
            float passedTime = 0;

            _rb.isKinematic = true;
            while (Vector3.Distance(transform.position, memento.position) > .01f)
            {
                transform.position = Vector3.Lerp(transform.position, memento.position, passedTime);
                yield return(null);

                passedTime += Time.deltaTime;
            }
            _rb.isKinematic = false;
        }
Exemplo n.º 2
0
 public void SetMemento(GrabbedMemento memento)
 {
     transform.rotation = memento.rotation;
     StartCoroutine(StepByStepMementoRecovery(memento));
 }