コード例 #1
0
    public override void Act(GameObject player, GameObject npc)
    {
        AINavAgent npcNav = npc.GetComponent <AINavAgent>();

        npcNav.Stop();

        if ((Time.time - lastAttackTime) < 1.5)
        {
            return;
        }

        lastAttackTime = Time.time;
        npc.GetComponent <MonoBehaviour>().StartCoroutine("attackBehavior");
        Debug.Log("Attack Complete");
    }
コード例 #2
0
 public override void Act(GameObject player, GameObject npc)
 {
     npcTrans = npc.transform;
     npcNav   = npc.GetComponent <AINavAgent>();
     npcNav.Stop();
 }