public void Recycle() { if (pool == null) { //Debug.LogError("cant recycle because pool is not set"); return; } connections.DisconnectAll(); pool.Recycle(this); }
public static IDisposable WhateverBind <T>(this ICell <T> cell, Action <T, ConnectionCollector> action, Priority p = Priority.Normal) { var collector = new ConnectionCollector(); var disps = new ListDisposable { collector, cell.Bind(val => { collector.DisconnectAll(); action(val, collector); }, p) }; return(disps); }
private void OnDestroy() { Collerctor.DisconnectAll(); }