Пример #1
0
 /// <summary>
 /// 意图-走向客户
 /// </summary>
 private void SetIntentForGoToCustomer()
 {
     if (accostPro != null)
     {
         accostPro.SetActive(false);
     }
     //设置客户等待
     npcAICustomer.SetIntent(NpcAICustomerCpt.CustomerIntentEnum.WaitAccost);
     //走向客户
     movePosition = Vector3.Lerp(transform.transform.position, npcAICustomer.transform.position, 0.9f);
     npcAIWorker.characterMoveCpt.SetDestination(movePosition);
     //展示表情
     npcAIWorker.SetExpression(CharacterExpressionCpt.CharacterExpressionEnum.Surprise);
 }
Пример #2
0
    public void BuildCustomer(Vector3 npcPosition)
    {
        //生成NPC
        GameObject npcObj = BuildNpc(npcPosition);
        //设置意图
        NpcAICustomerCpt customerAI = npcObj.GetComponent <NpcAICustomerCpt>();

        //想要吃饭概率
        if (GameTimeHandler.Instance.GetDayStatus() == GameTimeHandler.DayEnum.Work && IsWantEat(CustomerTypeEnum.Normal))
        {
            customerAI.SetIntent(NpcAICustomerCpt.CustomerIntentEnum.Want);
        }
        else
        {
            customerAI.SetIntent(NpcAICustomerCpt.CustomerIntentEnum.Walk);
        }
    }