void LateUpdate() { if (target != null) { Vector2 previousFocus = ocb.GetFocus(); if (acc != null) { if (zoomProgress >= zoomTime) { ocb.SetFocus(target.transform.position); } else { ocb.SetFocusX(target.transform.position.x + 1.4f * (int)acc.GetVerse() * (acc.IsClimbing() ? -1 : 1)); ocb.SetFocusY(target.transform.position.y); } } else { if (notSureIfDoesntHaveAcc) { acc = target.GetComponent <AnotherCharacterController>(); if (acc == null) { notSureIfDoesntHaveAcc = false; } } ocb.SetFocus(target.transform.position); } Vector2 sequentFocus = ocb.GetFocus(); if (previousFocus == sequentFocus) { zoomProgress += Time.deltaTime; if (zoomProgress >= zoomTime) { ocb.SetFocus(target.transform.position); ocb.SetZoom(0.35f); } } else { ocb.SetZoom(1); zoomProgress = 0; } } }
void LateUpdate() { if (target != null) { ocb.SetFocus(target.transform.position); ocb.SetZoom(target.GetComponent <TrailerWalker>().zoom); } }
private void Start() { ocb = GetComponent <OrthoCameraBehaviour>(); if (target != null) { ocb.SetFocus(target.transform.position, true); ocb.SetZoom(target.GetComponent <TrailerWalker>().zoom, true); } }