private void OnTriggerEnter2D(Collider2D collision) { if (collision.CompareTag("Player")) { targetDoor.Open(); ModeObserver m = this.gameObject.GetComponent <ModeObserver>(); ModeControl.Instance.modeObservers.Remove(m); Destroy(this.gameObject); } }
private void Start() { player = GameObject.Find("Player").GetComponent <Player>(); modeObserver = this.gameObject.GetComponent <ModeObserver>(); }
public void RegisterObserver(ModeObserver observer) { modeObservers.Add(observer); }