Ejemplo n.º 1
0
 public AutoTriggerRUFTask(AutoStoryTrigger trigger)
 {
     this.trigger                 = trigger;
     base.Priority                = 40;
     base.ShouldProcess           = trigger.IsPreSatisfied();
     base.ShouldPlayFromLoadState = true;
     base.ShouldPurgeQueue        = false;
 }
Ejemplo n.º 2
0
        public static AbstractRUFTask GetRUFTaskForAutoTrigger(StoryTriggerVO vo)
        {
            if (string.IsNullOrEmpty(vo.PrepareString))
            {
                Service.Get <StaRTSLogger>().Error("AutoStoryTrigger: " + vo.Uid + " is missing prepare string");
                return(null);
            }
            string[] array = vo.PrepareString.Split(new char[]
            {
                '|'
            });
            if (array.Length < 2)
            {
                Service.Get <StaRTSLogger>().Error("AutoStoryTrigger: " + vo.Uid + " doesn't have enough arguments");
                return(null);
            }
            string text     = array[0];
            string prefName = array[1];

            if ("IF_PREF".Equals(text))
            {
                AutoStoryTrigger trigger = new AutoStoryTrigger(vo, Service.Get <QuestController>());
                return(new AutoTriggerRUFTask(trigger));
            }
            if (!"RESUME".Equals(text))
            {
                return(null);
            }
            SharedPlayerPrefs sharedPlayerPrefs = Service.Get <SharedPlayerPrefs>();
            string            pref = sharedPlayerPrefs.GetPref <string>(prefName);

            if (string.IsNullOrEmpty(pref))
            {
                return(null);
            }
            StoryActionVO optional = Service.Get <IDataController>().GetOptional <StoryActionVO>(pref);

            if (optional == null)
            {
                return(null);
            }
            return(new ResumeTutorialRUFTask(optional.Uid));
        }