示例#1
0
        private void OnGUI()
        {
            RLDApp rldApp = RLDApp.Get;

            if (rldApp == null)
            {
                return;
            }

            DynamicConvertSettings settings = rldApp.DynamicConvertSettings;

            settings.RenderEditorGUI(rldApp);

            _prefabFolderDropHandler.Handle(Event.current, settings.PrefabFolderDropRect);

            const float btnWidth = 110.0f;
            GUIContent  content  = new GUIContent();

            EditorGUILayout.BeginHorizontal();
            content.text    = "Convert scene";
            content.tooltip = "Converts the obejcts in the scene. Note: Only the objects which are of a convertable type will be converted.";
            if (GUILayout.Button(content, GUILayout.Width(btnWidth)))
            {
                ConvertScene(settings);
            }

            content.text    = "Convert prefabs";
            content.tooltip = "Converts the prefabs in the specified folder. Note: Only the prefabs which are of a convertable type will be converted.";
            if (GUILayout.Button(content, GUILayout.Width(btnWidth)))
            {
                ConvertPrefabs(settings);
            }
            EditorGUILayout.EndHorizontal();
        }
示例#2
0
            protected override void PerformDrop()
            {
                RLDApp rldApp = RLDApp.Get;

                if (rldApp == null)
                {
                    return;
                }

                string[] paths = DragAndDrop.paths;
                if (paths == null || paths.Length == 0)
                {
                    return;
                }

                string prefabFolder = paths[0];

                if (string.IsNullOrEmpty(prefabFolder))
                {
                    return;
                }

                EditorUndoEx.Record(rldApp);
                rldApp.DynamicConvertSettings.PrefabFolder = prefabFolder;
            }