示例#1
0
    IEnumerator WalkToAssignPoint(ResourceController rc)
    {
        while (GetAngleBetween(transform.position, rc.gatherTransform.position) > 0.008f)
        {
            transform.LookAt(rc.gatherTransform);
            rb.velocity = transform.forward * 2;
            yield return(new WaitForEndOfFrame());
        }
        if (rc.resource.CanAddHuman(human))
        {
            rc.AddHuman(human);
            resourceBeingGathered = rc.resource;
            rc.ActivateGroundMarker(false);
            movieAction = ActionType.idle;
        }

        if (rc.GetComponent <TreeController>() != null)
        {
            axe.SetActive(true);
        }
        else
        {
            farmingTool.SetActive(true);
        }

        yield return(new WaitForEndOfFrame());
    }