Advertisement
Guest User

Untitled

a guest
Sep 30th, 2015
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.16 KB | None | 0 0
  1. using System;
  2. using System.Collections;
  3. using System.Diagnostics;
  4.  
  5. public class CoroutineEx
  6. {
  7.     protected string name = string.Empty;
  8.     protected bool mustStop;
  9.     protected bool isStoppeable;
  10.     protected bool isExclusive;
  11.     protected bool hasFinished;
  12.  
  13.     public string Name
  14.     {
  15.         get { return this.name; }
  16.     }
  17.  
  18.     public bool IsStoppeable
  19.     {
  20.         get { return this.isStoppeable; }
  21.     }
  22.  
  23.     public bool IsExclusive
  24.     {
  25.         get { return this.isExclusive; }
  26.     }
  27.  
  28.     public bool HasFinished
  29.     {
  30.         get { return this.hasFinished; }
  31.     }
  32.  
  33.     public CoroutineEx(string name, bool isStoppeable, bool isExclusive)
  34.     {
  35.         this.name = name;
  36.         this.isStoppeable = isStoppeable;
  37.         this.isExclusive = isExclusive;
  38.     }
  39.  
  40.     [DebuggerHidden]
  41.     public virtual IEnumerator Run()
  42.     {
  43.         return new CoroutineEx.<Run>c__IteratorB();
  44.     }
  45.  
  46.     public virtual void CleanUp() { }
  47.  
  48.     public virtual void Stop()
  49.     {
  50.         if (this.isStoppeable)
  51.             this.mustStop = true;
  52.     }
  53.  
  54.     public virtual void Finished()
  55.     {
  56.         this.hasFinished = true;
  57.     }
  58. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement