Compare commits
10 Commits
2842b3db7d
...
bfac4d4e2f
Author | SHA1 | Date |
---|---|---|
|
bfac4d4e2f | |
|
e3791866b7 | |
|
6dfbdae38d | |
|
b63220b871 | |
|
3fd2bea599 | |
|
925af0b604 | |
|
d1a1e23e50 | |
|
47ee45cbbe | |
|
88d956ece8 | |
|
1b0110320b |
|
@ -1,3 +1,11 @@
|
||||||
|
# [5.0.0-preview.14](https://github.com/mob-sakai/ParticleEffectForUGUI/compare/5.0.0-preview.13...5.0.0-preview.14) (2025-01-03)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* sub-emitter particles may not render correctly in certain scenarios ([8276684](https://github.com/mob-sakai/ParticleEffectForUGUI/commit/8276684c3b1646f0490ed64557547ba15281664a)), closes [#348](https://github.com/mob-sakai/ParticleEffectForUGUI/issues/348)
|
||||||
|
* sub-emitter's `inherit velocity` module doubles at runtime ([67de3d1](https://github.com/mob-sakai/ParticleEffectForUGUI/commit/67de3d1bd3e16dc9b564625cb990c53d75769506)), closes [#349](https://github.com/mob-sakai/ParticleEffectForUGUI/issues/349)
|
||||||
|
|
||||||
# [5.0.0-preview.13](https://github.com/mob-sakai/ParticleEffectForUGUI/compare/5.0.0-preview.12...5.0.0-preview.13) (2025-01-03)
|
# [5.0.0-preview.13](https://github.com/mob-sakai/ParticleEffectForUGUI/compare/5.0.0-preview.12...5.0.0-preview.13) (2025-01-03)
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -61,6 +61,7 @@ namespace Coffee.UIExtensions
|
||||||
private SerializedProperty _autoScalingMode;
|
private SerializedProperty _autoScalingMode;
|
||||||
private SerializedProperty _useCustomView;
|
private SerializedProperty _useCustomView;
|
||||||
private SerializedProperty _customViewSize;
|
private SerializedProperty _customViewSize;
|
||||||
|
private SerializedProperty _timeScaleMultiplier;
|
||||||
private ReorderableList _ro;
|
private ReorderableList _ro;
|
||||||
private bool _showMax;
|
private bool _showMax;
|
||||||
private bool _is3DScaleMode;
|
private bool _is3DScaleMode;
|
||||||
|
@ -97,6 +98,7 @@ namespace Coffee.UIExtensions
|
||||||
_autoScalingMode = serializedObject.FindProperty("m_AutoScalingMode");
|
_autoScalingMode = serializedObject.FindProperty("m_AutoScalingMode");
|
||||||
_useCustomView = serializedObject.FindProperty("m_UseCustomView");
|
_useCustomView = serializedObject.FindProperty("m_UseCustomView");
|
||||||
_customViewSize = serializedObject.FindProperty("m_CustomViewSize");
|
_customViewSize = serializedObject.FindProperty("m_CustomViewSize");
|
||||||
|
_timeScaleMultiplier = serializedObject.FindProperty("m_TimeScaleMultiplier");
|
||||||
|
|
||||||
var sp = serializedObject.FindProperty("m_Particles");
|
var sp = serializedObject.FindProperty("m_Particles");
|
||||||
_ro = new ReorderableList(sp.serializedObject, sp, true, true, true, true)
|
_ro = new ReorderableList(sp.serializedObject, sp, true, true, true, true)
|
||||||
|
@ -241,6 +243,9 @@ namespace Coffee.UIExtensions
|
||||||
_customViewSize.floatValue = Mathf.Max(0.1f, _customViewSize.floatValue);
|
_customViewSize.floatValue = Mathf.Max(0.1f, _customViewSize.floatValue);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Time Scale Multiplier
|
||||||
|
EditorGUILayout.PropertyField(_timeScaleMultiplier);
|
||||||
|
|
||||||
// Target ParticleSystems.
|
// Target ParticleSystems.
|
||||||
EditorGUI.BeginChangeCheck();
|
EditorGUI.BeginChangeCheck();
|
||||||
_ro.DoLayoutList();
|
_ro.DoLayoutList();
|
||||||
|
|
|
@ -179,7 +179,7 @@ _This package requires **Unity 2019.3 or later**._
|
||||||
|
|
||||||
`UIParticle` controls the ParticleSystems that are attached to its own game objects and child game objects.
|
`UIParticle` controls the ParticleSystems that are attached to its own game objects and child game objects.
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
- **Maskable**: Does this graphic allow maskable.
|
- **Maskable**: Does this graphic allow maskable.
|
||||||
- **Scale**: Scale the rendering particles. When the `3D` toggle is enabled, 3D scale (x, y, z) is supported.
|
- **Scale**: Scale the rendering particles. When the `3D` toggle is enabled, 3D scale (x, y, z) is supported.
|
||||||
|
@ -201,6 +201,7 @@ _This package requires **Unity 2019.3 or later**._
|
||||||
- **UIParticle:** UIParticle.scale will be adjusted.
|
- **UIParticle:** UIParticle.scale will be adjusted.
|
||||||
- **Use Custom View:** Use this if the particles are not displayed correctly due to min/max particle size.
|
- **Use Custom View:** Use this if the particles are not displayed correctly due to min/max particle size.
|
||||||
- **Custom view size:** Change the bake view size.
|
- **Custom view size:** Change the bake view size.
|
||||||
|
- **Time Scale Multiplier:** Time scale multiplier.
|
||||||
- **Rendering Order**: The ParticleSystem list to be rendered. You can change the order and the materials.
|
- **Rendering Order**: The ParticleSystem list to be rendered. You can change the order and the materials.
|
||||||
|
|
||||||
**NOTE:** Press the `Refresh` button to reconstruct the rendering order based on children ParticleSystem's sorting order
|
**NOTE:** Press the `Refresh` button to reconstruct the rendering order based on children ParticleSystem's sorting order
|
||||||
|
@ -231,7 +232,7 @@ and z-position.
|
||||||
If you want to mask particles, set a stencil-supported shader (such as `UI/UIAdditive`) to the material for
|
If you want to mask particles, set a stencil-supported shader (such as `UI/UIAdditive`) to the material for
|
||||||
ParticleSystem.
|
ParticleSystem.
|
||||||
If you use some custom shaders, see
|
If you use some custom shaders, see
|
||||||
the [How to Make a Custom Shader to Support Mask/RectMask2D Component](#how-to-make-a-custom-shader-to-support-maskrectmask2d-component)
|
the [How to Make a Custom Shader to Support Mask/RectMask2D Component](#how-to-make-a-custom-shader-to-support-mask-and-rectmask2d-component)
|
||||||
section.
|
section.
|
||||||
|
|
||||||

|

|
||||||
|
|
|
@ -204,7 +204,7 @@ namespace Coffee.UIParticleInternal
|
||||||
target.enabled = false;
|
target.enabled = false;
|
||||||
|
|
||||||
// Find MonoScript of the specified component.
|
// Find MonoScript of the specified component.
|
||||||
foreach (var script in Resources.FindObjectsOfTypeAll<MonoScript>())
|
foreach (var script in MonoImporter.GetAllRuntimeMonoScripts())
|
||||||
{
|
{
|
||||||
if (script.GetClass() != typeof(T))
|
if (script.GetClass() != typeof(T))
|
||||||
{
|
{
|
||||||
|
|
|
@ -3,11 +3,16 @@ using System.Diagnostics;
|
||||||
using UnityEditor;
|
using UnityEditor;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
using Object = UnityEngine.Object;
|
using Object = UnityEngine.Object;
|
||||||
#if UNITY_EDITOR && UNITY_2021_2_OR_NEWER
|
#if UNITY_EDITOR
|
||||||
|
using System.IO;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Reflection;
|
||||||
|
#if UNITY_2021_2_OR_NEWER
|
||||||
using UnityEditor.SceneManagement;
|
using UnityEditor.SceneManagement;
|
||||||
#elif UNITY_EDITOR
|
#else
|
||||||
using UnityEditor.Experimental.SceneManagement;
|
using UnityEditor.Experimental.SceneManagement;
|
||||||
#endif
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
namespace Coffee.UIParticleInternal
|
namespace Coffee.UIParticleInternal
|
||||||
{
|
{
|
||||||
|
@ -72,5 +77,56 @@ namespace Coffee.UIParticleInternal
|
||||||
|
|
||||||
public static bool isBatchOrBuilding => Application.isBatchMode || BuildPipeline.isBuildingPlayer;
|
public static bool isBatchOrBuilding => Application.isBatchMode || BuildPipeline.isBuildingPlayer;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
[Conditional("UNITY_EDITOR")]
|
||||||
|
public static void QueuePlayerLoopUpdate()
|
||||||
|
{
|
||||||
|
#if UNITY_EDITOR
|
||||||
|
if (!EditorApplication.isPlaying)
|
||||||
|
{
|
||||||
|
EditorApplication.QueuePlayerLoopUpdate();
|
||||||
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if !UNITY_2021_2_OR_NEWER
|
||||||
|
[AttributeUsage(AttributeTargets.Class)]
|
||||||
|
[Conditional("UNITY_EDITOR")]
|
||||||
|
internal class IconAttribute : Attribute
|
||||||
|
{
|
||||||
|
private readonly string _path;
|
||||||
|
|
||||||
|
public IconAttribute(string path)
|
||||||
|
{
|
||||||
|
_path = path;
|
||||||
|
}
|
||||||
|
|
||||||
|
#if UNITY_EDITOR
|
||||||
|
private static Action<Object, Texture2D> s_SetIconForObject = typeof(EditorGUIUtility)
|
||||||
|
.GetMethod("SetIconForObject", BindingFlags.Static | BindingFlags.NonPublic)
|
||||||
|
.CreateDelegate(typeof(Action<Object, Texture2D>), null) as Action<Object, Texture2D>;
|
||||||
|
|
||||||
|
[InitializeOnLoadMethod]
|
||||||
|
private static void InitializeOnLoadMethod()
|
||||||
|
{
|
||||||
|
if (Misc.isBatchOrBuilding) return;
|
||||||
|
|
||||||
|
var types = TypeCache.GetTypesWithAttribute<IconAttribute>();
|
||||||
|
var scripts = MonoImporter.GetAllRuntimeMonoScripts();
|
||||||
|
foreach (var type in types)
|
||||||
|
{
|
||||||
|
var script = scripts.FirstOrDefault(x => x.GetClass() == type);
|
||||||
|
if (!script) continue;
|
||||||
|
|
||||||
|
var path = type.GetCustomAttribute<IconAttribute>()?._path;
|
||||||
|
var icon = AssetDatabase.LoadAssetAtPath<Texture2D>(path);
|
||||||
|
if (!icon) continue;
|
||||||
|
|
||||||
|
s_SetIconForObject(script, icon);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
|
@ -17,6 +17,7 @@ namespace Coffee.UIExtensions
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Render maskable and sortable particle effect ,without Camera, RenderTexture or Canvas.
|
/// Render maskable and sortable particle effect ,without Camera, RenderTexture or Canvas.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
[Icon("Packages/com.coffee.ui-particle/Icons/UIParticleIcon.png")]
|
||||||
[ExecuteAlways]
|
[ExecuteAlways]
|
||||||
[RequireComponent(typeof(RectTransform))]
|
[RequireComponent(typeof(RectTransform))]
|
||||||
[RequireComponent(typeof(CanvasRenderer))]
|
[RequireComponent(typeof(CanvasRenderer))]
|
||||||
|
@ -119,6 +120,10 @@ namespace Coffee.UIExtensions
|
||||||
"Change the bake view size.")]
|
"Change the bake view size.")]
|
||||||
private float m_CustomViewSize = 10;
|
private float m_CustomViewSize = 10;
|
||||||
|
|
||||||
|
[SerializeField]
|
||||||
|
[Tooltip("Time scale multiplier.")]
|
||||||
|
private float m_TimeScaleMultiplier = 1;
|
||||||
|
|
||||||
[SerializeField]
|
[SerializeField]
|
||||||
private bool m_Maskable = true;
|
private bool m_Maskable = true;
|
||||||
|
|
||||||
|
@ -285,6 +290,15 @@ namespace Coffee.UIExtensions
|
||||||
set => m_CustomViewSize = Mathf.Max(0.1f, value);
|
set => m_CustomViewSize = Mathf.Max(0.1f, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Time scale multiplier.
|
||||||
|
/// </summary>
|
||||||
|
public float timeScaleMultiplier
|
||||||
|
{
|
||||||
|
get => m_TimeScaleMultiplier;
|
||||||
|
set => m_TimeScaleMultiplier = value;
|
||||||
|
}
|
||||||
|
|
||||||
internal bool useMeshSharing => m_MeshSharing != MeshSharing.None;
|
internal bool useMeshSharing => m_MeshSharing != MeshSharing.None;
|
||||||
|
|
||||||
internal bool isPrimary =>
|
internal bool isPrimary =>
|
||||||
|
|
|
@ -5,7 +5,7 @@ MonoImporter:
|
||||||
serializedVersion: 2
|
serializedVersion: 2
|
||||||
defaultReferences: []
|
defaultReferences: []
|
||||||
executionOrder: 0
|
executionOrder: 0
|
||||||
icon: {fileID: 2800000, guid: 5f0675613942149309588d556e33d990, type: 3}
|
icon: {instanceID: 0}
|
||||||
userData:
|
userData:
|
||||||
assetBundleName:
|
assetBundleName:
|
||||||
assetBundleVariant:
|
assetBundleVariant:
|
||||||
|
|
|
@ -5,6 +5,7 @@ using UnityEngine;
|
||||||
|
|
||||||
namespace Coffee.UIExtensions
|
namespace Coffee.UIExtensions
|
||||||
{
|
{
|
||||||
|
[Icon("Packages/com.coffee.ui-particle/Icons/UIParticleIcon.png")]
|
||||||
public class UIParticleProjectSettings : PreloadedProjectSettings<UIParticleProjectSettings>
|
public class UIParticleProjectSettings : PreloadedProjectSettings<UIParticleProjectSettings>
|
||||||
{
|
{
|
||||||
[Header("Setting")]
|
[Header("Setting")]
|
||||||
|
|
|
@ -5,7 +5,7 @@ MonoImporter:
|
||||||
serializedVersion: 2
|
serializedVersion: 2
|
||||||
defaultReferences: []
|
defaultReferences: []
|
||||||
executionOrder: 0
|
executionOrder: 0
|
||||||
icon: {fileID: 2800000, guid: 5f0675613942149309588d556e33d990, type: 3}
|
icon: {instanceID: 0}
|
||||||
userData:
|
userData:
|
||||||
assetBundleName:
|
assetBundleName:
|
||||||
assetBundleVariant:
|
assetBundleVariant:
|
||||||
|
|
|
@ -15,6 +15,7 @@ using UnityEngine.UI;
|
||||||
|
|
||||||
namespace Coffee.UIExtensions
|
namespace Coffee.UIExtensions
|
||||||
{
|
{
|
||||||
|
[Icon("Packages/com.coffee.ui-particle/Icons/UIParticleIcon.png")]
|
||||||
[ExecuteAlways]
|
[ExecuteAlways]
|
||||||
[RequireComponent(typeof(RectTransform))]
|
[RequireComponent(typeof(RectTransform))]
|
||||||
[RequireComponent(typeof(CanvasRenderer))]
|
[RequireComponent(typeof(CanvasRenderer))]
|
||||||
|
@ -628,6 +629,7 @@ namespace Coffee.UIExtensions
|
||||||
: main.useUnscaledTime
|
: main.useUnscaledTime
|
||||||
? Time.unscaledDeltaTime
|
? Time.unscaledDeltaTime
|
||||||
: Time.deltaTime;
|
: Time.deltaTime;
|
||||||
|
deltaTime *= _parent.timeScaleMultiplier;
|
||||||
|
|
||||||
// Pre-warm:
|
// Pre-warm:
|
||||||
if (0 < deltaTime && _preWarm)
|
if (0 < deltaTime && _preWarm)
|
||||||
|
|
|
@ -5,7 +5,7 @@ MonoImporter:
|
||||||
serializedVersion: 2
|
serializedVersion: 2
|
||||||
defaultReferences: []
|
defaultReferences: []
|
||||||
executionOrder: 0
|
executionOrder: 0
|
||||||
icon: {fileID: 2800000, guid: 5f0675613942149309588d556e33d990, type: 3}
|
icon: {instanceID: 0}
|
||||||
userData:
|
userData:
|
||||||
assetBundleName:
|
assetBundleName:
|
||||||
assetBundleVariant:
|
assetBundleVariant:
|
||||||
|
|
|
@ -40,13 +40,26 @@ namespace Coffee.UIExtensions
|
||||||
|
|
||||||
#if UNITY_EDITOR
|
#if UNITY_EDITOR
|
||||||
[InitializeOnLoadMethod]
|
[InitializeOnLoadMethod]
|
||||||
|
private static void InitializeOnLoad()
|
||||||
|
{
|
||||||
|
UIExtraCallbacks.onAfterCanvasRebuild += Refresh;
|
||||||
|
|
||||||
|
EditorApplication.playModeStateChanged += state =>
|
||||||
|
{
|
||||||
|
UIExtraCallbacks.onAfterCanvasRebuild -= Refresh;
|
||||||
|
if (state == PlayModeStateChange.EnteredEditMode || state == PlayModeStateChange.EnteredPlayMode)
|
||||||
|
{
|
||||||
|
UIExtraCallbacks.onAfterCanvasRebuild += Refresh;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
#else
|
#else
|
||||||
[RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.BeforeSceneLoad)]
|
[RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.BeforeSceneLoad)]
|
||||||
#endif
|
|
||||||
private static void InitializeOnLoad()
|
private static void InitializeOnLoad()
|
||||||
{
|
{
|
||||||
UIExtraCallbacks.onAfterCanvasRebuild += Refresh;
|
UIExtraCallbacks.onAfterCanvasRebuild += Refresh;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
private static void Refresh()
|
private static void Refresh()
|
||||||
{
|
{
|
||||||
|
|
|
@ -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": "5.0.0-preview.13",
|
"version": "5.0.0-preview.14",
|
||||||
"unity": "2019.3",
|
"unity": "2019.3",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"repository": {
|
"repository": {
|
||||||
|
|
Loading…
Reference in New Issue