예제 #1
0
    private void FixedUpdate()
    {
        if (_point.IsComplete())
        {
            gameObject.transform.position = _player.transform.position;

            _lineRenderer.positionCount = _navMeshAgent.path.corners.Length;
            _lineRenderer.SetPositions(_navMeshAgent.path.corners);
        }
    }
예제 #2
0
    private void Update()
    {
        if (_point.IsComplete() && !_isOpen)
        {
            OpenDoor();
        }

        if (transform.rotation.y >= 90f)
        {
            _isOpen = true;
        }
        if (_isOpen)
        {
            Debug.Log("door is open");
        }
    }