public void RequestAutoBinding(ISmartRef r) { if (_refsToBind == null) { _refsToBind = new List <ISmartRef>(); } if (!_refsToBind.Contains(r)) { _refsToBind.Add(r); hasRefsToBind = true; } }
/// <summary> /// Internal use only! /// Called by SmartRefs during deserialization to auto-bind unity events. /// Auto-binding requires addition of SmartRefUnbinder component which cannot be created during deserialization. /// Multi elements created lazily and cannot be created during deserialization. /// So Multi waits for element to be accessed, then binds event and adds component. /// </summary> public void RequestCtorAutoUnityEventBinding(ISmartRef r, int index) { List <ISmartRef> refs = null; if (!_refsToBindByIndex.TryGetValue(index, out refs)) { refs = new List <ISmartRef>(); _refsToBindByIndex[index] = refs; } if (!refs.Contains(r)) { refs.Add(r); _hasRefsToBind = true; } }
/// <summary> /// Internal use only. /// Called by SmartRefs during deserialization to auto-bind unity events. /// Auto-binding requires addition of SmartRefUnbinder component which cannot be created during deserialization. /// So Data waits for value to be changed, then binds event and add component. /// </summary> public void RequestCtorAutoUnityEventBinding(ISmartRef r) { _binder.RequestAutoBinding(r); }