Help us understand the problem. What is going on with this article?

【Unity拡張】アセットストアからDLしたファイルの保存場所を開くエディター拡張

More than 1 year has passed since last update.

はじめに

アセットストアからダウンロードしたファイルの保存場所を開くエディター拡張を作ってみました。

動作環境

バージョン: Unity5以降
OS: Windows / Mac

ソースコード

以下のスクリプトをプロジェクト内のEditorフォルダ以下へ入れてください。

EditorOpenDirectory.cs
using System.IO;
using UnityEngine;
using UnityEditor;
using UnityEditorInternal;

public class EditorOpenDirectory
{
    [MenuItem("Open/Asset Store Directory")]
    static void OpenAssetStoreDirectory()
    {
        string path = "";
        if (SystemInfo.operatingSystem.Contains("Windows")) // OSがWindowsの場合
        {
            path = InternalEditorUtility.unityPreferencesFolder + Path.DirectorySeparatorChar + "../../Asset Store-5.x";
        }
        else if (SystemInfo.operatingSystem.Contains("Mac")) // OSがMacの場合
        {
            path = InternalEditorUtility.unityPreferencesFolder + Path.DirectorySeparatorChar + "../../../Unity/Asset Store-5.x";
        }
        OpenDirectory(path);
    }


    private static void OpenDirectory(string path)
    {
        System.Diagnostics.Process.Start(path);
    }
}

※Macでの動作確認はしていないため、もしかするとMacでは動かないかもしれません。

使う

メニューの Open/Asset Store Directory を選択するとアセットの保存場所が開かれます。

1_assetstore_edit.gif

参考URL

Unityで使用しているフォルダ一覧
http://masa795.hatenablog.jp/category/unity?page=1368587772

Asset Storeからダウンロードしたファイル(.unitypackage)の保存場所
http://d.hatena.ne.jp/nakamura001/20120312/1331567986

Why do not you register as a user and use Qiita more conveniently?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
Comments
Sign up for free and join this conversation.
If you already have a Qiita account
Why do not you register as a user and use Qiita more conveniently?
You need to log in to use this function. Qiita can be used more conveniently after logging in.
You seem to be reading articles frequently this month. Qiita can be used more conveniently after logging in.
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away