コード例 #1
0
 public void EndChore(string reason)
 {
     if (GetCurrentChore() != null)
     {
         Chore currentChore = GetCurrentChore();
         base.smi.sm.currentChore.Set(null, base.smi);
         Chore chore = currentChore;
         chore.onExit = (Action <Chore>)Delegate.Remove(chore.onExit, new Action <Chore>(OnChoreExit));
         currentChore.Fail(reason);
         Trigger(1745615042, currentChore);
     }
 }
コード例 #2
0
        public void BeginChore()
        {
            Chore nextChore = GetNextChore();
            Chore chore     = base.smi.sm.currentChore.Set(nextChore, base.smi);

            if (chore != null && chore.IsPreemptable && (UnityEngine.Object)chore.driver != (UnityEngine.Object)null)
            {
                chore.Fail("Preemption!");
            }
            base.smi.sm.nextChore.Set(null, base.smi);
            Chore chore2 = chore;

            chore2.onExit = (Action <Chore>)Delegate.Combine(chore2.onExit, new Action <Chore>(OnChoreExit));
            chore.Begin(base.master.context);
            Trigger(-1988963660, chore);
        }