Beispiel #1
0
 public void SetTransition(TransitionVO transition, string text)
 {
     _transition = transition;
     _text.text  = text;
     if (transition.Flags == null)
     {
         Array.ForEach(Flags, f => gameObject.SetActive(false));
     }
     else
     {
         IncidentFlag flag;
         int          len = _transition.Flags.Length;
         Dictionary <string, string> subs = new Dictionary <string, string>();
         for (int i = Flags.Length - 1; i >= 0; i--)
         {
             bool active = i < len;
             Flags[i].gameObject.SetActive(active);
             if (active)
             {
                 flag            = _transition.Flags[i];
                 Flags[i].sprite = Array.Find(Icons, f => f.Type == flag.Type).Icon;
                 Flags[i].SetNativeSize();
                 subs["#"]        = flag.Value.ToString();
                 Tooltips[i].text = AmbitionApp.Localize((string.IsNullOrWhiteSpace(flag.Phrase)
                     ? flag.Type.ToString()
                     : flag.Phrase), subs);
             }
         }
         StartCoroutine(ForceUpdate());
     }
 }
Beispiel #2
0
 public void HandleTransition(int transitionIndex)
 {
     _index = -1;
     if (_transitions == null)
     {
         return;
     }
     if (_transitions.Count == 0)
     {
         AmbitionApp.SendMessage <TransitionVO>(IncidentMessages.TRANSITION, null);
     }
     else
     {
         TransitionVO trans = _transitions.Count == 1
             ? _transitions[0]
             : transitionIndex >= 0 && transitionIndex < _transitions.Count
             ? _transitions[transitionIndex]
             : null;
         if (trans != null)
         {
             AmbitionApp.SendMessage(IncidentMessages.TRANSITION, trans);
             AmbitionApp.SendMessage(AudioMessages.PLAY, AdvanceSound);
         }
     }
 }