public void undo() { if (history.Peek() is DeSpawnInteraction) { s.RemoveObserver(this.GetComponent <UIManager>()._createdObject); } history.Peek().undo(); future.Push(history.Pop()); }
static void Main(string[] args) { Console.WriteLine("Hello World!"); ISubject subject = new Subject(); IObserver observer1 = new FirstObserver(subject); IObserver observer2 = new SecondObserver(subject); subject.AddObserver(observer1); subject.AddObserver(observer2); subject.HaveSomeTechLogic(); subject.RemoveObserver(observer1); subject.HaveSomeTechLogic(); }
void Start() { Subject subject = new Subject(); Observer1 observer1 = new Observer1(); Observer2 observer2 = new Observer2(); subject.RegisterObserver(observer1); subject.SetData("Hello World!"); subject.RegisterObserver(observer2); subject.SetData("Re:Hello World!"); subject.RemoveObserver(observer1); subject.SetData("Re:Re:Hello World!"); }
public void RemoveRegister(Subject dataPro) { this.dataPro = dataPro; dataPro.RemoveObserver(this); }
public void UnRegister() { sub.RemoveObserver(this); }
private void RemoveObserver(IObserver observer) => _subject.RemoveObserver(observer);
private void OnDestroy() { Subject.RemoveObserver(this); }
public void RemoveObserverOnFirstInput(IObserver observer) => _subject.RemoveObserver(observer);
private void OnDisable() { Subject.RemoveObserver(this); }
private void OnDisable() { Subject.RemoveObserver(this); seeker.CancelCurrentPathRequest(); }
public void RemoveObserver_ShouldReturn_removed_successfuly() { User us = new User("Lavanya", sb); Assert.Equal("Removed successfully", sb.RemoveObserver(us)); }
void OnDestroy() { lever.RemoveObserver(this); }