Exemplo n.º 1
0
 // Update is called once per frame
 void Update()
 {
     if (Input.GetMouseButtonDown(0))
     {
         agent.speed += 0.1f;
     }
     if ((transform.position - target.transform.position).magnitude < 1 && !stop)
     {
         //TODO Hit
     }
     agent.SetDestination(target.transform.position);
     Navigate.DebugDrawPath(agent.path.corners);
 }
Exemplo n.º 2
0
 private void FindUpdate()
 {
     if ((transform.position - _target.transform.position).magnitude < 1 && !_stop)
     {
         _anim.SetBool("attack", true);
         _attacking = true;
     }
     else
     {
         _anim.SetBool("attack", false);
     }
     if (!_attacking)
     {
         _agent.SetDestination(_target.transform.position);
         Navigate.DebugDrawPath(_agent.path.corners);
     }
 }
Exemplo n.º 3
0
    // Update is called once per frame
    void Update()
    {
        if (Input.GetMouseButtonDown(0))
        {
            agent.speed += 0.1f;
        }
        if ((transform.position - target.transform.position).magnitude < 1 && !stop)
        {
            stop = true;
            target.GetComponent <Navigate>().enabled = false;

            var win = FindObjectOfType <Continue>();
            win.WinCondition();
        }
        agent.SetDestination(target.transform.position);
        Navigate.DebugDrawPath(agent.path.corners);
    }
Exemplo n.º 4
0
 // Update is called once per frame
 void Update()
 {
     if (Input.GetMouseButtonDown(0))
     {
         agent.speed += 0.1f;
     }
     if ((transform.position - target.transform.position).magnitude < 1 && !stop)
     {
         stop = true;
         target.GetComponent <Navigate>().enabled = false;
         Canvas canvas   = FindObjectOfType <Canvas>();
         var    gameOver = canvas.transform.Find("Panel");
         gameOver.gameObject.SetActive(true);
         var score = canvas.transform.Find("Score");
         score.SendMessage("Stop", true);
     }
     agent.SetDestination(target.transform.position);
     Navigate.DebugDrawPath(agent.path.corners);
 }