예제 #1
0
파일: MIB.cs 프로젝트: X8invisible/BotsInUs
    void Update()
    {
        if (isKilling)
        {
            return;
        }

        if (GameOver.instance.gameOver)
        {
            ccc.ClearDestination();
            return;
        }

        GameObject nearestYellingHost = FindObject.FindNearestYellingHost(transform.position);

        if (nearestYellingHost != null)
        {
            ccc.followObject = nearestYellingHost;
            ccc.isRunning    = true;
            TryKilling(nearestYellingHost);
            return;
        }

        GameObject nearestHost = FindObject.FindNearestAliveHost(transform.position);

        if (nearestHost != null)
        {
            ccc.followObject = nearestHost;
            ccc.isRunning    = false;
            TryKilling(nearestHost);
            return;
        }
    }
예제 #2
0
    IEnumerator DrawAttentionCoroutine(Vector3 position)
    {
        ccc.followObject = null;
        ccc.destination  = position;
        ccc.isRunning    = true;

        float mouseClickedTime = Time.time;

        while ((position - transform.position).magnitude > 0.5f && Time.time - mouseClickedTime < 3)
        {
            yield return(null);
        }

        ccc.ClearDestination();
        ccc.isRunning = false;
        soundWaves.Play();
        isYelling = true;

        yield return(new WaitForSeconds(drawAttentionDuration));

        StopDrawingAttention();
    }