public override void DestroyWordBehaviour(WordAbstractBehaviour behaviour, bool destroyGameObject = true) { string[] array = this.mWordBehaviours.Keys.ToArray <string>(); for (int i = 0; i < array.Length; i++) { string key = array[i]; if (this.mWordBehaviours[key].Contains(behaviour)) { this.mWordBehaviours[key].Remove(behaviour); if (this.mWordBehaviours[key].Count == 0) { this.mWordBehaviours.Remove(key); } if (destroyGameObject) { UnityEngine.Object.Destroy(behaviour.gameObject); this.mWordBehavioursMarkedForDeletion.Add(behaviour); } else { behaviour.UnregisterTrackable(); } } } }
private void UnregisterLostWords() { foreach (Word current in this.mLostWords) { if (this.mActiveWordBehaviours.ContainsKey(current.ID)) { WordAbstractBehaviour expr_3A = this.mActiveWordBehaviours[current.ID]; expr_3A.OnTrackerUpdate(TrackableBehaviour.Status.NOT_FOUND); expr_3A.UnregisterTrackable(); this.mActiveWordBehaviours.Remove(current.ID); } } }