示例#1
0
 private void OnCollisionEnter(Collision collision)
 {
     if (collision.gameObject == myAgent.transform.gameObject)
     {
         HideAgent agent = myAgent.GetComponent <HideAgent>();
         agent.done    = true;
         agent.reward -= 10f;
         agent.losses += 1;
     }
 }
示例#2
0
 private void OnTriggerEnter(Collider other)
 {
     if (other.tag == "Player")
     {
         HideAgent hideAgent = other.gameObject.GetComponent <HideAgent>();
         hideAgent.done    = true;
         hideAgent.reward += 10.0f;
         hideAgent.wins   += 1;
         hideAgent.AgentReset();
     }
 }
示例#3
0
    void Start()
    {
        this.navAgent        = this.GetComponent <NavMeshAgent>();
        this.chaserRigidbody = this.GetComponent <Rigidbody>();

        this.hideAgent = myAgent.GetComponent <HideAgent>();

        currentTarget = seekLocations[Random.Range(0, seekLocations.Length)];
        navAgent.SetDestination(currentTarget.transform.position);

        this.targetLocationIndicator.transform.parent = null;
        lastKnownAgentLocation = Vector3.zero;
    }