You've already forked ParticleEffectForUGUI
mirror of
https://github.com/mob-sakai/ParticleEffectForUGUI.git
synced 2026-05-15 12:40:08 +00:00
Compare commits
6 Commits
v5.0.0-pre
...
develop-ne
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
09ccb0d47c | ||
|
|
819de92b20 | ||
|
|
1628290db7 | ||
|
|
d33bde10d2 | ||
|
|
29e30a3f1b | ||
|
|
ae838587cb |
18
.github/workflows/release.yml
vendored
18
.github/workflows/release.yml
vendored
@@ -1,12 +1,12 @@
|
|||||||
name: 🔖 Release
|
name: 🔖 Release
|
||||||
run-name: 🔖 Release (${{ github.ref_name }})
|
|
||||||
|
|
||||||
on:
|
on:
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- release
|
- release
|
||||||
- release-*
|
- release-preview
|
||||||
|
- release-v4
|
||||||
tags-ignore:
|
tags-ignore:
|
||||||
- "**"
|
- "**"
|
||||||
|
|
||||||
@@ -50,12 +50,14 @@ jobs:
|
|||||||
if [ '${{ steps.release.outputs.new_release_published }}' = 'false' ]; then
|
if [ '${{ steps.release.outputs.new_release_published }}' = 'false' ]; then
|
||||||
echo "No new release published." | tee -a $GITHUB_STEP_SUMMARY
|
echo "No new release published." | tee -a $GITHUB_STEP_SUMMARY
|
||||||
elif [ '${{ github.ref_name }}' = 'release' ]; then
|
elif [ '${{ github.ref_name }}' = 'release' ]; then
|
||||||
echo "merge_to=develop" | tee -a $GITHUB_OUTPUT $GITHUB_STEP_SUMMARY
|
echo "merge_to=develop" | tee -a $GITHUB_OUTPUT
|
||||||
echo "split_to=main" | tee -a $GITHUB_OUTPUT $GITHUB_STEP_SUMMARY
|
echo "split_to=main" | tee -a $GITHUB_OUTPUT
|
||||||
else
|
elif [ '${{ github.ref_name }}' = 'release-preview' ]; then
|
||||||
channel=$(echo ${{ github.ref_name }} | sed 's/^release-//')
|
echo "merge_to=develop-preview" | tee -a $GITHUB_OUTPUT
|
||||||
echo "merge_to=develop-${channel}" | tee -a $GITHUB_OUTPUT $GITHUB_STEP_SUMMARY
|
echo "split_to=preview" | tee -a $GITHUB_OUTPUT
|
||||||
echo "split_to=${channel}" | tee -a $GITHUB_OUTPUT $GITHUB_STEP_SUMMARY
|
elif [ '${{ github.ref_name }}' = 'release-4.x' ]; then
|
||||||
|
echo "merge_to=develop-4.x" | tee -a $GITHUB_OUTPUT
|
||||||
|
echo "split_to=4.x" | tee -a $GITHUB_OUTPUT
|
||||||
fi
|
fi
|
||||||
|
|
||||||
merge-to:
|
merge-to:
|
||||||
|
|||||||
3
.github/workflows/test.yml
vendored
3
.github/workflows/test.yml
vendored
@@ -3,13 +3,12 @@
|
|||||||
# UNITY_EMAIL: Unity user email to login
|
# UNITY_EMAIL: Unity user email to login
|
||||||
# UNITY_PASSWORD: Unity user password to login
|
# UNITY_PASSWORD: Unity user password to login
|
||||||
name: 🧪 Test
|
name: 🧪 Test
|
||||||
run-name: 🧪 Test (${{ github.ref_name }})
|
|
||||||
|
|
||||||
env:
|
env:
|
||||||
# MINIMUM_VERSION: The minimum version of Unity.
|
# MINIMUM_VERSION: The minimum version of Unity.
|
||||||
MINIMUM_VERSION: 2019.4
|
MINIMUM_VERSION: 2019.4
|
||||||
# EXCLUDE_FILTER: The excluded versions of Unity.
|
# EXCLUDE_FILTER: The excluded versions of Unity.
|
||||||
EXCLUDE_FILTER: '(2020.2.0|2021.1|2023.3)'
|
EXCLUDE_FILTER: '(2020.2.0)'
|
||||||
|
|
||||||
on:
|
on:
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
|||||||
@@ -80,11 +80,7 @@ namespace Coffee.UIExtensions.Demo
|
|||||||
.SelectMany(x => x.GetTypes())
|
.SelectMany(x => x.GetTypes())
|
||||||
.FirstOrDefault(x => x.Name == typeName);
|
.FirstOrDefault(x => x.Name == typeName);
|
||||||
|
|
||||||
#if UNITY_2023_2_OR_NEWER
|
|
||||||
return type == null ? null : FindFirstObjectByType(type);
|
|
||||||
#else
|
|
||||||
return type == null ? null : FindObjectOfType(type);
|
return type == null ? null : FindObjectOfType(type);
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void SetCanvasWidth(int width)
|
public void SetCanvasWidth(int width)
|
||||||
|
|||||||
@@ -12,5 +12,4 @@ MonoBehaviour:
|
|||||||
m_Script: {fileID: 11500000, guid: f22a23b9d98e440478697f4adf30e61c, type: 3}
|
m_Script: {fileID: 11500000, guid: f22a23b9d98e440478697f4adf30e61c, type: 3}
|
||||||
m_Name: UIParticle
|
m_Name: UIParticle
|
||||||
m_EditorClassIdentifier:
|
m_EditorClassIdentifier:
|
||||||
m_EnableLinearToGamma: 1
|
m_LinearToGamma: 1
|
||||||
m_HideGeneratedObjects: 1
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
fileFormatVersion: 2
|
fileFormatVersion: 2
|
||||||
guid: 4b9df7b8a4193489299b8f477348ae0c
|
guid: e8e7744b163af4869b07b8f192c810ed
|
||||||
NativeFormatImporter:
|
NativeFormatImporter:
|
||||||
externalObjects: {}
|
externalObjects: {}
|
||||||
mainObjectFileID: 11400000
|
mainObjectFileID: 11400000
|
||||||
|
|||||||
@@ -1,8 +1,9 @@
|
|||||||
{
|
{
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
"com.unity.ide.rider": "3.0.31",
|
||||||
"com.coffee.development": "https://github.com/mob-sakai/Coffee.Internal.git?path=Packages/Development",
|
"com.coffee.development": "https://github.com/mob-sakai/Coffee.Internal.git?path=Packages/Development",
|
||||||
"com.coffee.nano-monitor": "https://github.com/mob-sakai/Coffee.Internal.git?path=Packages/NanoMonitor",
|
"com.coffee.nano-monitor": "https://github.com/mob-sakai/Coffee.Internal.git?path=Packages/NanoMonitor",
|
||||||
"com.unity.ide.rider": "3.0.31",
|
"com.coffee.sub-asset-editor": "https://github.com/mob-sakai/SubAssetEditor.git",
|
||||||
"com.unity.test-framework": "1.1.33",
|
"com.unity.test-framework": "1.1.33",
|
||||||
"com.unity.modules.animation": "1.0.0",
|
"com.unity.modules.animation": "1.0.0",
|
||||||
"com.unity.modules.physics": "1.0.0"
|
"com.unity.modules.physics": "1.0.0"
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
"depth": 0,
|
"depth": 0,
|
||||||
"source": "git",
|
"source": "git",
|
||||||
"dependencies": {},
|
"dependencies": {},
|
||||||
"hash": "4e5f735ccf956ee469b5014ae781068c49a2825d"
|
"hash": "c51e4514c9ab944915a639433ee52342e55a644e"
|
||||||
},
|
},
|
||||||
"com.coffee.nano-monitor": {
|
"com.coffee.nano-monitor": {
|
||||||
"version": "https://github.com/mob-sakai/Coffee.Internal.git?path=Packages/NanoMonitor",
|
"version": "https://github.com/mob-sakai/Coffee.Internal.git?path=Packages/NanoMonitor",
|
||||||
@@ -14,7 +14,14 @@
|
|||||||
"dependencies": {
|
"dependencies": {
|
||||||
"com.unity.ugui": "1.0.0"
|
"com.unity.ugui": "1.0.0"
|
||||||
},
|
},
|
||||||
"hash": "4e5f735ccf956ee469b5014ae781068c49a2825d"
|
"hash": "c51e4514c9ab944915a639433ee52342e55a644e"
|
||||||
|
},
|
||||||
|
"com.coffee.sub-asset-editor": {
|
||||||
|
"version": "https://github.com/mob-sakai/SubAssetEditor.git",
|
||||||
|
"depth": 0,
|
||||||
|
"source": "git",
|
||||||
|
"dependencies": {},
|
||||||
|
"hash": "01464178eec1e4dbe741c11c9baeb94a151c99ee"
|
||||||
},
|
},
|
||||||
"com.coffee.ui-particle": {
|
"com.coffee.ui-particle": {
|
||||||
"version": "file:src",
|
"version": "file:src",
|
||||||
|
|||||||
@@ -1,42 +1,3 @@
|
|||||||
# [5.0.0-preview.11](https://github.com/mob-sakai/ParticleEffectForUGUI/compare/v5.0.0-preview.10...v5.0.0-preview.11) (2024-09-29)
|
|
||||||
|
|
||||||
|
|
||||||
### Features
|
|
||||||
|
|
||||||
* change the default value of `UIParticle.scale` from `10` to `1` ([4e188dd](https://github.com/mob-sakai/ParticleEffectForUGUI/commit/4e188dd39ee32dd1339066a6946e43ba3580c324))
|
|
||||||
* UIParticle no longer inherits from MaskableGraphic ([52eb28c](https://github.com/mob-sakai/ParticleEffectForUGUI/commit/52eb28cdafe7c9009d5a4b76978e002798440e8d))
|
|
||||||
|
|
||||||
|
|
||||||
### BREAKING CHANGES
|
|
||||||
|
|
||||||
* Some members inherited from MaskableGraphic will no longer be available.
|
|
||||||
|
|
||||||
## [4.10.1](https://github.com/mob-sakai/ParticleEffectForUGUI/compare/v4.10.0...v4.10.1) (2024-09-29)
|
|
||||||
|
|
||||||
|
|
||||||
### Bug Fixes
|
|
||||||
|
|
||||||
* mainTex will be ignored ([2ee69d0](https://github.com/mob-sakai/ParticleEffectForUGUI/commit/2ee69d04245fabce185f67dc9bd68c870e556564))
|
|
||||||
|
|
||||||
# [4.10.0](https://github.com/mob-sakai/ParticleEffectForUGUI/compare/v4.9.1...v4.10.0) (2024-09-29)
|
|
||||||
|
|
||||||
|
|
||||||
### Bug Fixes
|
|
||||||
|
|
||||||
* component icon is not set ([5ff6ec8](https://github.com/mob-sakai/ParticleEffectForUGUI/commit/5ff6ec815a174de5d3f16d424f1204c60912a8d8))
|
|
||||||
|
|
||||||
|
|
||||||
### Features
|
|
||||||
|
|
||||||
* add project settings ([1ce4e31](https://github.com/mob-sakai/ParticleEffectForUGUI/commit/1ce4e31a9681bf1a201d2723c8d97e07ecc16592))
|
|
||||||
|
|
||||||
## [4.9.1](https://github.com/mob-sakai/ParticleEffectForUGUI/compare/v4.9.0...v4.9.1) (2024-08-07)
|
|
||||||
|
|
||||||
|
|
||||||
### Bug Fixes
|
|
||||||
|
|
||||||
* ParticleSystem trails gain offset on parent canvas change ([2a1cd50](https://github.com/mob-sakai/ParticleEffectForUGUI/commit/2a1cd502b452b5b56edf8bcfe91adf99d1bb5147)), closes [#323](https://github.com/mob-sakai/ParticleEffectForUGUI/issues/323)
|
|
||||||
|
|
||||||
# [4.9.0](https://github.com/mob-sakai/ParticleEffectForUGUI/compare/v4.8.1...v4.9.0) (2024-07-18)
|
# [4.9.0](https://github.com/mob-sakai/ParticleEffectForUGUI/compare/v4.8.1...v4.9.0) (2024-07-18)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -6,14 +6,16 @@ using UnityEditorInternal;
|
|||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
using UnityEngine.Profiling;
|
using UnityEngine.Profiling;
|
||||||
using UnityEngine.UI;
|
using UnityEngine.UI;
|
||||||
using Coffee.UIParticleInternal;
|
|
||||||
#if UNITY_2021_2_OR_NEWER
|
#if UNITY_2021_2_OR_NEWER
|
||||||
using UnityEditor.Overlays;
|
using UnityEditor.Overlays;
|
||||||
#else
|
#else
|
||||||
using System;
|
using System;
|
||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
|
using Coffee.UIParticleInternal;
|
||||||
using Object = UnityEngine.Object;
|
using Object = UnityEngine.Object;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if UNITY_2021_2_OR_NEWER
|
#if UNITY_2021_2_OR_NEWER
|
||||||
using UnityEditor.SceneManagement;
|
using UnityEditor.SceneManagement;
|
||||||
|
|
||||||
@@ -434,11 +436,7 @@ namespace Coffee.UIExtensions
|
|||||||
{
|
{
|
||||||
if (!p || (ignoreCurrent && target == p)) return;
|
if (!p || (ignoreCurrent && target == p)) return;
|
||||||
|
|
||||||
Misc.DestroyImmediate(p);
|
DestroyImmediate(p);
|
||||||
if (p.TryGetComponent<CanvasRenderer>(out var cr))
|
|
||||||
{
|
|
||||||
Misc.DestroyImmediate(cr);
|
|
||||||
}
|
|
||||||
|
|
||||||
#if UNITY_2018_3_OR_NEWER
|
#if UNITY_2018_3_OR_NEWER
|
||||||
var stage = PrefabStageUtility.GetCurrentPrefabStage();
|
var stage = PrefabStageUtility.GetCurrentPrefabStage();
|
||||||
|
|||||||
@@ -36,7 +36,6 @@ You can render, mask, and sort your `ParticleSystems` for UI without the need fo
|
|||||||
- [Usage with `Mask` or `RectMask2D` Component](#usage-with-mask-or-rectmask2d-component)
|
- [Usage with `Mask` or `RectMask2D` Component](#usage-with-mask-or-rectmask2d-component)
|
||||||
- [Usage with Script](#usage-with-script)
|
- [Usage with Script](#usage-with-script)
|
||||||
- [Component: UIParticleAttractor](#component-uiparticleattractor)
|
- [Component: UIParticleAttractor](#component-uiparticleattractor)
|
||||||
- [Project Settings](#project-settings)
|
|
||||||
- [🛠 Development Note](#-development-note)
|
- [🛠 Development Note](#-development-note)
|
||||||
- [Compares the Baking mesh approach with the conventional approach](#compares-the-baking-mesh-approach-with-the-conventional-approach)
|
- [Compares the Baking mesh approach with the conventional approach](#compares-the-baking-mesh-approach-with-the-conventional-approach)
|
||||||
- [Performance test results](#performance-test-results)
|
- [Performance test results](#performance-test-results)
|
||||||
@@ -270,14 +269,6 @@ uiParticle.Stop();
|
|||||||
|
|
||||||
<br><br>
|
<br><br>
|
||||||
|
|
||||||
### Project Settings
|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||
- Click `Edit > Project Settings` to open the Project Settings window and then select `UI > UI Particle` category.
|
|
||||||
|
|
||||||
<br><br>
|
|
||||||
|
|
||||||
## 🛠 Development Note
|
## 🛠 Development Note
|
||||||
|
|
||||||
### Compares the Baking mesh approach with the conventional approach
|
### Compares the Baking mesh approach with the conventional approach
|
||||||
|
|||||||
19
Packages/src/Runtime/Internal/Extensions/ListExtensions.cs
Normal file
19
Packages/src/Runtime/Internal/Extensions/ListExtensions.cs
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
using System.Collections.Generic;
|
||||||
|
|
||||||
|
namespace Coffee.UIParticleInternal
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Extension methods for Component class.
|
||||||
|
/// </summary>
|
||||||
|
internal static class ListExtensions
|
||||||
|
{
|
||||||
|
public static void RemoveAtFast<T>(this List<T> self, int index)
|
||||||
|
{
|
||||||
|
if (self == null) return;
|
||||||
|
|
||||||
|
var lastIndex = self.Count - 1;
|
||||||
|
self[index] = self[lastIndex];
|
||||||
|
self.RemoveAt(lastIndex);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 833553390099d40c9b212823f0852c46
|
||||||
|
MonoImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
@@ -34,9 +34,9 @@ namespace Coffee.UIParticleInternal
|
|||||||
var defaultSettings = GetDefaultSettings(t);
|
var defaultSettings = GetDefaultSettings(t);
|
||||||
if (!defaultSettings)
|
if (!defaultSettings)
|
||||||
{
|
{
|
||||||
// When create a new instance, automatically set it as default settings.
|
|
||||||
defaultSettings = t.GetProperty("instance", flags)
|
defaultSettings = t.GetProperty("instance", flags)
|
||||||
?.GetValue(null, null) as PreloadedProjectSettings;
|
?.GetValue(null, null) as PreloadedProjectSettings;
|
||||||
|
SetDefaultSettings(defaultSettings);
|
||||||
}
|
}
|
||||||
else if (GetPreloadedSettings(t).Length != 1)
|
else if (GetPreloadedSettings(t).Length != 1)
|
||||||
{
|
{
|
||||||
@@ -73,7 +73,6 @@ namespace Coffee.UIParticleInternal
|
|||||||
|
|
||||||
protected static void SetDefaultSettings(PreloadedProjectSettings asset)
|
protected static void SetDefaultSettings(PreloadedProjectSettings asset)
|
||||||
{
|
{
|
||||||
if (!asset) return;
|
|
||||||
var type = asset.GetType();
|
var type = asset.GetType();
|
||||||
if (string.IsNullOrEmpty(AssetDatabase.GetAssetPath(asset)))
|
if (string.IsNullOrEmpty(AssetDatabase.GetAssetPath(asset)))
|
||||||
{
|
{
|
||||||
@@ -104,6 +103,7 @@ namespace Coffee.UIParticleInternal
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
public abstract class PreloadedProjectSettings<T> : PreloadedProjectSettings
|
public abstract class PreloadedProjectSettings<T> : PreloadedProjectSettings
|
||||||
where T : PreloadedProjectSettings<T>
|
where T : PreloadedProjectSettings<T>
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -46,6 +46,7 @@ namespace Coffee.UIParticleInternal
|
|||||||
GetFrameCache<T>().Set((key1.GetHashCode(), key2.GetHashCode()), result);
|
GetFrameCache<T>().Set((key1.GetHashCode(), key2.GetHashCode()), result);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Sets a value in the frame cache with a specified key.
|
/// Sets a value in the frame cache with a specified key.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ using Object = UnityEngine.Object;
|
|||||||
#if ENABLE_COFFEE_LOGGER
|
#if ENABLE_COFFEE_LOGGER
|
||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
|
||||||
#else
|
#else
|
||||||
using Conditional = System.Diagnostics.ConditionalAttribute;
|
using Conditional = System.Diagnostics.ConditionalAttribute;
|
||||||
#endif
|
#endif
|
||||||
@@ -42,6 +43,7 @@ namespace Coffee.UIParticleInternal
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#if !ENABLE_COFFEE_LOGGER
|
#if !ENABLE_COFFEE_LOGGER
|
||||||
[Conditional(k_DisableSymbol)]
|
[Conditional(k_DisableSymbol)]
|
||||||
#endif
|
#endif
|
||||||
@@ -51,6 +53,7 @@ namespace Coffee.UIParticleInternal
|
|||||||
Log_Internal(LogType.Log, tag, message, context ? context : tag as Object);
|
Log_Internal(LogType.Log, tag, message, context ? context : tag as Object);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#if !ENABLE_COFFEE_LOGGER
|
#if !ENABLE_COFFEE_LOGGER
|
||||||
[Conditional(k_DisableSymbol)]
|
[Conditional(k_DisableSymbol)]
|
||||||
#endif
|
#endif
|
||||||
@@ -59,6 +62,7 @@ namespace Coffee.UIParticleInternal
|
|||||||
Log_Internal(LogType.Log, tag, message, context ? context : tag as Object);
|
Log_Internal(LogType.Log, tag, message, context ? context : tag as Object);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#if !ENABLE_COFFEE_LOGGER
|
#if !ENABLE_COFFEE_LOGGER
|
||||||
[Conditional(k_DisableSymbol)]
|
[Conditional(k_DisableSymbol)]
|
||||||
#endif
|
#endif
|
||||||
@@ -76,6 +80,7 @@ namespace Coffee.UIParticleInternal
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#if !ENABLE_COFFEE_LOGGER
|
#if !ENABLE_COFFEE_LOGGER
|
||||||
[Conditional(k_DisableSymbol)]
|
[Conditional(k_DisableSymbol)]
|
||||||
#endif
|
#endif
|
||||||
@@ -119,6 +124,7 @@ namespace Coffee.UIParticleInternal
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#if !ENABLE_COFFEE_LOGGER
|
#if !ENABLE_COFFEE_LOGGER
|
||||||
[Conditional(k_DisableSymbol)]
|
[Conditional(k_DisableSymbol)]
|
||||||
#endif
|
#endif
|
||||||
@@ -164,6 +170,7 @@ namespace Coffee.UIParticleInternal
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#if !ENABLE_COFFEE_LOGGER
|
#if !ENABLE_COFFEE_LOGGER
|
||||||
[Conditional(k_DisableSymbol)]
|
[Conditional(k_DisableSymbol)]
|
||||||
#endif
|
#endif
|
||||||
@@ -202,6 +209,7 @@ namespace Coffee.UIParticleInternal
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#if !ENABLE_COFFEE_LOGGER
|
#if !ENABLE_COFFEE_LOGGER
|
||||||
[Conditional(k_DisableSymbol)]
|
[Conditional(k_DisableSymbol)]
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -55,6 +55,7 @@ namespace Coffee.UIParticleInternal
|
|||||||
Profiler.EndSample();
|
Profiler.EndSample();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Adds or retrieves a cached material based on the hash.
|
/// Adds or retrieves a cached material based on the hash.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
@@ -763,7 +763,7 @@ namespace Coffee.UIExtensions
|
|||||||
_bakeCamera.useOcclusionCulling = false;
|
_bakeCamera.useOcclusionCulling = false;
|
||||||
|
|
||||||
_bakeCamera.gameObject.SetActive(false);
|
_bakeCamera.gameObject.SetActive(false);
|
||||||
_bakeCamera.gameObject.hideFlags = UIParticleProjectSettings.globalHideFlags;
|
_bakeCamera.gameObject.hideFlags = HideFlags.HideAndDontSave;
|
||||||
|
|
||||||
return _bakeCamera;
|
return _bakeCamera;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -148,7 +148,7 @@ namespace Coffee.UIExtensions
|
|||||||
// Collect UIParticle if needed (same size as m_ParticleSystems)
|
// Collect UIParticle if needed (same size as m_ParticleSystems)
|
||||||
CollectUIParticlesIfNeeded();
|
CollectUIParticlesIfNeeded();
|
||||||
|
|
||||||
for (var particleIndex = 0; particleIndex < m_ParticleSystems.Count; particleIndex++)
|
for (var particleIndex = 0; particleIndex < this.m_ParticleSystems.Count; particleIndex++)
|
||||||
{
|
{
|
||||||
var particleSystem = m_ParticleSystems[particleIndex];
|
var particleSystem = m_ParticleSystems[particleIndex];
|
||||||
|
|
||||||
@@ -163,21 +163,21 @@ namespace Coffee.UIExtensions
|
|||||||
particleSystem.GetParticles(particles, count);
|
particleSystem.GetParticles(particles, count);
|
||||||
|
|
||||||
var uiParticle = _uiParticles[particleIndex];
|
var uiParticle = _uiParticles[particleIndex];
|
||||||
var dstPos = GetDestinationPosition(uiParticle, particleSystem);
|
var dstPos = this.GetDestinationPosition(uiParticle, particleSystem);
|
||||||
for (var i = 0; i < count; i++)
|
for (var i = 0; i < count; i++)
|
||||||
{
|
{
|
||||||
// Attracted
|
// Attracted
|
||||||
var p = particles[i];
|
var p = particles[i];
|
||||||
if (0f < p.remainingLifetime && Vector3.Distance(p.position, dstPos) < m_DestinationRadius)
|
if (0f < p.remainingLifetime && Vector3.Distance(p.position, dstPos) < this.m_DestinationRadius)
|
||||||
{
|
{
|
||||||
p.remainingLifetime = 0f;
|
p.remainingLifetime = 0f;
|
||||||
particles[i] = p;
|
particles[i] = p;
|
||||||
|
|
||||||
if (m_OnAttracted != null)
|
if (this.m_OnAttracted != null)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
m_OnAttracted.Invoke();
|
this.m_OnAttracted.Invoke();
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
@@ -189,7 +189,7 @@ namespace Coffee.UIExtensions
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Calc attracting time
|
// Calc attracting time
|
||||||
var delayTime = p.startLifetime * m_DelayRate;
|
var delayTime = p.startLifetime * this.m_DelayRate;
|
||||||
var duration = p.startLifetime - delayTime;
|
var duration = p.startLifetime - delayTime;
|
||||||
var time = Mathf.Max(0, p.startLifetime - p.remainingLifetime - delayTime);
|
var time = Mathf.Max(0, p.startLifetime - p.remainingLifetime - delayTime);
|
||||||
|
|
||||||
@@ -197,7 +197,7 @@ namespace Coffee.UIExtensions
|
|||||||
if (time <= 0) continue;
|
if (time <= 0) continue;
|
||||||
|
|
||||||
// Attract
|
// Attract
|
||||||
p.position = GetAttractedPosition(p.position, dstPos, duration, time);
|
p.position = this.GetAttractedPosition(p.position, dstPos, duration, time);
|
||||||
p.velocity *= 0.5f;
|
p.velocity *= 0.5f;
|
||||||
particles[i] = p;
|
particles[i] = p;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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:
|
||||||
|
|||||||
@@ -17,18 +17,6 @@ namespace Coffee.UIExtensions
|
|||||||
set => instance.m_EnableLinearToGamma = value;
|
set => instance.m_EnableLinearToGamma = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
[Header("Editor")]
|
|
||||||
[Tooltip("Hide the automatically generated objects.\n" +
|
|
||||||
" - UIParticleRenderer\n" +
|
|
||||||
" - UIParticle BakingCamera")]
|
|
||||||
[SerializeField]
|
|
||||||
private bool m_HideGeneratedObjects = true;
|
|
||||||
|
|
||||||
public static HideFlags globalHideFlags => instance.m_HideGeneratedObjects
|
|
||||||
? HideFlags.DontSave | HideFlags.NotEditable | HideFlags.HideInHierarchy | HideFlags.HideInInspector
|
|
||||||
: HideFlags.DontSave | HideFlags.NotEditable;
|
|
||||||
|
|
||||||
#if UNITY_EDITOR
|
#if UNITY_EDITOR
|
||||||
[SettingsProvider]
|
[SettingsProvider]
|
||||||
private static SettingsProvider CreateSettingsProvider()
|
private static SettingsProvider CreateSettingsProvider()
|
||||||
|
|||||||
@@ -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:
|
||||||
|
|||||||
@@ -4,6 +4,7 @@
|
|||||||
#elif UNITY_2022_3_OR_NEWER
|
#elif UNITY_2022_3_OR_NEWER
|
||||||
#define PS_BAKE_API_V2
|
#define PS_BAKE_API_V2
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using Coffee.UIParticleInternal;
|
using Coffee.UIParticleInternal;
|
||||||
@@ -136,7 +137,6 @@ namespace Coffee.UIExtensions
|
|||||||
{
|
{
|
||||||
base.OnEnable();
|
base.OnEnable();
|
||||||
|
|
||||||
hideFlags = UIParticleProjectSettings.globalHideFlags;
|
|
||||||
if (!s_CombineInstances[0].mesh)
|
if (!s_CombineInstances[0].mesh)
|
||||||
{
|
{
|
||||||
s_CombineInstances[0].mesh = new Mesh
|
s_CombineInstances[0].mesh = new Mesh
|
||||||
@@ -161,7 +161,7 @@ namespace Coffee.UIExtensions
|
|||||||
// Create renderer object.
|
// Create renderer object.
|
||||||
var go = new GameObject("[generated] UIParticleRenderer", typeof(UIParticleRenderer))
|
var go = new GameObject("[generated] UIParticleRenderer", typeof(UIParticleRenderer))
|
||||||
{
|
{
|
||||||
hideFlags = UIParticleProjectSettings.globalHideFlags,
|
hideFlags = HideFlags.HideAndDontSave,
|
||||||
layer = parent.gameObject.layer
|
layer = parent.gameObject.layer
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -201,6 +201,7 @@ namespace Coffee.UIExtensions
|
|||||||
return modifiedMaterial;
|
return modifiedMaterial;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//
|
||||||
var hash = new Hash128(
|
var hash = new Hash128(
|
||||||
modifiedMaterial ? (uint)modifiedMaterial.GetInstanceID() : 0,
|
modifiedMaterial ? (uint)modifiedMaterial.GetInstanceID() : 0,
|
||||||
texture ? (uint)texture.GetInstanceID() : 0,
|
texture ? (uint)texture.GetInstanceID() : 0,
|
||||||
@@ -423,12 +424,13 @@ namespace Coffee.UIExtensions
|
|||||||
|
|
||||||
var components = ListPool<Component>.Rent();
|
var components = ListPool<Component>.Rent();
|
||||||
GetComponents(typeof(IMeshModifier), components);
|
GetComponents(typeof(IMeshModifier), components);
|
||||||
|
|
||||||
|
#pragma warning disable CS0618 // Type or member is obsolete
|
||||||
for (var i = 0; i < components.Count; i++)
|
for (var i = 0; i < components.Count; i++)
|
||||||
{
|
{
|
||||||
#pragma warning disable CS0618 // Type or member is obsolete
|
|
||||||
((IMeshModifier)components[i]).ModifyMesh(workerMesh);
|
((IMeshModifier)components[i]).ModifyMesh(workerMesh);
|
||||||
#pragma warning restore CS0618 // Type or member is obsolete
|
|
||||||
}
|
}
|
||||||
|
#pragma warning restore CS0618 // Type or member is obsolete
|
||||||
|
|
||||||
ListPool<Component>.Return(ref components);
|
ListPool<Component>.Return(ref components);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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,10 +40,7 @@
|
|||||||
Lighting Off
|
Lighting Off
|
||||||
ZWrite Off
|
ZWrite Off
|
||||||
ZTest [unity_GUIZTestMode]
|
ZTest [unity_GUIZTestMode]
|
||||||
Fog
|
Fog { Mode Off }
|
||||||
{
|
|
||||||
Mode Off
|
|
||||||
}
|
|
||||||
Blend One One
|
Blend One One
|
||||||
|
|
||||||
ColorMask [_ColorMask]
|
ColorMask [_ColorMask]
|
||||||
@@ -64,18 +61,18 @@
|
|||||||
|
|
||||||
struct appdata_t
|
struct appdata_t
|
||||||
{
|
{
|
||||||
float4 vertex : POSITION;
|
float4 vertex : POSITION;
|
||||||
float4 color : COLOR;
|
float4 color : COLOR;
|
||||||
float2 texcoord : TEXCOORD0;
|
float2 texcoord : TEXCOORD0;
|
||||||
UNITY_VERTEX_INPUT_INSTANCE_ID
|
UNITY_VERTEX_INPUT_INSTANCE_ID
|
||||||
};
|
};
|
||||||
|
|
||||||
struct v2f
|
struct v2f
|
||||||
{
|
{
|
||||||
float4 vertex : SV_POSITION;
|
float4 vertex : SV_POSITION;
|
||||||
fixed4 color : COLOR;
|
fixed4 color : COLOR;
|
||||||
float2 texcoord : TEXCOORD0;
|
float2 texcoord : TEXCOORD0;
|
||||||
float4 worldPosition : TEXCOORD1;
|
float4 worldPosition : TEXCOORD1;
|
||||||
UNITY_VERTEX_OUTPUT_STEREO
|
UNITY_VERTEX_OUTPUT_STEREO
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -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.11",
|
"version": "4.9.0",
|
||||||
"unity": "2018.2",
|
"unity": "2018.2",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"repository": {
|
"repository": {
|
||||||
|
|||||||
@@ -124,7 +124,7 @@ PlayerSettings:
|
|||||||
bundleVersion: 1.0
|
bundleVersion: 1.0
|
||||||
preloadedAssets:
|
preloadedAssets:
|
||||||
- {fileID: 11400000, guid: 86087a0847f384b538391745dad4565c, type: 2}
|
- {fileID: 11400000, guid: 86087a0847f384b538391745dad4565c, type: 2}
|
||||||
- {fileID: 11400000, guid: 4b9df7b8a4193489299b8f477348ae0c, type: 2}
|
- {fileID: 11400000, guid: e8e7744b163af4869b07b8f192c810ed, type: 2}
|
||||||
metroInputSource: 0
|
metroInputSource: 0
|
||||||
wsaTransparentSwapchain: 0
|
wsaTransparentSwapchain: 0
|
||||||
m_HolographicPauseOnTrackingLoss: 1
|
m_HolographicPauseOnTrackingLoss: 1
|
||||||
|
|||||||
Reference in New Issue
Block a user