Exemplo n.º 1
0
    void Update()
    {
        bool moved = npcMovementController.UpdateMovement();

        npcAppearanceController.UpdateAppearance();

        if (npcMovementController.GetGoal() != endGoal && !moved)
        {
            npcMovementController.SetCurrGoal(endGoal);
        }
    }
Exemplo n.º 2
0
    //Called to update this unit, returns true if anything in this unit has changed
    public bool UpdateUnit()
    {
        bool changed = false;

        //Update movement, and determine if movement change occured
        if (movementController.UpdateMovement())
        {
            changed = true;
        }

        //Update appearance, and determine if appearance change occured
        if (appearanceController.UpdateAppearance())
        {
            changed = true;
        }

        return(changed);
    }
Exemplo n.º 3
0
    // Update is called once per frame
    void Update()
    {
        if (playerPos != player.transform.position && (transform.position - player.transform.position).magnitude < followDistance)
        {
            playerPos = player.transform.position;
            appearancreController.SetNewGoal(playerPos + Vector3.up * height);
        }
        else
        {
            appearancreController.SetNewGoal(transform.forward + transform.position);
        }
        appearancreController.UpdateAppearance();

        if (myQuest != null)
        {
            if (myQuest.HasStarted())
            {
                myQuest.QuestUpdate();
            }
        }
    }