Example #1
0
    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);
        }
    }
Example #2
0
 private IEnumerator Rotate()
 {
     while (true)
     {
         Lect.Rotate(transform, player.position, rotateSpeed);
         yield return(new WaitForFixedUpdate());
     }
 }
Example #3
0
 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());
     }
 }
Example #4
0
    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);
        }
    }
Example #5
0
 protected virtual void Look()
 {
     Lect.Rotate(transform, look, rotateSpeed);
 }