Exemplo n.º 1
0
    /// <summary>
    /// A generic event for various shouts that enemies reacts to.
    /// </summary>
    /// <param name="time"></param>
    public void MadeANoise(float time)
    {
        ShoutEventInfo sei = new ShoutEventInfo {
            playerPosition = Position.position, shoutDuration = time
        };

        EventHandeler.Current.FireEvent(EventHandeler.EVENT_TYPE.Song, sei);
    }
Exemplo n.º 2
0
    private void ShoutHasBeenMade(EventInfo eventInfo)
    {
        ShoutEventInfo shoutInfo = (ShoutEventInfo)eventInfo;

        shoutCD.gameObject.SetActive(true);
        shoutCD.maxValue = shoutInfo.shoutDuration;
        shoutCD.value    = shoutInfo.shoutDuration;
        StartCoroutine(ShoutCDTimer());
    }
Exemplo n.º 3
0
    /// <summary>
    /// Transitions to <see cref="AlphaSearchState"/> if the owner is within <see cref="hearingRange"/> distance of the player.
    /// </summary>
    /// <param name="eventInfo"> Contains information from <see cref="EventInfo"/></param>
    public void SearchForPlayer(EventInfo eventInfo)
    {
        ShoutEventInfo se = (ShoutEventInfo)eventInfo;

        if (IsNight && Vector3.Distance(transform.position, se.playerPosition) < hearingRange && Prey != null)
        {
            SearchPosition = se.playerPosition;
            TransitionTo <AlphaSearchState>();
        }
    }