Ejemplo n.º 1
0
        public override void OnInspectorGUI()
        {
            DialogChoose choose = (DialogChoose)target;

            base.OnInspectorGUI();
            eUtils.DrawConditionsSelector(choose.conditions, choose.transform, ref showConditions);
            eUtils.DrawEffectsSelector(choose.effects, choose.transform, ref showEffects);
        }
Ejemplo n.º 2
0
 public void RealizeChoose(DialogChoose choose)
 {
     if (choose != null)
     {
         choose.realized = true;
         if (choose.type == ChooseType.END)
         {
             curDialog.end = choose;
             FinalizeDialog();
             foreach (Effect effect in choose.effects)
             {
                 effect.Realize(curDialog, curDialog.teamOwner);
             }
         }
         else
         {
             foreach (Effect effect in choose.effects)
             {
                 effect.Realize(curDialog, curDialog.teamOwner);
             }
             List <DialogLink> avaliableLinks = new List <DialogLink>();
             foreach (DialogLink link in choose.links)
             {
                 bool flag = true;
                 foreach (Condition condition in link.conditions)
                 {
                     if (!condition.isFulfilled(curDialog.questOwner))
                     {
                         flag = false;
                         break;
                     }
                 }
                 if (flag)
                 {
                     avaliableLinks.Add(link);
                 }
             }
             if (avaliableLinks.Count > 0)
             {
                 StartPhrase(avaliableLinks[0].output);
             }
             else
             {
                 FinalizeDialog();
             }
         }
     }
     else
     {
         FinalizeDialog();
     }
 }