Exemplo n.º 1
0
    private void Update()
    {
        switch (chefIntent)
        {
        case ChefIntentEnum.Idle:
            break;

        case ChefIntentEnum.GoToCook:
            //先检测订单是否有效
            if (orderForCustomer.CheckOrder())
            {
                //检测是否到达烹饪点
                if (npcAIWorker.characterMoveCpt.IsAutoMoveStop())
                {
                    //设置朝向
                    npcAIWorker.SetCharacterFace(orderForCustomer.stove.GetUserFace());
                    //开始做菜
                    SetIntent(ChefIntentEnum.Cooking);
                }
            }
            else
            {
                //设置闲置
                SetIntent(ChefIntentEnum.Idle);
            }
            break;

        case ChefIntentEnum.Cooking:
            if (!orderForCustomer.CheckOrder())
            {
                //设置闲置
                SetIntent(ChefIntentEnum.Idle);
            }
            break;
        }
    }
Exemplo n.º 2
0
 /// <summary>
 /// 意图-前往做菜
 /// </summary>
 /// <param name="orderForCustomer"></param>
 public void SetIntentForGoToCook(OrderForCustomer orderForCustomer)
 {
     //如果订单是否有效
     if (!orderForCustomer.CheckOrder())
     {
         SetIntent(ChefIntentEnum.Idle);
         return;
     }
     movePosition = orderForCustomer.stove.GetCookPosition();
     if (movePosition == null)
     {
         LogUtil.Log("厨师寻路失败-没有灶台烹饪点");
         return;
     }
     npcAIWorker.characterMoveCpt.SetDestination(movePosition);
     cookPro.SetActive(true);
 }