Ejemplo n.º 1
0
    public void StartFollowing()
    {
        _player = DroneVision.GetPlayer();

        if (!_isFollowing) // call the movement coroutine if not already following the player
        {
            if (isFleet)
            {
                isNotified = true;

                for (int i = 0; i < Fleet.Count; i++)
                {
                    Fleet[i].isNotified = true;
                    Fleet[i].StartFollowing();
                }

                /*
                 * foreach(var drone in Fleet)
                 * {
                 *  if(!drone.isNotified)
                 *  {
                 *      drone.isNotified = true;
                 *      drone.StartFollowing();
                 *  }
                 *
                 * }*/
            }
            droneState   = DroneMovementState.Following;
            _isFollowing = true;
            StartCoroutine(FollowPlayer());
        }
    }
Ejemplo n.º 2
0
    public void StartFollowing()
    {
        player = DroneVision.GetPlayer();

        if (!isFollowing) // call the movement coroutine if not already following the player
        {
            droneState  = DroneMovementState.Following;
            isFollowing = true;
            StartCoroutine(FollowPlayer());
        }
    }
    public IEnumerator Alarm(Vector3 position, DroneVision drone)
    {
        if (_agent != null && !_playerVisibility.stunned)
        {
            _agent.destination = position;
            _agent.speed       = chasingSpeed;
            drone.canRespond   = false;

            yield return(new WaitForSeconds(5.0f));

            drone.canRespond = true;
        }
    }