void UpdateLayout(int _index) { string oldLayoutName = LLC.savedLazyLayouts[_index].layoutName; LLC.savedLazyLayouts[_index] = null; LazyLayout.LL_Layout lazyLayout = new LazyLayout.LL_Layout(); lazyLayout.layoutName = oldLayoutName; lazyLayout.minDeviceSizeForLayout = currentMinSizeForLayout; rectTransformsInScene = LLC.canvasInScene.GetComponentsInChildren <RectTransform>(true); for (int i = 0; i < rectTransformsInScene.Length; i++) { if (!rectTransformsInScene[i].gameObject.GetComponent <LazyLayout.LazyLayoutHelper>()) { Debug.Log("--LazyLayout-- Object -" + rectTransformsInScene[i].gameObject.name + "- seems to be new since no ll-Heler was detected. Adding it!"); LazyLayout.LazyLayoutHelper ll_Helper = rectTransformsInScene[i].gameObject.AddComponent <LazyLayout.LazyLayoutHelper>(); System.Guid newGuid = System.Guid.NewGuid(); ll_Helper.ll_GUID = newGuid.ToString(); lazyLayout.AddnewRectObject(rectTransformsInScene[i], newGuid.ToString()); } else { lazyLayout.AddnewRectObject(rectTransformsInScene[i], rectTransformsInScene[i].gameObject.GetComponent <LazyLayout.LazyLayoutHelper>().ll_GUID); } } lazyLayout.capableOf_16_9_Landscape = choosed_16_9_Landscape; lazyLayout.capableOf_16_9_Portrait = choosed_16_9_Portrait; lazyLayout.capableOf_4_3_Landscape = choosed_4_3_Landscape; lazyLayout.capableOf_4_3_Portrait = choosed_4_3_Portrait; lazyLayout.capableOf_3_2_Landscape = choosed_3_2_Landscape; lazyLayout.capableOf_3_2_Portrait = choosed_3_2_Portrait; lazyLayout.capableOf_Other = choosed_Other; lazyLayout.capableOf_Custom = choosed_Custom; lazyLayout.customAR_Length = customAR_Length; lazyLayout.customAR_Height = customAR_Heigth; LLC.savedLazyLayouts[_index] = lazyLayout; }
public void OnEnable() { LLH = target as LazyLayout.LazyLayoutHelper; }