Пример #1
0
    void FixedUpdate()
    {
        float distancia = Vector3.Distance(transform.position, player.transform.position);

        if (distancia > 10)
        {
            Wander();
        }
        else if (distancia > 2)
        {
            direcao     = player.transform.position - transform.position;
            novaRotacao = Quaternion.LookRotation(direcao);
            Animate.Attack(false);
            Move.Move(direcao, status.speed, novaRotacao);
        }
        else
        {
            Animate.Attack(true);
        }
    }
Пример #2
0
    private IEnumerator MoveCoroutine()
    {
        yield return(new WaitForSecondsRealtime(2f));

        Debug.Log(One[0]);
        if (One[0] == 0)
        {
            sources[1].Play();
            One[0]++;
        }
        mc.enabled = true;
        mc.Move(0, 1);
        HouseImage.sprite = Image[1];
        StartCoroutine("CloseDoorCoroutine");
    }