private GameObject CreateFileSaveAs() { FileSaveAsFactory factory = Undoable.AddComponent <FileSaveAsFactory>(disposable); factory.parent = parent; factory.keyboard = keyboard; GameObject panel = factory.Generate(); fileSaveAsInstance = panel; GameObject fileSaveAsContainer = panel.transform.parent.gameObject; fileSaveAsContainer.transform.localPosition = fileSaveAsLocalPosition; fileSaveAs = fileSaveAsInstance.transform.Find("DrivesPanel").GetComponent <FileSaveAs>(); fileManager.saveAsPanel = fileSaveAs; #if UNITY_EDITOR var onSaveAs = fileSaveAs.onSaveAs; for (int i = 0; i < onSaveAs.GetPersistentEventCount(); i++) { UnityEventTools.RemovePersistentListener(onSaveAs, 0); } UnityEventTools.AddPersistentListener(onSaveAs, fileManager.SaveAs); fileSaveAs.onSaveAs = onSaveAs; #endif return(panel); }
private GameObject CreateFileSaveAs() { FileSaveAsFactory factory = Undoable.AddComponent <FileSaveAsFactory>(disposable); factory.parent = parent; factory.keyboard = keyboard; GameObject panel = factory.Generate(); fileSaveAsInstance = panel; GameObject fileSaveAsContainer = panel.transform.parent.gameObject; fileSaveAsContainer.transform.localPosition = fileSaveAsLocalPosition; fileSaveAs = fileSaveAsInstance.transform.Find("DrivesPanel").GetComponent <FileSaveAs>(); return(panel); }