Exemple #1
0
    public Notification CreateSpeechBubble(string speechText, Notification.SpeechBubbleDirection direction, Actor actor, bool bDestroyWhenNewCreated, bool parentToActor = true)
    {
        Notification component;

        this.DestroyOtherNotifications(direction);
        if (speechText == string.Empty)
        {
            component = UnityEngine.Object.Instantiate <GameObject>(this.speechIndicatorPrefab).GetComponent <Notification>();
            component.PlaySmallBirthForFakeBubble();
            component.SetPositionForSmallBubble(actor);
        }
        else
        {
            component = UnityEngine.Object.Instantiate <GameObject>(this.speechBubblePrefab).GetComponent <Notification>();
            component.ChangeText(speechText);
            component.FaceDirection(direction);
            component.PlayBirth();
            component.SetPosition(actor, direction);
        }
        if (bDestroyWhenNewCreated)
        {
            this.notificationsToDestroyUponNewNotifier.Add(component);
        }
        if (parentToActor)
        {
            component.transform.parent = actor.transform;
        }
        return(component);
    }
Exemple #2
0
 private void DestroyOtherNotifications(Notification.SpeechBubbleDirection direction)
 {
     if (this.notificationsToDestroyUponNewNotifier.Count != 0)
     {
         for (int i = 0; i < this.notificationsToDestroyUponNewNotifier.Count; i++)
         {
             if ((this.notificationsToDestroyUponNewNotifier[i] != null) && (this.notificationsToDestroyUponNewNotifier[i].GetSpeechBubbleDirection() == direction))
             {
                 this.NukeNotificationWithoutPlayingAnim(this.notificationsToDestroyUponNewNotifier[i]);
             }
         }
     }
 }
Exemple #3
0
 public Notification CreateSpeechBubble(string speechText, Notification.SpeechBubbleDirection direction, Actor actor)
 {
     return(this.CreateSpeechBubble(speechText, direction, actor, false, true));
 }