Example #1
0
    IEnumerator MoveOne(Vector3 newPosition, float time)
    {
        float   elapsedTime = 0;
        Vector3 startingPos = transform.position;

        while (elapsedTime < time)
        {
            transform.position = Vector3.Lerp(startingPos, newPosition, (elapsedTime / time));
            elapsedTime       += Time.deltaTime;
            yield return(new WaitForEndOfFrame());
        }
        CheckNeighbours();
        cover.CheckForCovers();
    }