release v1.1.0
commit
79922a80cf
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
@ -1,43 +1,52 @@
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
using UnityEngine.UI;
|
using UnityEngine.UI;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
|
||||||
namespace Coffee.UIExtensions.Demo
|
namespace Coffee.UIExtensions.Demo
|
||||||
{
|
{
|
||||||
public class UIParticle_Demo : MonoBehaviour
|
public class UIParticle_Demo : MonoBehaviour
|
||||||
{
|
{
|
||||||
[SerializeField] Sprite m_Sprite;
|
[SerializeField] Sprite m_Sprite;
|
||||||
[SerializeField] ParticleSystem[] m_ParticleSystems;
|
[SerializeField] ParticleSystem [] m_ParticleSystems;
|
||||||
[SerializeField] Mask[] m_Masks;
|
[SerializeField] Mask [] m_Masks;
|
||||||
|
[SerializeField] List<Transform> m_ScalingByTransforms;
|
||||||
public void SetTimeScale(float scale)
|
[SerializeField] List<UIParticle> m_ScalingByUIParticles;
|
||||||
|
|
||||||
|
public void SetTimeScale (float scale)
|
||||||
{
|
{
|
||||||
Time.timeScale = scale;
|
Time.timeScale = scale;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void EnableTrailRibbon(bool ribbonMode)
|
public void EnableTrailRibbon (bool ribbonMode)
|
||||||
{
|
{
|
||||||
foreach(var p in m_ParticleSystems)
|
foreach (var p in m_ParticleSystems)
|
||||||
{
|
{
|
||||||
var trails = p.trails;
|
var trails = p.trails;
|
||||||
trails.mode = ribbonMode ? ParticleSystemTrailMode.Ribbon : ParticleSystemTrailMode.PerParticle;
|
trails.mode = ribbonMode ? ParticleSystemTrailMode.Ribbon : ParticleSystemTrailMode.PerParticle;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void EnableSprite(bool enabled)
|
public void EnableSprite (bool enabled)
|
||||||
{
|
{
|
||||||
foreach(var p in m_ParticleSystems)
|
foreach (var p in m_ParticleSystems)
|
||||||
{
|
{
|
||||||
var tex = p.textureSheetAnimation;
|
var tex = p.textureSheetAnimation;
|
||||||
tex.enabled = enabled;
|
tex.enabled = enabled;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void EnableMask(bool enabled)
|
public void EnableMask (bool enabled)
|
||||||
{
|
{
|
||||||
foreach(var m in m_Masks)
|
foreach (var m in m_Masks)
|
||||||
{
|
{
|
||||||
m.enabled = enabled;
|
m.enabled = enabled;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void SetScale (float scale)
|
||||||
|
{
|
||||||
|
m_ScalingByTransforms.ForEach (x => x.localScale = Vector3.one * (10 * scale));
|
||||||
|
m_ScalingByUIParticles.ForEach (x => x.scale = scale);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
@ -1,5 +1,5 @@
|
||||||
fileFormatVersion: 2
|
fileFormatVersion: 2
|
||||||
guid: 293537681b71040d0a9b03e13c0e4a20
|
guid: 5d682dd3e44264ff69bd02590123ea73
|
||||||
NativeFormatImporter:
|
NativeFormatImporter:
|
||||||
externalObjects: {}
|
externalObjects: {}
|
||||||
mainObjectFileID: 100100000
|
mainObjectFileID: 100100000
|
|
@ -0,0 +1,101 @@
|
||||||
|
%YAML 1.1
|
||||||
|
%TAG !u! tag:unity3d.com,2011:
|
||||||
|
--- !u!21 &2100000
|
||||||
|
Material:
|
||||||
|
serializedVersion: 6
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInternal: {fileID: 0}
|
||||||
|
m_Name: UIParticle_Demo_Embers
|
||||||
|
m_Shader: {fileID: 10720, guid: 0000000000000000f000000000000000, type: 0}
|
||||||
|
m_ShaderKeywords: _ALPHABLEND_ON
|
||||||
|
m_LightmapFlags: 0
|
||||||
|
m_EnableInstancingVariants: 0
|
||||||
|
m_DoubleSidedGI: 0
|
||||||
|
m_CustomRenderQueue: -1
|
||||||
|
stringTagMap: {}
|
||||||
|
disabledShaderPasses: []
|
||||||
|
m_SavedProperties:
|
||||||
|
serializedVersion: 3
|
||||||
|
m_TexEnvs:
|
||||||
|
- _BumpMap:
|
||||||
|
m_Texture: {fileID: 0}
|
||||||
|
m_Scale: {x: 1, y: 1}
|
||||||
|
m_Offset: {x: 0, y: 0}
|
||||||
|
- _DetailAlbedoMap:
|
||||||
|
m_Texture: {fileID: 0}
|
||||||
|
m_Scale: {x: 1, y: 1}
|
||||||
|
m_Offset: {x: 0, y: 0}
|
||||||
|
- _DetailMask:
|
||||||
|
m_Texture: {fileID: 0}
|
||||||
|
m_Scale: {x: 1, y: 1}
|
||||||
|
m_Offset: {x: 0, y: 0}
|
||||||
|
- _DetailNormalMap:
|
||||||
|
m_Texture: {fileID: 0}
|
||||||
|
m_Scale: {x: 1, y: 1}
|
||||||
|
m_Offset: {x: 0, y: 0}
|
||||||
|
- _EmissionMap:
|
||||||
|
m_Texture: {fileID: 0}
|
||||||
|
m_Scale: {x: 1, y: 1}
|
||||||
|
m_Offset: {x: 0, y: 0}
|
||||||
|
- _MainTex:
|
||||||
|
m_Texture: {fileID: 10300, guid: 0000000000000000f000000000000000, type: 0}
|
||||||
|
m_Scale: {x: 1, y: 1}
|
||||||
|
m_Offset: {x: 0, y: 0}
|
||||||
|
- _MetallicGlossMap:
|
||||||
|
m_Texture: {fileID: 0}
|
||||||
|
m_Scale: {x: 1, y: 1}
|
||||||
|
m_Offset: {x: 0, y: 0}
|
||||||
|
- _Normal:
|
||||||
|
m_Texture: {fileID: 0}
|
||||||
|
m_Scale: {x: 1, y: 1}
|
||||||
|
m_Offset: {x: 0, y: 0}
|
||||||
|
- _OcclusionMap:
|
||||||
|
m_Texture: {fileID: 0}
|
||||||
|
m_Scale: {x: 1, y: 1}
|
||||||
|
m_Offset: {x: 0, y: 0}
|
||||||
|
- _ParallaxMap:
|
||||||
|
m_Texture: {fileID: 0}
|
||||||
|
m_Scale: {x: 1, y: 1}
|
||||||
|
m_Offset: {x: 0, y: 0}
|
||||||
|
m_Floats:
|
||||||
|
- _BlendOp: 0
|
||||||
|
- _BumpScale: 1
|
||||||
|
- _CameraFadingEnabled: 0
|
||||||
|
- _CameraFarFadeDistance: 2
|
||||||
|
- _CameraNearFadeDistance: 1
|
||||||
|
- _ColorMode: 0
|
||||||
|
- _Cull: 2
|
||||||
|
- _Cutoff: 0.5
|
||||||
|
- _DetailNormalMapScale: 1
|
||||||
|
- _DistortionBlend: 0.5
|
||||||
|
- _DistortionEnabled: 0
|
||||||
|
- _DistortionStrength: 1
|
||||||
|
- _DistortionStrengthScaled: 0
|
||||||
|
- _DstBlend: 1
|
||||||
|
- _EmissionEnabled: 0
|
||||||
|
- _FlipbookMode: 0
|
||||||
|
- _GlossMapScale: 1
|
||||||
|
- _Glossiness: 0.5
|
||||||
|
- _GlossyReflections: 1
|
||||||
|
- _InvFade: 3
|
||||||
|
- _LightingEnabled: 0
|
||||||
|
- _Metallic: 0
|
||||||
|
- _Mode: 4
|
||||||
|
- _OcclusionStrength: 1
|
||||||
|
- _Parallax: 0.02
|
||||||
|
- _SmoothnessTextureChannel: 0
|
||||||
|
- _SoftParticlesEnabled: 0
|
||||||
|
- _SoftParticlesFarFadeDistance: 1
|
||||||
|
- _SoftParticlesNearFadeDistance: 0
|
||||||
|
- _SpecularHighlights: 1
|
||||||
|
- _SrcBlend: 5
|
||||||
|
- _UVSec: 0
|
||||||
|
- _ZWrite: 0
|
||||||
|
m_Colors:
|
||||||
|
- _CameraFadeParams: {r: 0, g: Infinity, b: 0, a: 0}
|
||||||
|
- _Color: {r: 2.828427, g: 2.828427, b: 2.828427, a: 1}
|
||||||
|
- _ColorAddSubDiff: {r: 0, g: 0, b: 0, a: 0}
|
||||||
|
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
|
||||||
|
- _SoftParticleFadeParams: {r: 0, g: 0, b: 0, a: 0}
|
||||||
|
- _TintColor: {r: 1, g: 1, b: 1, a: 1}
|
|
@ -0,0 +1,8 @@
|
||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 776677ab3818fb249adaca05f4e04545
|
||||||
|
NativeFormatImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
mainObjectFileID: 0
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
|
@ -0,0 +1,98 @@
|
||||||
|
%YAML 1.1
|
||||||
|
%TAG !u! tag:unity3d.com,2011:
|
||||||
|
--- !u!21 &2100000
|
||||||
|
Material:
|
||||||
|
serializedVersion: 6
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInternal: {fileID: 0}
|
||||||
|
m_Name: UIParticle_Demo_FireExplosion
|
||||||
|
m_Shader: {fileID: 10721, guid: 0000000000000000f000000000000000, type: 0}
|
||||||
|
m_ShaderKeywords: _ALPHABLEND_ON _EMISSION _FADING_ON _REQUIRE_UV2
|
||||||
|
m_LightmapFlags: 0
|
||||||
|
m_EnableInstancingVariants: 0
|
||||||
|
m_DoubleSidedGI: 0
|
||||||
|
m_CustomRenderQueue: -1
|
||||||
|
stringTagMap: {}
|
||||||
|
disabledShaderPasses: []
|
||||||
|
m_SavedProperties:
|
||||||
|
serializedVersion: 3
|
||||||
|
m_TexEnvs:
|
||||||
|
- _BumpMap:
|
||||||
|
m_Texture: {fileID: 0}
|
||||||
|
m_Scale: {x: 1, y: 1}
|
||||||
|
m_Offset: {x: 0, y: 0}
|
||||||
|
- _DetailAlbedoMap:
|
||||||
|
m_Texture: {fileID: 0}
|
||||||
|
m_Scale: {x: 1, y: 1}
|
||||||
|
m_Offset: {x: 0, y: 0}
|
||||||
|
- _DetailMask:
|
||||||
|
m_Texture: {fileID: 0}
|
||||||
|
m_Scale: {x: 1, y: 1}
|
||||||
|
m_Offset: {x: 0, y: 0}
|
||||||
|
- _DetailNormalMap:
|
||||||
|
m_Texture: {fileID: 0}
|
||||||
|
m_Scale: {x: 1, y: 1}
|
||||||
|
m_Offset: {x: 0, y: 0}
|
||||||
|
- _EmissionMap:
|
||||||
|
m_Texture: {fileID: 2800000, guid: 59459fa5f4874d34c8a955afad00260b, type: 3}
|
||||||
|
m_Scale: {x: 1, y: 1}
|
||||||
|
m_Offset: {x: 0, y: 0}
|
||||||
|
- _MainTex:
|
||||||
|
m_Texture: {fileID: 2800000, guid: 59459fa5f4874d34c8a955afad00260b, type: 3}
|
||||||
|
m_Scale: {x: 1, y: 1}
|
||||||
|
m_Offset: {x: 0, y: 0}
|
||||||
|
- _MetallicGlossMap:
|
||||||
|
m_Texture: {fileID: 0}
|
||||||
|
m_Scale: {x: 1, y: 1}
|
||||||
|
m_Offset: {x: 0, y: 0}
|
||||||
|
- _OcclusionMap:
|
||||||
|
m_Texture: {fileID: 0}
|
||||||
|
m_Scale: {x: 1, y: 1}
|
||||||
|
m_Offset: {x: 0, y: 0}
|
||||||
|
- _ParallaxMap:
|
||||||
|
m_Texture: {fileID: 0}
|
||||||
|
m_Scale: {x: 1, y: 1}
|
||||||
|
m_Offset: {x: 0, y: 0}
|
||||||
|
m_Floats:
|
||||||
|
- _BlendOp: 0
|
||||||
|
- _BumpScale: 1
|
||||||
|
- _CameraFadingEnabled: 0
|
||||||
|
- _CameraFarFadeDistance: 2
|
||||||
|
- _CameraNearFadeDistance: 1
|
||||||
|
- _ColorMode: 0
|
||||||
|
- _Cull: 2
|
||||||
|
- _Cutoff: 0.5
|
||||||
|
- _DetailNormalMapScale: 1
|
||||||
|
- _DistortionBlend: 0.5
|
||||||
|
- _DistortionEnabled: 0
|
||||||
|
- _DistortionStrength: 1
|
||||||
|
- _DistortionStrengthScaled: 0
|
||||||
|
- _DstBlend: 10
|
||||||
|
- _EmissionEnabled: 1
|
||||||
|
- _FlipbookMode: 1
|
||||||
|
- _GlossMapScale: 1
|
||||||
|
- _Glossiness: 0.5
|
||||||
|
- _GlossyReflections: 1
|
||||||
|
- _InvFade: 1
|
||||||
|
- _LightingEnabled: 0
|
||||||
|
- _Metallic: 0
|
||||||
|
- _Mode: 2
|
||||||
|
- _OcclusionStrength: 1
|
||||||
|
- _Parallax: 0.02
|
||||||
|
- _SmoothnessTextureChannel: 0
|
||||||
|
- _SoftParticlesEnabled: 1
|
||||||
|
- _SoftParticlesFarFadeDistance: 4
|
||||||
|
- _SoftParticlesNearFadeDistance: 0
|
||||||
|
- _SpecularHighlights: 1
|
||||||
|
- _SrcBlend: 5
|
||||||
|
- _UVSec: 0
|
||||||
|
- _ZWrite: 0
|
||||||
|
m_Colors:
|
||||||
|
- _CameraFadeParams: {r: 0, g: Infinity, b: 0, a: 0}
|
||||||
|
- _Color: {r: 1.4980392, g: 1.4980392, b: 1.4980392, a: 1}
|
||||||
|
- _ColorAddSubDiff: {r: -1, g: 1, b: 0, a: 0}
|
||||||
|
- _EmisColor: {r: 0.2, g: 0.2, b: 0.2, a: 0}
|
||||||
|
- _EmissionColor: {r: 2.9960785, g: 0.972549, b: 0.36078432, a: 1}
|
||||||
|
- _SoftParticleFadeParams: {r: 0, g: 0.25, b: 0, a: 0}
|
||||||
|
- _TintColor: {r: 0.5, g: 0.5, b: 0.5, a: 0.5}
|
|
@ -0,0 +1,8 @@
|
||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 7a306caa8f9f7ed40a5361ce411cdf1b
|
||||||
|
NativeFormatImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
mainObjectFileID: 2100000
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
Binary file not shown.
|
@ -0,0 +1,88 @@
|
||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 59459fa5f4874d34c8a955afad00260b
|
||||||
|
TextureImporter:
|
||||||
|
fileIDToRecycleName: {}
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 7
|
||||||
|
mipmaps:
|
||||||
|
mipMapMode: 0
|
||||||
|
enableMipMap: 1
|
||||||
|
sRGBTexture: 1
|
||||||
|
linearTexture: 0
|
||||||
|
fadeOut: 0
|
||||||
|
borderMipMap: 0
|
||||||
|
mipMapsPreserveCoverage: 0
|
||||||
|
alphaTestReferenceValue: 0.5
|
||||||
|
mipMapFadeDistanceStart: 1
|
||||||
|
mipMapFadeDistanceEnd: 3
|
||||||
|
bumpmap:
|
||||||
|
convertToNormalMap: 0
|
||||||
|
externalNormalMap: 0
|
||||||
|
heightScale: 0.25
|
||||||
|
normalMapFilter: 0
|
||||||
|
isReadable: 0
|
||||||
|
streamingMipmaps: 0
|
||||||
|
streamingMipmapsPriority: 0
|
||||||
|
grayScaleToAlpha: 0
|
||||||
|
generateCubemap: 6
|
||||||
|
cubemapConvolution: 0
|
||||||
|
seamlessCubemap: 0
|
||||||
|
textureFormat: 1
|
||||||
|
maxTextureSize: 2048
|
||||||
|
textureSettings:
|
||||||
|
serializedVersion: 2
|
||||||
|
filterMode: -1
|
||||||
|
aniso: -1
|
||||||
|
mipBias: -100
|
||||||
|
wrapU: -1
|
||||||
|
wrapV: -1
|
||||||
|
wrapW: -1
|
||||||
|
nPOTScale: 1
|
||||||
|
lightmap: 0
|
||||||
|
compressionQuality: 50
|
||||||
|
spriteMode: 0
|
||||||
|
spriteExtrude: 1
|
||||||
|
spriteMeshType: 1
|
||||||
|
alignment: 0
|
||||||
|
spritePivot: {x: 0.5, y: 0.5}
|
||||||
|
spritePixelsToUnits: 100
|
||||||
|
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
|
||||||
|
spriteGenerateFallbackPhysicsShape: 1
|
||||||
|
alphaUsage: 1
|
||||||
|
alphaIsTransparency: 0
|
||||||
|
spriteTessellationDetail: -1
|
||||||
|
textureType: 0
|
||||||
|
textureShape: 1
|
||||||
|
singleChannelComponent: 0
|
||||||
|
maxTextureSizeSet: 0
|
||||||
|
compressionQualitySet: 0
|
||||||
|
textureFormatSet: 0
|
||||||
|
platformSettings:
|
||||||
|
- serializedVersion: 2
|
||||||
|
buildTarget: DefaultTexturePlatform
|
||||||
|
maxTextureSize: 2048
|
||||||
|
resizeAlgorithm: 0
|
||||||
|
textureFormat: -1
|
||||||
|
textureCompression: 1
|
||||||
|
compressionQuality: 50
|
||||||
|
crunchedCompression: 0
|
||||||
|
allowsAlphaSplitting: 0
|
||||||
|
overridden: 0
|
||||||
|
androidETC2FallbackOverride: 0
|
||||||
|
spriteSheet:
|
||||||
|
serializedVersion: 2
|
||||||
|
sprites: []
|
||||||
|
outline: []
|
||||||
|
physicsShape: []
|
||||||
|
bones: []
|
||||||
|
spriteID:
|
||||||
|
vertices: []
|
||||||
|
indices:
|
||||||
|
edges: []
|
||||||
|
weights: []
|
||||||
|
spritePackingTag:
|
||||||
|
pSDRemoveMatte: 0
|
||||||
|
pSDShowRemoveMatteOption: 0
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
File diff suppressed because it is too large
Load Diff
|
@ -1,5 +1,5 @@
|
||||||
fileFormatVersion: 2
|
fileFormatVersion: 2
|
||||||
guid: 77533a9d6813e4163a176c4206b0aba2
|
guid: 93be31a30fbb04a19ab014d2b7c8489e
|
||||||
NativeFormatImporter:
|
NativeFormatImporter:
|
||||||
externalObjects: {}
|
externalObjects: {}
|
||||||
mainObjectFileID: 100100000
|
mainObjectFileID: 100100000
|
|
@ -1,19 +1,21 @@
|
||||||
using UnityEditor;
|
using UnityEditor;
|
||||||
using UnityEditor.UI;
|
using UnityEditor.UI;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
|
||||||
namespace Coffee.UIExtensions
|
namespace Coffee.UIExtensions
|
||||||
{
|
{
|
||||||
[CustomEditor(typeof(UIParticle))]
|
[CustomEditor (typeof (UIParticle))]
|
||||||
[CanEditMultipleObjects]
|
[CanEditMultipleObjects]
|
||||||
public class UIParticleEditor : GraphicEditor
|
public class UIParticleEditor : GraphicEditor
|
||||||
{
|
{
|
||||||
//################################
|
//################################
|
||||||
// Constant or Static Members.
|
// Constant or Static Members.
|
||||||
//################################
|
//################################
|
||||||
static readonly GUIContent contentParticleMaterial = new GUIContent("Particle Material", "The material for rendering particles");
|
static readonly GUIContent contentParticleMaterial = new GUIContent ("Particle Material", "The material for rendering particles");
|
||||||
static readonly GUIContent contentTrailMaterial = new GUIContent("Trail Material", "The material for rendering particle trails");
|
static readonly GUIContent contentTrailMaterial = new GUIContent ("Trail Material", "The material for rendering particle trails");
|
||||||
|
static readonly List<ParticleSystem> s_ParticleSystems = new List<ParticleSystem> ();
|
||||||
|
|
||||||
//################################
|
//################################
|
||||||
// Public/Protected Members.
|
// Public/Protected Members.
|
||||||
|
@ -21,44 +23,72 @@ namespace Coffee.UIExtensions
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// This function is called when the object becomes enabled and active.
|
/// This function is called when the object becomes enabled and active.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
protected override void OnEnable()
|
protected override void OnEnable ()
|
||||||
{
|
{
|
||||||
base.OnEnable();
|
base.OnEnable ();
|
||||||
_spParticleSystem = serializedObject.FindProperty("m_ParticleSystem");
|
_spParticleSystem = serializedObject.FindProperty ("m_ParticleSystem");
|
||||||
_spTrailParticle = serializedObject.FindProperty("m_TrailParticle");
|
_spTrailParticle = serializedObject.FindProperty ("m_TrailParticle");
|
||||||
|
_spScale = serializedObject.FindProperty ("m_Scale");
|
||||||
|
_spIgnoreParent = serializedObject.FindProperty ("m_IgnoreParent");
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Implement this function to make a custom inspector.
|
/// Implement this function to make a custom inspector.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public override void OnInspectorGUI()
|
public override void OnInspectorGUI ()
|
||||||
{
|
{
|
||||||
serializedObject.Update();
|
serializedObject.Update ();
|
||||||
|
|
||||||
EditorGUILayout.PropertyField(_spParticleSystem);
|
EditorGUILayout.PropertyField (_spParticleSystem);
|
||||||
EditorGUI.indentLevel++;
|
EditorGUI.indentLevel++;
|
||||||
var ps = _spParticleSystem.objectReferenceValue as ParticleSystem;
|
var ps = _spParticleSystem.objectReferenceValue as ParticleSystem;
|
||||||
if (ps)
|
if (ps)
|
||||||
{
|
{
|
||||||
var pr = ps.GetComponent<ParticleSystemRenderer>();
|
var pr = ps.GetComponent<ParticleSystemRenderer> ();
|
||||||
var sp = new SerializedObject(pr).FindProperty("m_Materials");
|
var sp = new SerializedObject (pr).FindProperty ("m_Materials");
|
||||||
|
|
||||||
EditorGUILayout.PropertyField(sp.GetArrayElementAtIndex(0), contentParticleMaterial);
|
EditorGUILayout.PropertyField (sp.GetArrayElementAtIndex (0), contentParticleMaterial);
|
||||||
EditorGUILayout.PropertyField(sp.GetArrayElementAtIndex(1), contentTrailMaterial);
|
EditorGUILayout.PropertyField (sp.GetArrayElementAtIndex (1), contentTrailMaterial);
|
||||||
sp.serializedObject.ApplyModifiedProperties();
|
sp.serializedObject.ApplyModifiedProperties ();
|
||||||
|
|
||||||
if(!Application.isPlaying && pr.enabled)
|
if (!Application.isPlaying && pr.enabled)
|
||||||
{
|
{
|
||||||
EditorGUILayout.HelpBox("ParticleSystemRenderer will be disable on playing.", MessageType.Info);
|
EditorGUILayout.HelpBox ("ParticleSystemRenderer will be disable on playing.", MessageType.Info);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
EditorGUI.indentLevel--;
|
EditorGUI.indentLevel--;
|
||||||
|
|
||||||
EditorGUI.BeginDisabledGroup(true);
|
EditorGUI.BeginDisabledGroup (true);
|
||||||
EditorGUILayout.PropertyField(_spTrailParticle);
|
EditorGUILayout.PropertyField (_spTrailParticle);
|
||||||
EditorGUI.EndDisabledGroup();
|
EditorGUI.EndDisabledGroup ();
|
||||||
|
|
||||||
serializedObject.ApplyModifiedProperties();
|
var current = target as UIParticle;
|
||||||
|
|
||||||
|
EditorGUILayout.PropertyField (_spIgnoreParent);
|
||||||
|
|
||||||
|
EditorGUI.BeginDisabledGroup (!current.isRoot);
|
||||||
|
EditorGUILayout.PropertyField (_spScale);
|
||||||
|
EditorGUI.EndDisabledGroup ();
|
||||||
|
|
||||||
|
current.GetComponentsInChildren<ParticleSystem> (true, s_ParticleSystems);
|
||||||
|
if (s_ParticleSystems.Any (x => x.GetComponent<UIParticle> () == null))
|
||||||
|
{
|
||||||
|
GUILayout.BeginHorizontal ();
|
||||||
|
EditorGUILayout.HelpBox ("There are child ParticleSystems that does not have a UIParticle component.\nAdd UIParticle component to them.", MessageType.Warning);
|
||||||
|
GUILayout.BeginVertical ();
|
||||||
|
if (GUILayout.Button ("Fix"))
|
||||||
|
{
|
||||||
|
foreach (var p in s_ParticleSystems.Where (x => !x.GetComponent<UIParticle> ()))
|
||||||
|
{
|
||||||
|
p.gameObject.AddComponent<UIParticle> ();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
GUILayout.EndVertical ();
|
||||||
|
GUILayout.EndHorizontal ();
|
||||||
|
}
|
||||||
|
s_ParticleSystems.Clear ();
|
||||||
|
|
||||||
|
serializedObject.ApplyModifiedProperties ();
|
||||||
}
|
}
|
||||||
|
|
||||||
//################################
|
//################################
|
||||||
|
@ -66,5 +96,7 @@ namespace Coffee.UIExtensions
|
||||||
//################################
|
//################################
|
||||||
SerializedProperty _spParticleSystem;
|
SerializedProperty _spParticleSystem;
|
||||||
SerializedProperty _spTrailParticle;
|
SerializedProperty _spTrailParticle;
|
||||||
|
SerializedProperty _spScale;
|
||||||
|
SerializedProperty _spIgnoreParent;
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -16,18 +16,24 @@ namespace Coffee.UIExtensions
|
||||||
//################################
|
//################################
|
||||||
// Constant or Readonly Static Members.
|
// Constant or Readonly Static Members.
|
||||||
//################################
|
//################################
|
||||||
static readonly int s_IdMainTex = Shader.PropertyToID("_MainTex");
|
static readonly int s_IdMainTex = Shader.PropertyToID ("_MainTex");
|
||||||
static readonly List<Vector3> s_Vertices = new List<Vector3>();
|
static readonly List<Vector3> s_Vertices = new List<Vector3> ();
|
||||||
|
static readonly List<UIParticle> s_TempRelatables = new List<UIParticle> ();
|
||||||
|
static readonly List<UIParticle> s_ActiveSoftMasks = new List<UIParticle> ();
|
||||||
|
|
||||||
|
|
||||||
//################################
|
//################################
|
||||||
// Serialize Members.
|
// Serialize Members.
|
||||||
//################################
|
//################################
|
||||||
[Tooltip("The ParticleSystem rendered by CanvasRenderer")]
|
[Tooltip ("The ParticleSystem rendered by CanvasRenderer")]
|
||||||
[SerializeField] ParticleSystem m_ParticleSystem;
|
[SerializeField] ParticleSystem m_ParticleSystem;
|
||||||
[Tooltip("The UIParticle to render trail effect")]
|
[Tooltip ("The UIParticle to render trail effect")]
|
||||||
[SerializeField] UIParticle m_TrailParticle;
|
[SerializeField] UIParticle m_TrailParticle;
|
||||||
[HideInInspector] [SerializeField] bool m_IsTrail = false;
|
[HideInInspector] [SerializeField] bool m_IsTrail = false;
|
||||||
|
[Tooltip ("Particle effect scale")]
|
||||||
|
[SerializeField] float m_Scale = 1;
|
||||||
|
[Tooltip ("Ignore parent scale")]
|
||||||
|
[SerializeField] bool m_IgnoreParent = false;
|
||||||
|
|
||||||
|
|
||||||
//################################
|
//################################
|
||||||
|
@ -40,162 +46,269 @@ namespace Coffee.UIExtensions
|
||||||
Texture tex = null;
|
Texture tex = null;
|
||||||
if (!m_IsTrail)
|
if (!m_IsTrail)
|
||||||
{
|
{
|
||||||
Profiler.BeginSample("Check TextureSheetAnimation module");
|
Profiler.BeginSample ("Check TextureSheetAnimation module");
|
||||||
var textureSheet = m_ParticleSystem.textureSheetAnimation;
|
var textureSheet = m_ParticleSystem.textureSheetAnimation;
|
||||||
if (textureSheet.enabled && textureSheet.mode == ParticleSystemAnimationMode.Sprites && 0 < textureSheet.spriteCount)
|
if (textureSheet.enabled && textureSheet.mode == ParticleSystemAnimationMode.Sprites && 0 < textureSheet.spriteCount)
|
||||||
{
|
{
|
||||||
tex = textureSheet.GetSprite(0).texture;
|
tex = textureSheet.GetSprite (0).texture;
|
||||||
}
|
}
|
||||||
Profiler.EndSample();
|
Profiler.EndSample ();
|
||||||
}
|
}
|
||||||
if (!tex && _renderer)
|
if (!tex && _renderer)
|
||||||
{
|
{
|
||||||
Profiler.BeginSample("Check material");
|
Profiler.BeginSample ("Check material");
|
||||||
var mat = m_IsTrail
|
var mat = m_IsTrail
|
||||||
? _renderer.trailMaterial
|
? _renderer.trailMaterial
|
||||||
: Application.isPlaying
|
: Application.isPlaying
|
||||||
? _renderer.material
|
? _renderer.material
|
||||||
: _renderer.sharedMaterial;
|
: _renderer.sharedMaterial;
|
||||||
if (mat && mat.HasProperty(s_IdMainTex))
|
if (mat && mat.HasProperty (s_IdMainTex))
|
||||||
{
|
{
|
||||||
tex = mat.mainTexture;
|
tex = mat.mainTexture;
|
||||||
}
|
}
|
||||||
Profiler.EndSample();
|
Profiler.EndSample ();
|
||||||
}
|
}
|
||||||
return tex ?? s_WhiteTexture;
|
return tex ?? s_WhiteTexture;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public override Material GetModifiedMaterial(Material baseMaterial)
|
/// <summary>
|
||||||
|
/// Particle effect scale.
|
||||||
|
/// </summary>
|
||||||
|
public float scale { get { return _parent ? _parent.scale : m_Scale; } set { m_Scale = value; } }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Should the soft mask ignore parent soft masks?
|
||||||
|
/// </summary>
|
||||||
|
/// <value>If set to true the soft mask will ignore any parent soft mask settings.</value>
|
||||||
|
public bool ignoreParent
|
||||||
{
|
{
|
||||||
return base.GetModifiedMaterial(_renderer ? _renderer.sharedMaterial : baseMaterial);
|
get { return m_IgnoreParent; }
|
||||||
|
set
|
||||||
|
{
|
||||||
|
if (m_IgnoreParent != value)
|
||||||
|
{
|
||||||
|
m_IgnoreParent = value;
|
||||||
|
OnTransformParentChanged ();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void OnEnable()
|
public bool isRoot
|
||||||
{
|
{
|
||||||
m_ParticleSystem = m_ParticleSystem ? m_ParticleSystem : GetComponent<ParticleSystem>();
|
get { return !_parent; }
|
||||||
_renderer = m_ParticleSystem ? m_ParticleSystem.GetComponent<ParticleSystemRenderer>() : null;
|
|
||||||
|
|
||||||
_mesh = new Mesh();
|
|
||||||
_mesh.MarkDynamic();
|
|
||||||
CheckTrail();
|
|
||||||
base.OnEnable();
|
|
||||||
|
|
||||||
Canvas.willRenderCanvases += UpdateMesh;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void OnDisable()
|
public override bool raycastTarget { get { return false; } set { base.raycastTarget = value; } }
|
||||||
|
|
||||||
|
public override Material GetModifiedMaterial (Material baseMaterial)
|
||||||
{
|
{
|
||||||
Canvas.willRenderCanvases -= UpdateMesh;
|
return base.GetModifiedMaterial (_renderer ? _renderer.sharedMaterial : baseMaterial);
|
||||||
DestroyImmediate(_mesh);
|
}
|
||||||
|
|
||||||
|
protected override void OnEnable ()
|
||||||
|
{
|
||||||
|
// Register.
|
||||||
|
if (s_ActiveSoftMasks.Count == 0)
|
||||||
|
{
|
||||||
|
Canvas.willRenderCanvases += UpdateMeshes;
|
||||||
|
}
|
||||||
|
s_ActiveSoftMasks.Add (this);
|
||||||
|
|
||||||
|
// Reset the parent-child relation.
|
||||||
|
GetComponentsInChildren<UIParticle> (false, s_TempRelatables);
|
||||||
|
for (int i = s_TempRelatables.Count - 1; 0 <= i; i--)
|
||||||
|
{
|
||||||
|
s_TempRelatables [i].OnTransformParentChanged ();
|
||||||
|
}
|
||||||
|
s_TempRelatables.Clear ();
|
||||||
|
|
||||||
|
m_ParticleSystem = m_ParticleSystem ? m_ParticleSystem : GetComponent<ParticleSystem> ();
|
||||||
|
_renderer = m_ParticleSystem ? m_ParticleSystem.GetComponent<ParticleSystemRenderer> () : null;
|
||||||
|
|
||||||
|
// Create objects.
|
||||||
|
_mesh = new Mesh ();
|
||||||
|
_mesh.MarkDynamic ();
|
||||||
|
CheckTrail ();
|
||||||
|
|
||||||
|
base.OnEnable ();
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override void OnDisable ()
|
||||||
|
{
|
||||||
|
// Unregister.
|
||||||
|
s_ActiveSoftMasks.Remove (this);
|
||||||
|
if (s_ActiveSoftMasks.Count == 0)
|
||||||
|
{
|
||||||
|
Canvas.willRenderCanvases -= UpdateMeshes;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Reset the parent-child relation.
|
||||||
|
for (int i = _children.Count - 1; 0 <= i; i--)
|
||||||
|
{
|
||||||
|
_children [i].SetParent (_parent);
|
||||||
|
}
|
||||||
|
_children.Clear ();
|
||||||
|
SetParent (null);
|
||||||
|
|
||||||
|
// Destroy objects.
|
||||||
|
DestroyImmediate (_mesh);
|
||||||
_mesh = null;
|
_mesh = null;
|
||||||
CheckTrail();
|
CheckTrail ();
|
||||||
base.OnDisable();
|
|
||||||
|
base.OnDisable ();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void UpdateGeometry()
|
protected override void UpdateGeometry ()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// This function is called when the parent property of the transform of the GameObject has changed.
|
||||||
|
/// </summary>
|
||||||
|
protected override void OnTransformParentChanged ()
|
||||||
|
{
|
||||||
|
UIParticle newParent = null;
|
||||||
|
if (isActiveAndEnabled && !m_IgnoreParent)
|
||||||
|
{
|
||||||
|
var parentTransform = transform.parent;
|
||||||
|
while (parentTransform && (!newParent || !newParent.enabled))
|
||||||
|
{
|
||||||
|
newParent = parentTransform.GetComponent<UIParticle> ();
|
||||||
|
parentTransform = parentTransform.parent;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
SetParent (newParent);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override void OnDidApplyAnimationProperties ()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
#if UNITY_EDITOR
|
||||||
|
/// <summary>
|
||||||
|
/// This function is called when the script is loaded or a value is changed in the inspector(Called in the editor only).
|
||||||
|
/// </summary>
|
||||||
|
protected override void OnValidate ()
|
||||||
|
{
|
||||||
|
OnTransformParentChanged ();
|
||||||
|
base.OnValidate ();
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
//################################
|
//################################
|
||||||
// Private Members.
|
// Private Members.
|
||||||
//################################
|
//################################
|
||||||
Mesh _mesh;
|
Mesh _mesh;
|
||||||
ParticleSystemRenderer _renderer;
|
ParticleSystemRenderer _renderer;
|
||||||
|
UIParticle _parent;
|
||||||
|
List<UIParticle> _children = new List<UIParticle> ();
|
||||||
|
Matrix4x4 scaleaMatrix = default (Matrix4x4);
|
||||||
|
|
||||||
void UpdateMesh()
|
static void UpdateMeshes ()
|
||||||
|
{
|
||||||
|
foreach (var uip in s_ActiveSoftMasks)
|
||||||
|
{
|
||||||
|
uip.UpdateMesh ();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void UpdateMesh ()
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
Profiler.BeginSample("CheckTrail");
|
Profiler.BeginSample ("CheckTrail");
|
||||||
CheckTrail();
|
CheckTrail ();
|
||||||
Profiler.EndSample();
|
Profiler.EndSample ();
|
||||||
|
|
||||||
if (m_ParticleSystem)
|
if (m_ParticleSystem)
|
||||||
{
|
{
|
||||||
Profiler.BeginSample("Disable ParticleSystemRenderer");
|
Profiler.BeginSample ("Disable ParticleSystemRenderer");
|
||||||
if (Application.isPlaying)
|
if (Application.isPlaying)
|
||||||
{
|
{
|
||||||
_renderer.enabled = false;
|
_renderer.enabled = false;
|
||||||
}
|
}
|
||||||
Profiler.EndSample();
|
Profiler.EndSample ();
|
||||||
|
|
||||||
Profiler.BeginSample("Make Matrix");
|
Profiler.BeginSample ("Make Matrix");
|
||||||
var cam = canvas.worldCamera ?? Camera.main;
|
var s = scale;
|
||||||
bool useTransform = false;
|
scaleaMatrix = Matrix4x4.Scale (new Vector3 (s, s, s));
|
||||||
Matrix4x4 matrix = default(Matrix4x4);
|
Matrix4x4 matrix = default (Matrix4x4);
|
||||||
switch (m_ParticleSystem.main.simulationSpace)
|
switch (m_ParticleSystem.main.simulationSpace)
|
||||||
{
|
{
|
||||||
case ParticleSystemSimulationSpace.Local:
|
case ParticleSystemSimulationSpace.Local:
|
||||||
matrix =
|
matrix =
|
||||||
Matrix4x4.Rotate(m_ParticleSystem.transform.rotation).inverse
|
scaleaMatrix
|
||||||
* Matrix4x4.Scale(m_ParticleSystem.transform.lossyScale).inverse;
|
* Matrix4x4.Rotate (m_ParticleSystem.transform.rotation).inverse
|
||||||
useTransform = true;
|
* Matrix4x4.Scale (m_ParticleSystem.transform.lossyScale).inverse;
|
||||||
break;
|
break;
|
||||||
case ParticleSystemSimulationSpace.World:
|
case ParticleSystemSimulationSpace.World:
|
||||||
matrix = m_ParticleSystem.transform.worldToLocalMatrix;
|
matrix =
|
||||||
|
scaleaMatrix
|
||||||
|
* m_ParticleSystem.transform.worldToLocalMatrix;
|
||||||
break;
|
break;
|
||||||
case ParticleSystemSimulationSpace.Custom:
|
case ParticleSystemSimulationSpace.Custom:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
Profiler.EndSample();
|
Profiler.EndSample ();
|
||||||
|
|
||||||
_mesh.Clear();
|
_mesh.Clear ();
|
||||||
if (0 < m_ParticleSystem.particleCount)
|
if (0 < m_ParticleSystem.particleCount)
|
||||||
{
|
{
|
||||||
Profiler.BeginSample("Bake Mesh");
|
Profiler.BeginSample ("Bake Mesh");
|
||||||
if (m_IsTrail)
|
if (m_IsTrail)
|
||||||
{
|
{
|
||||||
_renderer.BakeTrailsMesh(_mesh, cam, useTransform);
|
_renderer.BakeTrailsMesh (_mesh, true);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
_renderer.BakeMesh(_mesh, cam, useTransform);
|
_renderer.BakeMesh (_mesh, true);
|
||||||
}
|
}
|
||||||
Profiler.EndSample();
|
Profiler.EndSample ();
|
||||||
|
|
||||||
// Apply matrix.
|
// Apply matrix.
|
||||||
Profiler.BeginSample("Apply matrix to position");
|
Profiler.BeginSample ("Apply matrix to position");
|
||||||
_mesh.GetVertices(s_Vertices);
|
_mesh.GetVertices (s_Vertices);
|
||||||
var count = s_Vertices.Count;
|
var count = s_Vertices.Count;
|
||||||
for (int i = 0; i < count; i++)
|
for (int i = 0; i < count; i++)
|
||||||
{
|
{
|
||||||
s_Vertices[i] = matrix.MultiplyPoint3x4(s_Vertices[i]);
|
s_Vertices [i] = matrix.MultiplyPoint3x4 (s_Vertices [i]);
|
||||||
}
|
}
|
||||||
_mesh.SetVertices(s_Vertices);
|
_mesh.SetVertices (s_Vertices);
|
||||||
s_Vertices.Clear();
|
s_Vertices.Clear ();
|
||||||
Profiler.EndSample();
|
Profiler.EndSample ();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Set mesh to CanvasRenderer.
|
// Set mesh to CanvasRenderer.
|
||||||
Profiler.BeginSample("Set mesh and texture to CanvasRenderer");
|
Profiler.BeginSample ("Set mesh and texture to CanvasRenderer");
|
||||||
canvasRenderer.SetMesh(_mesh);
|
canvasRenderer.SetMesh (_mesh);
|
||||||
canvasRenderer.SetTexture(mainTexture);
|
canvasRenderer.SetTexture (mainTexture);
|
||||||
Profiler.EndSample();
|
Profiler.EndSample ();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch(System.Exception e)
|
catch (System.Exception e)
|
||||||
{
|
{
|
||||||
Debug.LogException(e);
|
Debug.LogException (e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void CheckTrail()
|
void CheckTrail ()
|
||||||
{
|
{
|
||||||
if (isActiveAndEnabled && !m_IsTrail && m_ParticleSystem && m_ParticleSystem.trails.enabled)
|
if (isActiveAndEnabled && !m_IsTrail && m_ParticleSystem && m_ParticleSystem.trails.enabled)
|
||||||
{
|
{
|
||||||
if (!m_TrailParticle)
|
if (!m_TrailParticle)
|
||||||
{
|
{
|
||||||
m_TrailParticle = new GameObject("[UIParticle] Trail").AddComponent<UIParticle>();
|
m_TrailParticle = new GameObject ("[UIParticle] Trail").AddComponent<UIParticle> ();
|
||||||
var trans = m_TrailParticle.transform;
|
var trans = m_TrailParticle.transform;
|
||||||
trans.SetParent(transform);
|
trans.SetParent (transform);
|
||||||
trans.localPosition = Vector3.zero;
|
trans.localPosition = Vector3.zero;
|
||||||
trans.localRotation = Quaternion.identity;
|
trans.localRotation = Quaternion.identity;
|
||||||
trans.localScale = Vector3.one;
|
trans.localScale = Vector3.one;
|
||||||
|
|
||||||
m_TrailParticle._renderer = GetComponent<ParticleSystemRenderer>();
|
m_TrailParticle._renderer = GetComponent<ParticleSystemRenderer> ();
|
||||||
m_TrailParticle.m_ParticleSystem = GetComponent<ParticleSystem>();
|
m_TrailParticle.m_ParticleSystem = GetComponent<ParticleSystem> ();
|
||||||
m_TrailParticle.m_IsTrail = true;
|
m_TrailParticle.m_IsTrail = true;
|
||||||
}
|
}
|
||||||
m_TrailParticle.enabled = true;
|
m_TrailParticle.enabled = true;
|
||||||
|
@ -205,5 +318,27 @@ namespace Coffee.UIExtensions
|
||||||
m_TrailParticle.enabled = false;
|
m_TrailParticle.enabled = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Set the parent of the soft mask.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="newParent">The parent soft mask to use.</param>
|
||||||
|
void SetParent (UIParticle newParent)
|
||||||
|
{
|
||||||
|
if (_parent != newParent && this != newParent)
|
||||||
|
{
|
||||||
|
if (_parent && _parent._children.Contains (this))
|
||||||
|
{
|
||||||
|
_parent._children.Remove (this);
|
||||||
|
_parent._children.RemoveAll (x => x == null);
|
||||||
|
}
|
||||||
|
_parent = newParent;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (_parent && !_parent._children.Contains (this))
|
||||||
|
{
|
||||||
|
_parent._children.Add (this);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
20
CHANGELOG.md
20
CHANGELOG.md
|
@ -1,5 +1,25 @@
|
||||||
# Changelog
|
# Changelog
|
||||||
|
|
||||||
|
## [v1.1.0](https://github.com/mob-sakai/ParticleEffectForUGUI/tree/v1.1.0) (2018-11-28)
|
||||||
|
|
||||||
|
[Full Changelog](https://github.com/mob-sakai/ParticleEffectForUGUI/compare/v1.0.0...v1.1.0)
|
||||||
|
|
||||||
|
Easily to use, easily to set up.
|
||||||
|
|
||||||
|
* Adjust the Scale property to change the size of the effect.
|
||||||
|

|
||||||
|
* If your effect consists of multiple ParticleSystems, you can quickly set up UIParticles by clicking "Fix".
|
||||||
|

|
||||||
|
|
||||||
|
**Implemented enhancements:**
|
||||||
|
|
||||||
|
- Easy setup in editor [\#11](https://github.com/mob-sakai/ParticleEffectForUGUI/issues/11)
|
||||||
|
- Add a scale property independent of transform [\#10](https://github.com/mob-sakai/ParticleEffectForUGUI/issues/10)
|
||||||
|
|
||||||
|
**Fixed bugs:**
|
||||||
|
|
||||||
|
- Raycast blocking is unnecessary [\#12](https://github.com/mob-sakai/ParticleEffectForUGUI/issues/12)
|
||||||
|
|
||||||
## [v1.0.0](https://github.com/mob-sakai/ParticleEffectForUGUI/tree/v1.0.0) (2018-07-13)
|
## [v1.0.0](https://github.com/mob-sakai/ParticleEffectForUGUI/tree/v1.0.0) (2018-07-13)
|
||||||
|
|
||||||
[Full Changelog](https://github.com/mob-sakai/ParticleEffectForUGUI/compare/v0.1.0...v1.0.0)
|
[Full Changelog](https://github.com/mob-sakai/ParticleEffectForUGUI/compare/v0.1.0...v1.0.0)
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
--- !u!30 &1
|
--- !u!30 &1
|
||||||
GraphicsSettings:
|
GraphicsSettings:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
serializedVersion: 9
|
serializedVersion: 12
|
||||||
m_Deferred:
|
m_Deferred:
|
||||||
m_Mode: 1
|
m_Mode: 1
|
||||||
m_Shader: {fileID: 69, guid: 0000000000000000f000000000000000, type: 0}
|
m_Shader: {fileID: 69, guid: 0000000000000000f000000000000000, type: 0}
|
||||||
|
@ -36,29 +36,29 @@ GraphicsSettings:
|
||||||
- {fileID: 10753, guid: 0000000000000000f000000000000000, type: 0}
|
- {fileID: 10753, guid: 0000000000000000f000000000000000, type: 0}
|
||||||
- {fileID: 10770, guid: 0000000000000000f000000000000000, type: 0}
|
- {fileID: 10770, guid: 0000000000000000f000000000000000, type: 0}
|
||||||
- {fileID: 10782, guid: 0000000000000000f000000000000000, type: 0}
|
- {fileID: 10782, guid: 0000000000000000f000000000000000, type: 0}
|
||||||
|
- {fileID: 16000, guid: 0000000000000000f000000000000000, type: 0}
|
||||||
|
- {fileID: 17000, guid: 0000000000000000f000000000000000, type: 0}
|
||||||
m_PreloadedShaders: []
|
m_PreloadedShaders: []
|
||||||
m_SpritesDefaultMaterial: {fileID: 10754, guid: 0000000000000000f000000000000000,
|
m_SpritesDefaultMaterial: {fileID: 10754, guid: 0000000000000000f000000000000000,
|
||||||
type: 0}
|
type: 0}
|
||||||
m_TierSettings_Tier1:
|
m_CustomRenderPipeline: {fileID: 0}
|
||||||
renderingPath: 1
|
m_TransparencySortMode: 0
|
||||||
useCascadedShadowMaps: 1
|
m_TransparencySortAxis: {x: 0, y: 0, z: 1}
|
||||||
m_TierSettings_Tier2:
|
|
||||||
renderingPath: 1
|
|
||||||
useCascadedShadowMaps: 1
|
|
||||||
m_TierSettings_Tier3:
|
|
||||||
renderingPath: 1
|
|
||||||
useCascadedShadowMaps: 1
|
|
||||||
m_DefaultRenderingPath: 1
|
m_DefaultRenderingPath: 1
|
||||||
m_DefaultMobileRenderingPath: 1
|
m_DefaultMobileRenderingPath: 1
|
||||||
m_TierSettings: []
|
m_TierSettings: []
|
||||||
m_LightmapStripping: 0
|
m_LightmapStripping: 0
|
||||||
m_FogStripping: 0
|
m_FogStripping: 0
|
||||||
|
m_InstancingStripping: 0
|
||||||
m_LightmapKeepPlain: 1
|
m_LightmapKeepPlain: 1
|
||||||
m_LightmapKeepDirCombined: 1
|
m_LightmapKeepDirCombined: 1
|
||||||
m_LightmapKeepDirSeparate: 1
|
|
||||||
m_LightmapKeepDynamicPlain: 1
|
m_LightmapKeepDynamicPlain: 1
|
||||||
m_LightmapKeepDynamicDirCombined: 1
|
m_LightmapKeepDynamicDirCombined: 1
|
||||||
m_LightmapKeepDynamicDirSeparate: 1
|
m_LightmapKeepShadowMask: 1
|
||||||
|
m_LightmapKeepSubtractive: 1
|
||||||
m_FogKeepLinear: 1
|
m_FogKeepLinear: 1
|
||||||
m_FogKeepExp: 1
|
m_FogKeepExp: 1
|
||||||
m_FogKeepExp2: 1
|
m_FogKeepExp2: 1
|
||||||
|
m_AlbedoSwatchInfos: []
|
||||||
|
m_LightsUseLinearIntensity: 0
|
||||||
|
m_LightsUseColorTemperature: 0
|
||||||
|
|
|
@ -13,7 +13,7 @@ PlayerSettings:
|
||||||
useOnDemandResources: 0
|
useOnDemandResources: 0
|
||||||
accelerometerFrequency: 60
|
accelerometerFrequency: 60
|
||||||
companyName: Coffee
|
companyName: Coffee
|
||||||
productName: GradientForUGUI
|
productName: ParticleEffectForUGUI
|
||||||
defaultCursor: {fileID: 0}
|
defaultCursor: {fileID: 0}
|
||||||
cursorHotspot: {x: 0, y: 0}
|
cursorHotspot: {x: 0, y: 0}
|
||||||
m_SplashScreenBackgroundColor: {r: 0.13725491, g: 0.12156863, b: 0.1254902, a: 1}
|
m_SplashScreenBackgroundColor: {r: 0.13725491, g: 0.12156863, b: 0.1254902, a: 1}
|
||||||
|
@ -125,6 +125,7 @@ PlayerSettings:
|
||||||
m_HolographicPauseOnTrackingLoss: 1
|
m_HolographicPauseOnTrackingLoss: 1
|
||||||
xboxOneDisableKinectGpuReservation: 0
|
xboxOneDisableKinectGpuReservation: 0
|
||||||
xboxOneEnable7thCore: 1
|
xboxOneEnable7thCore: 1
|
||||||
|
isWsaHolographicRemotingEnabled: 0
|
||||||
vrSettings:
|
vrSettings:
|
||||||
cardboard:
|
cardboard:
|
||||||
depthFormat: 0
|
depthFormat: 0
|
||||||
|
@ -151,10 +152,10 @@ PlayerSettings:
|
||||||
androidSupportedAspectRatio: 1
|
androidSupportedAspectRatio: 1
|
||||||
androidMaxAspectRatio: 2.1
|
androidMaxAspectRatio: 2.1
|
||||||
applicationIdentifier:
|
applicationIdentifier:
|
||||||
Android: com.coffee.gradientforugui
|
Android: com.coffee.particleeffectforugui
|
||||||
Standalone: unity.coffee.particle
|
Standalone: com.coffee.particleeffectforugui
|
||||||
iOS: com.coffee.gradientforugui
|
iOS: com.coffee.particleeffectforugui
|
||||||
tvOS: com.coffee.gradientforugui
|
tvOS: com.coffee.particleeffectforugui
|
||||||
buildNumber:
|
buildNumber:
|
||||||
iOS: 0
|
iOS: 0
|
||||||
AndroidBundleVersionCode: 1
|
AndroidBundleVersionCode: 1
|
||||||
|
@ -401,6 +402,7 @@ PlayerSettings:
|
||||||
switchAllowsVideoCapturing: 1
|
switchAllowsVideoCapturing: 1
|
||||||
switchAllowsRuntimeAddOnContentInstall: 0
|
switchAllowsRuntimeAddOnContentInstall: 0
|
||||||
switchDataLossConfirmation: 0
|
switchDataLossConfirmation: 0
|
||||||
|
switchUserAccountLockEnabled: 0
|
||||||
switchSupportedNpadStyles: 3
|
switchSupportedNpadStyles: 3
|
||||||
switchNativeFsCacheSize: 32
|
switchNativeFsCacheSize: 32
|
||||||
switchIsHoldTypeHorizontal: 0
|
switchIsHoldTypeHorizontal: 0
|
||||||
|
@ -557,14 +559,14 @@ PlayerSettings:
|
||||||
apiCompatibilityLevelPerPlatform: {}
|
apiCompatibilityLevelPerPlatform: {}
|
||||||
m_RenderingPath: 1
|
m_RenderingPath: 1
|
||||||
m_MobileRenderingPath: 1
|
m_MobileRenderingPath: 1
|
||||||
metroPackageName: GradientForUGUI
|
metroPackageName: ParticleEffectForUGUI
|
||||||
metroPackageVersion:
|
metroPackageVersion:
|
||||||
metroCertificatePath:
|
metroCertificatePath:
|
||||||
metroCertificatePassword:
|
metroCertificatePassword:
|
||||||
metroCertificateSubject:
|
metroCertificateSubject:
|
||||||
metroCertificateIssuer:
|
metroCertificateIssuer:
|
||||||
metroCertificateNotAfter: 0000000000000000
|
metroCertificateNotAfter: 0000000000000000
|
||||||
metroApplicationDescription: GradientForUGUI
|
metroApplicationDescription: ParticleEffectForUGUI
|
||||||
wsaImages: {}
|
wsaImages: {}
|
||||||
metroTileShortName:
|
metroTileShortName:
|
||||||
metroTileShowName: 0
|
metroTileShowName: 0
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
m_EditorVersion: 2018.2.0f2
|
m_EditorVersion: 2018.2.14f1
|
||||||
|
|
|
@ -3,12 +3,14 @@
|
||||||
--- !u!310 &1
|
--- !u!310 &1
|
||||||
UnityConnectSettings:
|
UnityConnectSettings:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
m_Enabled: 0
|
m_Enabled: 1
|
||||||
m_TestMode: 0
|
m_TestMode: 0
|
||||||
m_TestEventUrl:
|
m_TestEventUrl:
|
||||||
m_TestConfigUrl:
|
m_TestConfigUrl:
|
||||||
|
m_TestInitMode: 0
|
||||||
CrashReportingSettings:
|
CrashReportingSettings:
|
||||||
m_EventUrl: https://perf-events.cloud.unity3d.com/api/events/crashes
|
m_EventUrl: https://perf-events.cloud.unity3d.com/api/events/crashes
|
||||||
|
m_NativeEventUrl: https://perf-events.cloud.unity3d.com/symbolicate
|
||||||
m_Enabled: 0
|
m_Enabled: 0
|
||||||
m_CaptureEditorExceptions: 1
|
m_CaptureEditorExceptions: 1
|
||||||
UnityPurchasingSettings:
|
UnityPurchasingSettings:
|
||||||
|
@ -24,6 +26,9 @@ UnityConnectSettings:
|
||||||
m_Enabled: 0
|
m_Enabled: 0
|
||||||
m_InitializeOnStartup: 1
|
m_InitializeOnStartup: 1
|
||||||
m_TestMode: 0
|
m_TestMode: 0
|
||||||
m_EnabledPlatforms: 4294967295
|
|
||||||
m_IosGameId:
|
m_IosGameId:
|
||||||
m_AndroidGameId:
|
m_AndroidGameId:
|
||||||
|
m_GameIds: {}
|
||||||
|
m_GameId:
|
||||||
|
PerformanceReportingSettings:
|
||||||
|
m_Enabled: 0
|
||||||
|
|
31
README.md
31
README.md
|
@ -15,8 +15,8 @@ The particle rendering is maskable and sortable, without Camera, RenderTexture o
|
||||||
|
|
||||||
<< [Description](#Description) | [WebGL Demo](#demo) | [Download](https://github.com/mob-sakai/ParticleEffectForUGUI/releases) | [Usage](#usage) | [Development Note](#development-note) | [Change log](https://github.com/mob-sakai/ParticleEffectForUGUI/blob/master/CHANGELOG.md) >>
|
<< [Description](#Description) | [WebGL Demo](#demo) | [Download](https://github.com/mob-sakai/ParticleEffectForUGUI/releases) | [Usage](#usage) | [Development Note](#development-note) | [Change log](https://github.com/mob-sakai/ParticleEffectForUGUI/blob/master/CHANGELOG.md) >>
|
||||||
|
|
||||||
### What's new? Please see [RELEASE NOTE ](https://github.com/mob-sakai/ParticleEffectForUGUI/blob/master/CHANGELOG.md)
|
### What's new? Please see [See changelog ](https://github.com/mob-sakai/ParticleEffectForUGUI/blob/master/CHANGELOG.md)
|
||||||
|
### Do you want to receive notifications for new releases? [Watch this repo ](https://github.com/mob-sakai/ParticleEffectForUGUI/subscription)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -40,6 +40,17 @@ Compares this "Baking mesh" approach with the conventional approach:
|
||||||
|Use RenderTexture|Maskable.<br>Sortable.|**Requires Camera and RenderTexture.**<br>Difficult to adjust position and size.<br>Quality depends on the RenderTexture's setting.|<img src="https://user-images.githubusercontent.com/12690315/41765085-0291b3e2-763e-11e8-827b-72e5ee9bc556.gif" width="500px">|
|
|Use RenderTexture|Maskable.<br>Sortable.|**Requires Camera and RenderTexture.**<br>Difficult to adjust position and size.<br>Quality depends on the RenderTexture's setting.|<img src="https://user-images.githubusercontent.com/12690315/41765085-0291b3e2-763e-11e8-827b-72e5ee9bc556.gif" width="500px">|
|
||||||
|
|
||||||
|
|
||||||
|
#### Features
|
||||||
|
|
||||||
|
* Sort particle effects with uGUI
|
||||||
|
* No Camera, RenderTexture or Canvas are required
|
||||||
|
* Masking with Mask or RectMask2D
|
||||||
|
* Easy to use
|
||||||
|
* Support Trail module
|
||||||
|
* Change alpha with CanvasGroup
|
||||||
|
* Scaling independent of Transform
|
||||||
|
* No heavy allocation every frame
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<br><br><br><br>
|
<br><br><br><br>
|
||||||
|
@ -53,14 +64,18 @@ Compares this "Baking mesh" approach with the conventional approach:
|
||||||
## Usage
|
## Usage
|
||||||
|
|
||||||
1. Download ParticleEffectForUGUI.unitypackage from [Releases](https://github.com/mob-sakai/ParticleEffectForUGUI/releases).
|
1. Download ParticleEffectForUGUI.unitypackage from [Releases](https://github.com/mob-sakai/ParticleEffectForUGUI/releases).
|
||||||
1. Import the package into your Unity project. Select `Import Package > Custom Package` from the `Assets` menu.
|
2. Import the package into your Unity project. Select `Import Package > Custom Package` from the `Assets` menu.
|
||||||
1. Add particle system to canvas.
|
3. Add your particle effect to canvas.
|
||||||
1. (Option) If you want to mask particles, set a UI shader such as "UI/UIAdditive" to material for ParticleSystem.
|
4. (Option) If you want to mask particles, set a UI shader such as "UI/UIAdditive" to material for ParticleSystem.
|
||||||

|

|
||||||
1. Add `UIParticle` component to particle system from `Add Component` in inspector.
|
5. Add `UIParticle` component to root particle system of your effect from `Add Component` in inspector.
|
||||||

|

|
||||||
1. That's all. There are no properties you must set in the inspector!
|
6. If your effect consists of multiple ParticleSystems, click "Fix".
|
||||||
1. Enjoy!
|

|
||||||
|
7. Adjust the Scale property to change the size of the effect.
|
||||||
|

|
||||||
|
8. That's all. There are no properties you must set in the inspector!
|
||||||
|
9. Enjoy!
|
||||||
|
|
||||||
|
|
||||||
##### Requirement
|
##### Requirement
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "ParticleEffectForUGUI",
|
"name": "ParticleEffectForUGUI",
|
||||||
"version": "1.0.0",
|
"version": "1.1.0",
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "git+https://github.com/mob-sakai/ParticleEffectForUGUI.git"
|
"url": "git+https://github.com/mob-sakai/ParticleEffectForUGUI.git"
|
||||||
|
|
Loading…
Reference in New Issue