void RefreshContainerForShape(BaseDisposable updatedComponent) { UIShape childComponent = updatedComponent as UIShape; Assert.IsTrue(childComponent != null, "This should never happen!!!!"); if (((UIShape.Model)childComponent.GetModel()).parentComponent != id) { RefreshAll(); return; } GameObject stackContainer = null; if (!stackContainers.ContainsKey(childComponent.id)) { stackContainer = Object.Instantiate(Resources.Load("UIContainerStackChild")) as GameObject; #if UNITY_EDITOR stackContainer.name = "UIContainerStackChild - " + childComponent.id; #endif stackContainers.Add(childComponent.id, stackContainer); int oldSiblingIndex = childComponent.referencesContainer.transform.GetSiblingIndex(); childComponent.referencesContainer.transform.SetParent(stackContainer.transform, false); stackContainer.transform.SetParent(referencesContainer.childHookRectTransform, false); stackContainer.transform.SetSiblingIndex(oldSiblingIndex); } else { stackContainer = stackContainers[childComponent.id]; } RefreshAll(); }
void RefreshContainerForShape(BaseDisposable updatedComponent) { RefreshAll(); referencesContainer.fitter.RefreshRecursively(); AdjustChildHook(); referencesContainer.scrollRect.Rebuild(CanvasUpdate.MaxUpdateValue); }
private void DetachFromMaterial(BaseDisposable baseDisposable) { if (attachedMaterials.ContainsKey(baseDisposable.id)) { attachedMaterials.Remove(baseDisposable.id); baseDisposable.OnAttach -= OnEntityAttachedMaterial; baseDisposable.OnDetach -= OnEntityDetachedMaterial; isPlayStateDirty = true; } }
private void AttachToMaterial(BaseDisposable baseDisposable) { if (!attachedMaterials.ContainsKey(baseDisposable.id)) { attachedMaterials.Add(baseDisposable.id, new MaterialComponent(baseDisposable)); baseDisposable.OnAttach += OnEntityAttachedMaterial; baseDisposable.OnDetach += OnEntityDetachedMaterial; isPlayStateDirty = true; if (baseDisposable.attachedEntities.Count > 0) { using (var iterator = baseDisposable.attachedEntities.GetEnumerator()) { while (iterator.MoveNext()) { var entity = iterator.Current; entity.OnShapeUpdated -= OnEntityShapeUpdated; entity.OnShapeUpdated += OnEntityShapeUpdated; } } } } }
public MaterialComponent(BaseDisposable component) { this.component = component; }