protected override IEnumerator Move() { while (true) { if (wait) { float x = Mathf.Cos(Mathf.Deg2Rad * 45f) * radi; float y = Mathf.Sin(Mathf.Deg2Rad * 45f) * radi; Vector3 offset = new Vector3(x, 0, y); dest = transform.position + offset; SetDest2(); yield return(new WaitForSeconds(1f)); } float dis = (transform.position - dest).sqrMagnitude; if (dis < stopDistance || !nav.hasPath) { SetDestination(); } Lect.Rotate(transform, dest, control.rotateSpeed); yield return(null); } }
private IEnumerator Rotate() { while (true) { Lect.Rotate(transform, player.position, rotateSpeed); yield return(new WaitForFixedUpdate()); } }
private IEnumerator LookTarget() { while (enabled) { Lect.Rotate(transform, control.player.position, rotateSpeed); transform.rotation = new Quaternion(0, transform.rotation.y, 0, transform.rotation.w); yield return(new WaitForFixedUpdate()); } }
protected virtual IEnumerator Move() { while (true) { if (wait) { nav.SetDestination(transform.position); Lect.Rotate(transform, dest, control.rotateSpeed); } float dis = (transform.position - dest).sqrMagnitude; if (dis < stopDistance || !nav.hasPath) { SetDestination(); } Lect.Rotate(transform, dest, control.rotateSpeed); yield return(null); } }
protected virtual void Look() { Lect.Rotate(transform, look, rotateSpeed); }