//void OnSceneGUI() //{ // Event e = Event.current; // if (e != null) // { // Debug.Log(e.commandName); // if (e.commandName == "Duplicate") // { // Debug.Log("<ksdjfyksndf"); // } // } //} public void OnEnable() { LLC = target as LazyLayoutController; mainGameView = GetMainGameView(); int layoutCount = LLC.savedLazyLayouts.Count; if (layoutCount > 0) { for (int i = 0; i < layoutCount; i++) { if (i <= LLC.savedLazyLayouts.Count - 1) { if (i == LLC.index_CurrentlySelectedLayout - 1) { choosed_16_9_Landscape = LLC.savedLazyLayouts[i].capableOf_16_9_Landscape; choosed_16_9_Portrait = LLC.savedLazyLayouts[i].capableOf_16_9_Portrait; choosed_4_3_Landscape = LLC.savedLazyLayouts[i].capableOf_4_3_Landscape; choosed_4_3_Portrait = LLC.savedLazyLayouts[i].capableOf_4_3_Portrait; choosed_3_2_Landscape = LLC.savedLazyLayouts[i].capableOf_3_2_Landscape; choosed_3_2_Portrait = LLC.savedLazyLayouts[i].capableOf_3_2_Portrait; choosed_Other = LLC.savedLazyLayouts[i].capableOf_Other; choosed_Custom = LLC.savedLazyLayouts[i].capableOf_Custom; customAR_Length = LLC.savedLazyLayouts[i].customAR_Length; customAR_Heigth = LLC.savedLazyLayouts[i].customAR_Height; LLC.layoutName = LLC.savedLazyLayouts[i].layoutName; currentMinSizeForLayout = LLC.savedLazyLayouts[i].minDeviceSizeForLayout; } } } } }
public void DeleteGO() { delCounter = 0; LazyLayoutController LLC = GameObject.FindObjectOfType <LazyLayoutController>(); //Check every saved layout for ll_GUID of the object that has to be delted for (int i = 0; i < LLC.savedLazyLayouts.Count; i++) { for (int j = 0; j < LLC.savedLazyLayouts[i].savedRectTransformsInScene.Count; j++) { if (LLC.savedLazyLayouts[i].savedRectTransformsInScene[j].ll_GUID == LLH.ll_GUID) { delCounter++; LLC.savedLazyLayouts[i].savedRectTransformsInScene.RemoveAt(j); } } } Debug.LogWarning("--LazyLayout-- Removed " + delCounter + " entries in all saved layouts"); //finally destroy the GO DestroyImmediate(LLH.gameObject); }