Exemple #1
0
        private void LoadSceneAsset()
        {
            var sceneGuid = Prefs.targetSceneGuid;

            sceneAsset = UnityEditorUtility.FindMainAsset(sceneGuid) as SceneAsset;

            isSceneLoaded = true;
        }
Exemple #2
0
        private void DrawManageInfoGUI(ManageInfo manageInfo)
        {
            if (manageInfo == null)
            {
                return;
            }

            var guid = manageInfo.guid;

            Object asset;

            if (!assetCacheByGuid.ContainsKey(guid))
            {
                asset = UnityEditorUtility.FindMainAsset(guid);

                assetCacheByGuid[guid] = asset;
            }
            else
            {
                asset = assetCacheByGuid.GetValueOrDefault(guid);
            }

            var assetPath = AssetDatabase.GUIDToAssetPath(guid);

            EditorLayoutTools.ContentTitle(assetPath, new Color(0.2f, 1f, 0f, 1f));

            using (new ContentsScope())
            {
                using (new DisableScope(true))
                {
                    EditorGUILayout.ObjectField("Asset", asset, typeof(Object), false);

                    EditorGUILayout.TextField("Category", manageInfo.category);

                    if (!string.IsNullOrEmpty(manageInfo.tag))
                    {
                        EditorGUILayout.TextField("Tag", manageInfo.tag);
                    }

                    if (!string.IsNullOrEmpty(manageInfo.comment))
                    {
                        EditorGUILayout.TextField("Comment", manageInfo.comment);
                    }

                    if (manageInfo.isAssetBundle)
                    {
                        EditorGUILayout.EnumPopup("NamingRule", manageInfo.assetBundleNamingRule);

                        if (!string.IsNullOrEmpty(manageInfo.assetBundleNameStr))
                        {
                            EditorGUILayout.TextField("NameStr", manageInfo.assetBundleNameStr);
                        }
                    }
                }
            }

            EditorGUILayout.Space(3f);
        }