Skip to content

Cobra Observables

Cobra Observables brings the power of observable types to Unity, allowing you to set up subscribers that get notified whenever a value changes. This can greatly simplify your game logic by reducing the need for complex event systems or manual tracking of value changes.

Cobra Observables has been meticulously tested, with over 100 unit tests to ensure robustness and reliability. This makes it a safe and reliable choice for your Unity projects.

Each class comes with methods that allow you to subscribe to changes, so you can execute your custom logic when changes occur.

For more details about the specific behavior of each class, refer to their respective sections in the documentation.

Class List

  • Observed<T>: Represents a single value that is observable for changes.
  • ObservedCollection<T>: Represents a collection where changes to the collection can be observed.
  • ObservedDictionary<TKey, TValue>: Represents a dictionary where changes to the dictionary can be observed.
  • TSObserved<T>: Thread-safe version of Observed<T>.
  • TSObservedCollection<TKey, TValue>: Thread-safe version of ObservedCollection.
  • TSObservedDictionary<TKey, TValue>: Thread-safe version of ObservedDictionary.
  • ObservedTextFile: Represents a text file whose changes are observable.
  • ObservedStack<T>: Represents a stack data structure where changes to the stack can be observed.
  • ObservedSortedSet<T>: Represents a sorted set of unique values where changes to the set can be observed.
  • ObservedSortedList<TKey, TValue>: Represents a sorted list of key/value pairs where changes to the list can be observed.
  • ObservedSortedDictionary<TKey, TValue>: Represents a sorted dictionary where changes to the dictionary can be observed.
  • ObservedSet<T>: Represents a set data structure where changes to the set can be observed.
  • ObservedQueue<T>: Represents a queue data structure where changes to the queue can be observed.
  • ObservedLinkedList<T>: Represents a linked list where changes to the list can be observed.
  • ObservedHashSet<T>: Represents a hash set of unique values where changes to the set can be observed.
  • ObservedBitArray: Represents an array of bits (binary data) where changes to the array can be observed.
  • ObservedBinaryFile: Represents a binary file whose changes are observable.