├── Editor.meta ├── Editor ├── MoveWindow.cs ├── MoveWindow.cs.meta ├── UnityPackageInfo.cs ├── UnityPackageInfo.cs.meta ├── kakunpc.Assets2Packages.Editor.asmdef └── kakunpc.Assets2Packages.Editor.asmdef.meta ├── Images.meta ├── Images ├── Assets2Packages.gif └── Assets2Packages.gif.meta ├── LICENSE ├── LICENSE.meta ├── README.md ├── README.md.meta ├── package.json └── package.json.meta /Editor.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 5de77a6971bd2824882ecdc7aa91bb43 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Editor/MoveWindow.cs: -------------------------------------------------------------------------------- 1 | using System.IO; 2 | using UnityEditor; 3 | using UnityEngine; 4 | using Object = UnityEngine.Object; 5 | 6 | namespace Packages.Assets2Packages.Editor 7 | { 8 | public class MoveWindow : EditorWindow 9 | { 10 | const string SamplePackage = "com.unity.sample"; 11 | 12 | string category = "Unity/AssetStore"; 13 | string description = ""; 14 | string displayName = ""; 15 | Object folder; 16 | string keywords = ""; 17 | string packageName = SamplePackage; 18 | string unity = "2018.2"; 19 | string version = "1.0.0"; 20 | 21 | [MenuItem("Window/Assets 2 Packages")] 22 | static void Init() 23 | { 24 | var window = (MoveWindow) GetWindow(typeof(MoveWindow)); 25 | window.Show(); 26 | window.titleContent = new GUIContent("Assets 2 Packages"); 27 | } 28 | 29 | bool CheckSettings() 30 | { 31 | return folder != null && string.IsNullOrEmpty(packageName) == false && packageName != SamplePackage; 32 | } 33 | 34 | void OnGUI() 35 | { 36 | GUILayout.Label("Base Settings", EditorStyles.boldLabel); 37 | 38 | var newFolder = EditorGUILayout.ObjectField("Folder", folder, typeof(Object), false); 39 | var path = AssetDatabase.GetAssetPath(newFolder); 40 | if (path.StartsWith("Packages/")) path = string.Empty; 41 | folder = AssetDatabase.IsValidFolder(path) ? newFolder : null; 42 | packageName = EditorGUILayout.TextField("Package Name", packageName); 43 | displayName = EditorGUILayout.TextField("Display Name", displayName); 44 | category = EditorGUILayout.TextField("Category", category); 45 | description = EditorGUILayout.TextField("Description", description); 46 | unity = EditorGUILayout.TextField("Unity", unity); 47 | version = EditorGUILayout.TextField("Version", version); 48 | keywords = EditorGUILayout.TextField("Keywords", keywords); 49 | 50 | EditorGUI.BeginDisabledGroup(CheckSettings() == false); 51 | if (GUILayout.Button("Move Start")) Move(); 52 | EditorGUI.EndDisabledGroup(); 53 | } 54 | 55 | void Move() 56 | { 57 | var unityPackageInfo = new UnityPackageInfo 58 | { 59 | category = category, 60 | description = description, 61 | keywords = keywords.Split(','), 62 | name = packageName.ToLower(), 63 | displayName = displayName, 64 | unity = unity, 65 | version = version 66 | }; 67 | var json = JsonUtility.ToJson(unityPackageInfo); 68 | 69 | var packageDirectory = Path.Combine(Application.dataPath, $"../Packages/{packageName}"); 70 | 71 | var path = Path.Combine(Application.dataPath, AssetDatabase.GetAssetPath(folder).Substring("Assets/".Length)); 72 | 73 | Directory.Move(path, packageDirectory); 74 | 75 | using (var writer = new StreamWriter(packageDirectory + "/package.json", false)) 76 | { 77 | writer.WriteLine(json); 78 | } 79 | 80 | AssetDatabase.Refresh(); 81 | Close(); 82 | } 83 | 84 | 85 | } 86 | } 87 | -------------------------------------------------------------------------------- /Editor/MoveWindow.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3727108ab6eb20d4eb4f0b12603aaaba 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Editor/UnityPackageInfo.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace Packages.Assets2Packages.Editor 4 | { 5 | [Serializable] 6 | public class UnityPackageInfo 7 | { 8 | public string category; 9 | public string description; 10 | public string displayName; 11 | public string[] keywords; 12 | public string name; 13 | public string unity; 14 | public string version; 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /Editor/UnityPackageInfo.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 161f345779f8ce24087d084d844fcb39 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Editor/kakunpc.Assets2Packages.Editor.asmdef: -------------------------------------------------------------------------------- 1 | { 2 | "name": "kakunpc.Assets2Packages.Editor", 3 | "references": [], 4 | "optionalUnityReferences": [], 5 | "includePlatforms": [ 6 | "Editor" 7 | ], 8 | "excludePlatforms": [], 9 | "allowUnsafeCode": false, 10 | "overrideReferences": false, 11 | "precompiledReferences": [], 12 | "autoReferenced": true, 13 | "defineConstraints": [] 14 | } -------------------------------------------------------------------------------- /Editor/kakunpc.Assets2Packages.Editor.asmdef.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e8f12a78308eb374a89b8706f9f6d463 3 | AssemblyDefinitionImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Images.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 6d5eed410b256684498e495a0ccad3bd 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Images/Assets2Packages.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kakunpc/Assets2Packages/8941a1e5e8ec285e9e42e552035e42bce83ced04/Images/Assets2Packages.gif -------------------------------------------------------------------------------- /Images/Assets2Packages.gif.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: fb52747c56cc895469b7a11eaa4b5029 3 | TextureImporter: 4 | fileIDToRecycleName: {} 5 | externalObjects: {} 6 | serializedVersion: 7 7 | mipmaps: 8 | mipMapMode: 0 9 | enableMipMap: 1 10 | sRGBTexture: 1 11 | linearTexture: 0 12 | fadeOut: 0 13 | borderMipMap: 0 14 | mipMapsPreserveCoverage: 0 15 | alphaTestReferenceValue: 0.5 16 | mipMapFadeDistanceStart: 1 17 | mipMapFadeDistanceEnd: 3 18 | bumpmap: 19 | convertToNormalMap: 0 20 | externalNormalMap: 0 21 | heightScale: 0.25 22 | normalMapFilter: 0 23 | isReadable: 0 24 | streamingMipmaps: 0 25 | streamingMipmapsPriority: 0 26 | grayScaleToAlpha: 0 27 | generateCubemap: 6 28 | cubemapConvolution: 0 29 | seamlessCubemap: 0 30 | textureFormat: 1 31 | maxTextureSize: 2048 32 | textureSettings: 33 | serializedVersion: 2 34 | filterMode: -1 35 | aniso: -1 36 | mipBias: -100 37 | wrapU: -1 38 | wrapV: -1 39 | wrapW: -1 40 | nPOTScale: 1 41 | lightmap: 0 42 | compressionQuality: 50 43 | spriteMode: 0 44 | spriteExtrude: 1 45 | spriteMeshType: 1 46 | alignment: 0 47 | spritePivot: {x: 0.5, y: 0.5} 48 | spritePixelsToUnits: 100 49 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 50 | spriteGenerateFallbackPhysicsShape: 1 51 | alphaUsage: 1 52 | alphaIsTransparency: 0 53 | spriteTessellationDetail: -1 54 | textureType: 0 55 | textureShape: 1 56 | singleChannelComponent: 0 57 | maxTextureSizeSet: 0 58 | compressionQualitySet: 0 59 | textureFormatSet: 0 60 | platformSettings: 61 | - serializedVersion: 2 62 | buildTarget: DefaultTexturePlatform 63 | maxTextureSize: 2048 64 | resizeAlgorithm: 0 65 | textureFormat: -1 66 | textureCompression: 1 67 | compressionQuality: 50 68 | crunchedCompression: 0 69 | allowsAlphaSplitting: 0 70 | overridden: 0 71 | androidETC2FallbackOverride: 0 72 | spriteSheet: 73 | serializedVersion: 2 74 | sprites: [] 75 | outline: [] 76 | physicsShape: [] 77 | bones: [] 78 | spriteID: 79 | vertices: [] 80 | indices: 81 | edges: [] 82 | weights: [] 83 | spritePackingTag: 84 | pSDRemoveMatte: 0 85 | pSDShowRemoveMatteOption: 0 86 | userData: 87 | assetBundleName: 88 | assetBundleVariant: 89 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2018 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /LICENSE.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a39a373393811a74fad395e1eb16f943 3 | DefaultImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Assets2Packages 2 | 3 | ![Image1](https://raw.githubusercontent.com/kakunpc/Assets2Packages/master/Images/Assets2Packages.gif "Assets2Packages") 4 | 5 | Assets にある物を、ディレクトリごとPackagesに移動させる事ができるEditor拡張 6 | 7 | # 使い方 8 | 1. `Packages/manifest.json` を開き、dependenciesの中に `"com.kakunpc.assets2package": "https://github.com/kakunpc/Assets2Packages.git"` を追記します。 9 | 1. Unityを起動します。 10 | 1. メニューの Window -> Assets2Packages を選択します。 11 | 1. 設定項目を入力して、 `Move Start` をクリック 12 | 13 | # 動作環境 14 | - Unity2018.3 15 | - .NET 4.x Equivalent 16 | 17 | # LICENSE 18 | MIT License Copyright (c) 2018 kakunpc Released under the MIT license 19 | 20 | https://github.com/kakunpc/Assets2Packages/blob/master/LICENSE 21 | -------------------------------------------------------------------------------- /README.md.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 539d714809694c14b95381ccd4c18c01 3 | TextScriptImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "category": "Unity", 3 | "description": "", 4 | "displayName": "Assets2Packages", 5 | "keywords": [ 6 | "" 7 | ], 8 | "name": "com.kakunpc.assets2package", 9 | "unity": "2018.3", 10 | "version": "1.0.0" 11 | } -------------------------------------------------------------------------------- /package.json.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 6759d9a6444669d4ab54cc4db9aab9dc 3 | TextScriptImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | --------------------------------------------------------------------------------