Example #1
0
        void Update()
        {
            if (NarrativeManager.Get().IsPaused())
            {
                return;
            }

            timer += Time.deltaTime;

            if (execList.Count > 0)
            {
                if (timer >= 0f)
                {
                    NarrativeEffect effect = execList[0];
                    execList.RemoveAt(0);

                    if (effect.enabled)
                    {
                        effect.Trigger(last_triggerer);
                        timer = -effect.GetWaitTime();
                    }

                    CheckIfEnd();
                }
            }
            else if (childExecList.Count > 0)
            {
                //Still running
                if (timer >= 0f)
                {
                    NarrativeChild child = childExecList[0];
                    childExecList.RemoveAt(0);

                    float wait = child.RunIfMet(last_triggerer);
                    timer = -wait;

                    CheckIfEnd();
                }
            }
            else
            {
                if (trigger_type == NarrativeEventType.AutoTrigger && AreConditionsMet())
                {
                    Run();
                }
            }
        }