-
-
Notifications
You must be signed in to change notification settings - Fork 638
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
# [3.0.0-preview.36](v3.0.0-preview.35...v3.0.0-preview.36) (2020-09-28) ### Bug Fixes * do not bake particle system to mesh when the alpha is zero ([1775713](1775713)), closes [#102](#102) * in Unity 2018.x, sample import failed on Windows ([f5861b0](f5861b0))
- Loading branch information
1 parent
94ae9d2
commit 4b4d70b
Showing
13 changed files
with
92 additions
and
125 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,4 @@ | ||
using System; | ||
using UnityEngine; | ||
using UnityEngine; | ||
|
||
namespace Coffee.UIExtensions | ||
{ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
using System; | ||
using UnityEditor; | ||
using UnityEngine; | ||
using System.Collections.Generic; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
#if !UNITY_2019_1_OR_NEWER | ||
using System.IO; | ||
using System.Linq; | ||
using System.Text.RegularExpressions; | ||
using UnityEditor; | ||
|
||
static class ImportSampleMenu_UIParticle | ||
{ | ||
private const string k_DisplayName = "UI Particle"; | ||
private const string k_JsonGuid = "823dc693d087a4b559c7e1547274cc7d"; | ||
|
||
[MenuItem("Assets/Samples/" + k_DisplayName + "/Import Demo")] | ||
private static void ImportDemo() | ||
{ | ||
ImportSample(k_JsonGuid, "Demo"); | ||
} | ||
|
||
private static void ImportSample(string jsonGuid, string sampleName) | ||
{ | ||
var jsonPath = AssetDatabase.GUIDToAssetPath(jsonGuid); | ||
var packageRoot = Path.GetDirectoryName(jsonPath).Replace('\\', '/'); | ||
var json = File.ReadAllText(jsonPath); | ||
var version = Regex.Match(json, "\"version\"\\s*:\\s*\"([^\"]+)\"").Groups[1].Value; | ||
var src = string.Format("{0}/Samples~/{1}", packageRoot, sampleName); | ||
var dst = string.Format("Assets/Samples/{0}/{1}/{2}", k_DisplayName, version, sampleName); | ||
var previousPath = GetPreviousSamplePath(k_DisplayName, sampleName); | ||
|
||
// Remove the previous sample directory. | ||
if (!string.IsNullOrEmpty(previousPath)) | ||
{ | ||
var msg = "A different version of the sample is already imported at\n\n" | ||
+ previousPath | ||
+ "\n\nIt will be deleted when you update. Are you sure you want to continue?"; | ||
if (!EditorUtility.DisplayDialog("Sample Importer", msg, "OK", "Cancel")) | ||
return; | ||
|
||
FileUtil.DeleteFileOrDirectory(previousPath); | ||
|
||
var metaFile = previousPath + ".meta"; | ||
if (File.Exists(metaFile)) | ||
FileUtil.DeleteFileOrDirectory(metaFile); | ||
} | ||
|
||
if (!Directory.Exists(dst)) | ||
FileUtil.DeleteFileOrDirectory(dst); | ||
|
||
var dstDir = Path.GetDirectoryName(dst); | ||
if (!Directory.Exists(dstDir)) | ||
Directory.CreateDirectory(dstDir); | ||
|
||
if (Directory.Exists(src)) | ||
FileUtil.CopyFileOrDirectory(src, dst); | ||
else | ||
throw new DirectoryNotFoundException(src); | ||
|
||
AssetDatabase.Refresh(ImportAssetOptions.ImportRecursive); | ||
} | ||
|
||
private static string GetPreviousSamplePath(string displayName, string sampleName) | ||
{ | ||
var sampleRoot = string.Format("Assets/Samples/{0}", displayName); | ||
var sampleRootInfo = new DirectoryInfo(sampleRoot); | ||
if (!sampleRootInfo.Exists) return null; | ||
|
||
return sampleRootInfo.GetDirectories() | ||
.Select(versionDir => Path.Combine(versionDir.ToString(), sampleName)) | ||
.FirstOrDefault(Directory.Exists); | ||
} | ||
} | ||
#endif |
File renamed without changes.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters