Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 2 additions & 8 deletions AssetStoreTools.sln
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 2013
VisualStudioVersion = 12.0.31101.0
# Visual Studio 14
VisualStudioVersion = 14.0.25123.0
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AssetStoreTools", "AssetStoreTools\AssetStoreTools.csproj", "{2D609DFC-C51E-4172-AF19-2F9022F1C691}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AssetStoreToolsExtra", "AssetStoreToolsExtra\AssetStoreToolsExtra.csproj", "{C0188F1E-2DF8-4205-8AE9-11A934EDAB6F}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand All @@ -17,10 +15,6 @@ Global
{2D609DFC-C51E-4172-AF19-2F9022F1C691}.Debug|Any CPU.Build.0 = Debug|Any CPU
{2D609DFC-C51E-4172-AF19-2F9022F1C691}.Release|Any CPU.ActiveCfg = Release|Any CPU
{2D609DFC-C51E-4172-AF19-2F9022F1C691}.Release|Any CPU.Build.0 = Release|Any CPU
{C0188F1E-2DF8-4205-8AE9-11A934EDAB6F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{C0188F1E-2DF8-4205-8AE9-11A934EDAB6F}.Debug|Any CPU.Build.0 = Debug|Any CPU
{C0188F1E-2DF8-4205-8AE9-11A934EDAB6F}.Release|Any CPU.ActiveCfg = Release|Any CPU
{C0188F1E-2DF8-4205-8AE9-11A934EDAB6F}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
12 changes: 8 additions & 4 deletions AssetStoreTools/AssetBundler3.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,17 @@ public bool CanPreview()

public bool CanGenerateBundles()
{
return PlayerSettings.advancedLicense;
return false; // old code: PlayerSettings.advancedLicense;
}

public bool CreateBundle(UnityEngine.Object asset, string targetPath)
{
return BuildPipeline.BuildAssetBundle(asset, null, targetPath, (BuildAssetBundleOptions)1048576);
}
{
// BuildPipeline.BuildAssetBundle is obsolete and this AssetBundler is just a fallback.
// So we can just say "no".
return false;

// return BuildPipeline.BuildAssetBundle(asset, null, targetPath, (BuildAssetBundleOptions)1048576);
}

public void Preview(string assetpath)
{
Expand Down
File renamed without changes.
27 changes: 2 additions & 25 deletions AssetStoreTools/AssetBundlerFactory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,31 +11,8 @@ public static IAssetBundler GetBundler()
Type type = assembly.GetType("UnityEditorInternal.AssetStoreToolUtils");
if (type != null && type.GetMethod("BuildAssetStoreAssetBundle") != null)
{
DebugUtils.Log("AssentBundler runatime Detection");
IAssetBundler assetBundler = null;
try
{
Assembly assembly2 = Assembly.LoadFrom("Assets\\AssetStoreTools\\Editor\\AssetStoreToolsExtra.dll");
Type[] types = assembly2.GetTypes();
Type[] array = types;
for (int i = 0; i < array.Length; i++)
{
Type type2 = array[i];
DebugUtils.Log(type2.ToString());
}
Type type3 = assembly2.GetType("AssetBundler4");
object obj = Activator.CreateInstance(type3);
assetBundler = (IAssetBundler)obj;
}
catch (Exception ex)
{
DebugUtils.LogError("Error Loading Assembly:" + ex.Message);
}
if (assetBundler == null)
{
DebugUtils.LogError("Error Instantiating bundler");
assetBundler = new AssetBundler3();
}
DebugUtils.Log("AssetBundler runtime Detection");
IAssetBundler assetBundler = new AssetBundler4();
return assetBundler;
}
}
Expand Down
4 changes: 4 additions & 0 deletions AssetStoreTools/AssetStoreTools.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|AnyCPU'">
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core" />
Expand All @@ -37,6 +40,7 @@
</ItemGroup>
<ItemGroup>
<Compile Include="AssetBundler3.cs" />
<Compile Include="AssetBundler4.cs" />
<Compile Include="AssetBundlerFactory.cs" />
<Compile Include="AssetStoreAPI.cs" />
<Compile Include="AssetStoreClient.cs" />
Expand Down
90 changes: 74 additions & 16 deletions AssetStoreTools/FileSelector.cs
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ public void RenderIconText()
{
GUILayout.Height(21f)
});
GUILayout.FlexibleSpace();
//GUILayout.FlexibleSpace();
}
}

Expand Down Expand Up @@ -279,16 +279,37 @@ public void Accept()
return linkedList;
}

void SelectNode(FileNode fileNode)
void SelectNode(FileNode fileNode, bool select = true)
{
if (!fileNode.isDirectory)
if (!fileNode.isDirectory && fileNode.Selected != select)
{
this.m_SelectedFiles.AddLast(fileNode);
fileNode.Selected = true;
if (select)
this.m_SelectedFiles.AddLast(fileNode);
else
this.m_SelectedFiles.Remove(fileNode);

fileNode.Selected = select;
}

foreach (var node in fileNode.Childrens)
{
SelectNode(node);
SelectNode(node, select);
}
}

void ExpandNode(FileNode fileNode, bool expand)
{
if (!(fileNode.isDirectory))
return;

fileNode.Expanded = expand;

foreach (var node in fileNode.Childrens)
{
if (node.isDirectory)
{
ExpandNode(node, expand);
}
}
}

Expand All @@ -297,24 +318,36 @@ private void RenderFileTree()
LinkedList<FileSelector.FileNode> linkedList = new LinkedList<FileSelector.FileNode>();
linkedList.AddFirst(this.m_RootDir);
LinkedList<FileSelector.FileNode> linkedList2 = new LinkedList<FileSelector.FileNode>();
if (GUILayout.Button("Select all"))

GUILayout.BeginHorizontal();
if (GUILayout.Button("Expand all"))
{
this.m_SelectedFiles.Clear();
foreach (var fileNode in linkedList)
{
SelectNode(fileNode);
ExpandNode(fileNode, true);
}
}
while (linkedList.Count > 0)

if (GUILayout.Button("Collapse all"))
{
foreach (var fileNode in linkedList)
{
ExpandNode(fileNode, false);
}
}

GUILayout.EndHorizontal();

while (linkedList.Count > 0)
{
LinkedListNode<FileSelector.FileNode> first = linkedList.First;
linkedList2.Clear();
GUILayout.BeginHorizontal(new GUILayoutOption[0]);
GUILayout.Space((float)(20 * first.Value.Depth));
if (first.Value.isDirectory)
{
GUIStyle style = "IN foldout";
first.Value.Expanded = GUILayout.Toggle(first.Value.Expanded, GUIContent.none, style);
GUIStyle style = "IN foldout";
first.Value.Expanded = GUILayout.Toggle(first.Value.Expanded, GUIContent.none, style);
}
else
{
Expand All @@ -332,8 +365,25 @@ private void RenderFileTree()
first.Value.Selected = flag;
}
}
first.Value.RenderIconText();
GUILayout.EndHorizontal();

first.Value.RenderIconText();

if (first.Value.isDirectory)
{
if (GUILayout.Button("+"))
{
SelectNode(first.Value, true);
}

if (GUILayout.Button("-"))
{
SelectNode(first.Value, false);
}
}

GUILayout.FlexibleSpace();

GUILayout.EndHorizontal();
if (first.Value.Expanded)
{
foreach (FileSelector.FileNode current in first.Value.SubDirectories)
Expand Down Expand Up @@ -362,7 +412,9 @@ private void RenderSelectedFileList()
GUILayout.BeginHorizontal(new GUILayoutOption[0]);
value.Selected = GUILayout.Toggle(value.Selected, GUIContent.none, new GUILayoutOption[0]);
value.RenderIconText();
if (MainAssetsUtil.CanPreview && GUILayout.Button("Preview", new GUILayoutOption[0]))
GUILayout.FlexibleSpace();

if (MainAssetsUtil.CanPreview && GUILayout.Button("Preview", new GUILayoutOption[0]))
{
MainAssetsUtil.Preview(value.Name);
}
Expand All @@ -385,7 +437,13 @@ public void OnGUI()
int num = (int)Math.Floor((double)(base.position.width / 2f));
GUILayout.BeginVertical(new GUILayoutOption[0]);
GUILayout.Label("Main Assets", EditorStyles.boldLabel, new GUILayoutOption[0]);
GUILayout.Label("Please select from the list below the main assets in your package. You should select items that you consider to be the central parts of you package, and that would showcase your package. The Asset Store will generate previews for the selected items. If you are uploading a Character, the Character prefab would be a good candidate for instance", EditorStyles.wordWrappedLabel, new GUILayoutOption[0]);
GUILayout.Label(
@"Please select from the list below the main assets in your package.
You should select items that you consider to be the central parts of your package, and that would showcase your package.
The Asset Store will generate previews for the selected items.
If you are uploading a Character, the Character prefab would be a good candidate for instance",
EditorStyles.wordWrappedLabel, new GUILayoutOption[0]);

GUILayout.BeginHorizontal(new GUILayoutOption[0]);
GUILayout.BeginVertical(new GUILayoutOption[]
{
Expand Down
47 changes: 0 additions & 47 deletions AssetStoreToolsExtra/AssetStoreToolsExtra.csproj

This file was deleted.

8 changes: 0 additions & 8 deletions AssetStoreToolsExtra/Properties/AssemblyInfo.cs

This file was deleted.

2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ An improved version of the offical Unity3D asset store tools.
1. Build project `AssetStoreTools`.
2. Copy built `AssetStoreTools.dll` to `Assets/AssetStoreTools/Editor/` and overwrite the original one.

You may delete the old `AssetStoreToolsExtra.dll`. It is not used anymore.

# Improvement

* Added a __select all__ button to select all files inside the main assets folder.
Expand Down