Beispiel #1
0
 public override void PlayerApproachTarget(Agent agent)
 {
     (agent as PlayerAgent).ReachTargetChecker.OnDestinationReached = null;
     OnPlayerInteract.Invoke();
     EndInteraction(InteractingAgents);
     IsComplete = false;
 }
Beispiel #2
0
    new private void Start()
    {
        OnPlayerInteract.AddListener(HandlePlayerInteract);
        InteractableManager.Instance.RegisterHarvestable(gameObject);
        _soundEffect = GetComponent <AudioSource>();

        // This gives a warning that it's deprecated but I honestly can not find another way to make this work
        transform.RotateAround(new Vector3(0, 1, 0), Random.Range(0.0f, 360));
    }
Beispiel #3
0
 // Face a certain position in world coordinates.
 public void Face(Vector3 positionToLookAt)
 {
     OnPlayerInteract?.Invoke(positionToLookAt, turnSpeed);
 }
Beispiel #4
0
 private void OnDisable()
 {
     PlayerInteractEvent -= Interact;
 }
Beispiel #5
0
 private void OnEnable()
 {
     PlayerInteractEvent += Interact;
 }