You've already forked ParticleEffectForUGUI
mirror of
https://github.com/mob-sakai/ParticleEffectForUGUI.git
synced 2026-05-14 20:20:06 +00:00
Compare commits
7 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
25a9cdb400 | ||
|
|
c6b2950a75 | ||
|
|
841e449f78 | ||
|
|
9d04e41cde | ||
|
|
f1e672470c | ||
|
|
9d1b6a81ee | ||
|
|
e32077fb0d |
16
CHANGELOG.md
16
CHANGELOG.md
@@ -1,3 +1,19 @@
|
|||||||
|
## [4.6.2](https://github.com/mob-sakai/ParticleEffectForUGUI/compare/v4.6.1...v4.6.2) (2024-02-01)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* fix compile error in Unity 2021.1 or older ([fcae60b](https://github.com/mob-sakai/ParticleEffectForUGUI/commit/fcae60bf29079bac07463bd3a86f8644151d72ba))
|
||||||
|
* fix demos ([ad20d12](https://github.com/mob-sakai/ParticleEffectForUGUI/commit/ad20d128a2ad033d9f30b98f0a0dab6091f5aa19))
|
||||||
|
* fix warning ([7fd4a8e](https://github.com/mob-sakai/ParticleEffectForUGUI/commit/7fd4a8e343ce587dffa9db5ff186061b3ebb38a6))
|
||||||
|
|
||||||
|
## [4.6.1](https://github.com/mob-sakai/ParticleEffectForUGUI/compare/v4.6.0...v4.6.1) (2024-01-26)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* unintended scaling occurs when `AutoScalingMode=UIParticle` and `ScalingMode=Local` ([1627de1](https://github.com/mob-sakai/ParticleEffectForUGUI/commit/1627de10eb1e742a015603ae9939071665a5bd89)), closes [#292](https://github.com/mob-sakai/ParticleEffectForUGUI/issues/292)
|
||||||
|
|
||||||
# [4.6.0](https://github.com/mob-sakai/ParticleEffectForUGUI/compare/v4.5.2...v4.6.0) (2024-01-26)
|
# [4.6.0](https://github.com/mob-sakai/ParticleEffectForUGUI/compare/v4.5.2...v4.6.0) (2024-01-26)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -19,11 +19,24 @@ When fixing a bug it is fine to submit a pull request right away.
|
|||||||
|
|
||||||
Steps to be performed to submit a pull request:
|
Steps to be performed to submit a pull request:
|
||||||
|
|
||||||
1. Fork the repository and create your branch from `develop`.
|
1. Fork the repository.
|
||||||
2. If you have fixed a bug or added code that should be tested, add tests.
|
2. Clone the repository.
|
||||||
3. Click `Window > Generals > Test Runner` to test
|
3. Checkout `develop` branch.
|
||||||
4. Commit with a massage based on [Angular Commit Message Conventions](https://gist.github.com/stephenparish/9941e89d80e2bc58a153).
|
4. Develop the package.
|
||||||
5. Fill out the description, link any related issues and submit your pull request.
|
5. Test the package with the test runner (`Window > Generals > Test Runner`).
|
||||||
|
6. Commit with a message based
|
||||||
|
on [Angular Commit Message Conventions](https://gist.github.com/stephenparish/9941e89d80e2bc58a153) as follows:
|
||||||
|
|
||||||
|
- `fix:` fix a bug
|
||||||
|
- `feat:` new feature
|
||||||
|
- `docs:` changes only in documentation
|
||||||
|
- `style:` changes only in formatting, white-space, etc
|
||||||
|
- `refactor:` changes only in code structure (extract method, rename variable, move method, etc)
|
||||||
|
- `perf:` changes only in code performance
|
||||||
|
- `test:` add or update tests
|
||||||
|
- `chore:` changes to the build process or auxiliary tools and libraries such as documentation generation
|
||||||
|
|
||||||
|
7. Create a pull request on GitHub. Fill out the description, link any related issues and submit your pull request.
|
||||||
|
|
||||||
#### License
|
#### License
|
||||||
|
|
||||||
|
|||||||
@@ -1,102 +0,0 @@
|
|||||||
#if !UNITY_2019_1_OR_NEWER
|
|
||||||
using System.IO;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text.RegularExpressions;
|
|
||||||
using UnityEditor;
|
|
||||||
|
|
||||||
namespace Coffee.UIExtensions
|
|
||||||
{
|
|
||||||
internal static class ImportSampleMenu_UIParticle
|
|
||||||
{
|
|
||||||
private const string k_DisplayName = "UI Particle";
|
|
||||||
private const string k_JsonGuid = "823dc693d087a4b559c7e1547274cc7d";
|
|
||||||
|
|
||||||
[MenuItem("Assets/Samples/" + k_DisplayName + "/Demo")]
|
|
||||||
private static void ImportSample()
|
|
||||||
{
|
|
||||||
ImportSample(k_JsonGuid, "Demo");
|
|
||||||
}
|
|
||||||
|
|
||||||
[MenuItem("Assets/Samples/" + k_DisplayName + "/Cartoon FX & War FX Demo")]
|
|
||||||
private static void ImportSample_CFX()
|
|
||||||
{
|
|
||||||
ImportSample(k_JsonGuid, "Cartoon FX & War FX Demo");
|
|
||||||
}
|
|
||||||
|
|
||||||
[MenuItem("Assets/Samples/" + k_DisplayName + "/Cartoon FX & War FX Demo")]
|
|
||||||
private static void ImportSample_PerformanceDemo()
|
|
||||||
{
|
|
||||||
ImportSample(k_JsonGuid, "Performance Demo");
|
|
||||||
}
|
|
||||||
|
|
||||||
private static void ImportSample(string jsonGuid, string sampleName)
|
|
||||||
{
|
|
||||||
var jsonPath = AssetDatabase.GUIDToAssetPath(jsonGuid);
|
|
||||||
if (string.IsNullOrEmpty(jsonPath)) return;
|
|
||||||
|
|
||||||
var jsonDir = Path.GetDirectoryName(jsonPath);
|
|
||||||
if (string.IsNullOrEmpty(jsonDir)) return;
|
|
||||||
|
|
||||||
var packageRoot = jsonDir.Replace('\\', '/');
|
|
||||||
var json = File.ReadAllText(jsonPath);
|
|
||||||
var version = Regex.Match(json, "\"version\"\\s*:\\s*\"([^\"]+)\"").Groups[1].Value;
|
|
||||||
var src = $"{packageRoot}/Samples~/{sampleName}";
|
|
||||||
var dst = $"Assets/Samples/{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 (!string.IsNullOrEmpty(dstDir) && !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 = $"Assets/Samples/{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
|
|
||||||
@@ -1,11 +0,0 @@
|
|||||||
fileFormatVersion: 2
|
|
||||||
guid: 07047cbd3c4af489fbd41f4303a26fe2
|
|
||||||
MonoImporter:
|
|
||||||
externalObjects: {}
|
|
||||||
serializedVersion: 2
|
|
||||||
defaultReferences: []
|
|
||||||
executionOrder: 0
|
|
||||||
icon: {instanceID: 0}
|
|
||||||
userData:
|
|
||||||
assetBundleName:
|
|
||||||
assetBundleVariant:
|
|
||||||
@@ -6,10 +6,13 @@ using UnityEditor.UI;
|
|||||||
using UnityEditorInternal;
|
using UnityEditorInternal;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
using UnityEngine.UI;
|
using UnityEngine.UI;
|
||||||
|
using Coffee.UIParticleExtensions;
|
||||||
#if UNITY_2021_2_OR_NEWER
|
#if UNITY_2021_2_OR_NEWER
|
||||||
using UnityEditor.Overlays;
|
using UnityEditor.Overlays;
|
||||||
#else
|
#else
|
||||||
|
using System;
|
||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
|
using Object = UnityEngine.Object;
|
||||||
#endif
|
#endif
|
||||||
#if UNITY_2021_2_OR_NEWER
|
#if UNITY_2021_2_OR_NEWER
|
||||||
using UnityEditor.SceneManagement;
|
using UnityEditor.SceneManagement;
|
||||||
@@ -326,7 +329,9 @@ namespace Coffee.UIExtensions
|
|||||||
|
|
||||||
// UIParticle for trail should be removed.
|
// UIParticle for trail should be removed.
|
||||||
var label = "This UIParticle component should be removed. The UIParticle for trails is no longer needed.";
|
var label = "This UIParticle component should be removed. The UIParticle for trails is no longer needed.";
|
||||||
|
#pragma warning disable CS0612
|
||||||
if (FixButton(current.m_IsTrail, label))
|
if (FixButton(current.m_IsTrail, label))
|
||||||
|
#pragma warning restore CS0612
|
||||||
{
|
{
|
||||||
DestroyUIParticle(current);
|
DestroyUIParticle(current);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -86,7 +86,11 @@ namespace Coffee.UIExtensions
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// The target ParticleSystem to attract.
|
/// The target ParticleSystem to attract.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
#if UNITY_EDITOR
|
||||||
public new ParticleSystem particleSystem
|
public new ParticleSystem particleSystem
|
||||||
|
#else
|
||||||
|
public ParticleSystem particleSystem
|
||||||
|
#endif
|
||||||
{
|
{
|
||||||
get => m_ParticleSystem;
|
get => m_ParticleSystem;
|
||||||
set
|
set
|
||||||
|
|||||||
@@ -515,6 +515,13 @@ namespace Coffee.UIExtensions
|
|||||||
{
|
{
|
||||||
Profiler.BeginSample("[UIParticleRenderer] GetWorldScale");
|
Profiler.BeginSample("[UIParticleRenderer] GetWorldScale");
|
||||||
var scale = _parent.scale3DForCalc.GetScaled(_parent.parentScale);
|
var scale = _parent.scale3DForCalc.GetScaled(_parent.parentScale);
|
||||||
|
|
||||||
|
if (_parent.autoScalingMode == UIParticle.AutoScalingMode.UIParticle
|
||||||
|
&& _particleSystem.main.scalingMode == ParticleSystemScalingMode.Local)
|
||||||
|
{
|
||||||
|
scale = scale.GetScaled(_parent.canvas.transform.localScale);
|
||||||
|
}
|
||||||
|
|
||||||
Profiler.EndSample();
|
Profiler.EndSample();
|
||||||
return scale;
|
return scale;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -287,7 +287,7 @@ namespace Coffee.UIParticleExtensions
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#if !UNITY_2021_2_OR_NEWER || UNITY_2020_3_45 || UNITY_2020_3_46 || UNITY_2020_3_47 || UNITY_2020_3_48
|
#if !UNITY_2021_2_OR_NEWER && !UNITY_2020_3_45 && !UNITY_2020_3_46 && !UNITY_2020_3_47 && !UNITY_2020_3_48
|
||||||
public static T GetComponentInParent<T>(this Component self, bool includeInactive) where T : Component
|
public static T GetComponentInParent<T>(this Component self, bool includeInactive) where T : Component
|
||||||
{
|
{
|
||||||
if (!self) return null;
|
if (!self) return null;
|
||||||
|
|||||||
@@ -155,26 +155,23 @@ namespace Coffee.UIExtensions.Demo
|
|||||||
{
|
{
|
||||||
if (!flag) return;
|
if (!flag) return;
|
||||||
|
|
||||||
var canvas = FindObjectOfType<Canvas>();
|
m_RootCanvas.renderMode = RenderMode.ScreenSpaceCamera;
|
||||||
canvas.renderMode = RenderMode.ScreenSpaceCamera;
|
m_RootCanvas.renderMode = RenderMode.WorldSpace;
|
||||||
canvas.renderMode = RenderMode.WorldSpace;
|
m_RootCanvas.transform.rotation = Quaternion.Euler(new Vector3(0, 10, 0));
|
||||||
canvas.transform.rotation = Quaternion.Euler(new Vector3(0, 10, 0));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Canvas_CameraSpace(bool flag)
|
public void Canvas_CameraSpace(bool flag)
|
||||||
{
|
{
|
||||||
if (!flag) return;
|
if (!flag) return;
|
||||||
|
|
||||||
var canvas = FindObjectOfType<Canvas>();
|
m_RootCanvas.renderMode = RenderMode.ScreenSpaceCamera;
|
||||||
canvas.renderMode = RenderMode.ScreenSpaceCamera;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Canvas_Overlay(bool flag)
|
public void Canvas_Overlay(bool flag)
|
||||||
{
|
{
|
||||||
if (!flag) return;
|
if (!flag) return;
|
||||||
|
|
||||||
var canvas = FindObjectOfType<Canvas>();
|
m_RootCanvas.renderMode = RenderMode.ScreenSpaceOverlay;
|
||||||
canvas.renderMode = RenderMode.ScreenSpaceOverlay;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -2,7 +2,7 @@
|
|||||||
"name": "com.coffee.ui-particle",
|
"name": "com.coffee.ui-particle",
|
||||||
"displayName": "UI Particle",
|
"displayName": "UI Particle",
|
||||||
"description": "This package provides a component to render particle effects for uGUI.\nThe particle rendering is maskable and sortable, without the need for an extra Camera, RenderTexture, or Canvas.",
|
"description": "This package provides a component to render particle effects for uGUI.\nThe particle rendering is maskable and sortable, without the need for an extra Camera, RenderTexture, or Canvas.",
|
||||||
"version": "4.6.0",
|
"version": "4.6.2",
|
||||||
"unity": "2018.2",
|
"unity": "2018.2",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"repository": {
|
"repository": {
|
||||||
|
|||||||
Reference in New Issue
Block a user