3.0.0-preview.1

# [3.0.0-preview.1](https://github.com/mob-sakai/ParticleEffectForUGUI/compare/v2.3.0...v3.0.0-preview.1) (2020-02-12)

### Bug Fixes

* change the text in the inspector to make it more understandable. ([7ca0b6f](7ca0b6fa34)), closes [#66](https://github.com/mob-sakai/ParticleEffectForUGUI/issues/66)
* editor crashes when mesh is set to null when ParticleSystem.RenderMode=Mesh ([e5ebadd](e5ebadd847)), closes [#69](https://github.com/mob-sakai/ParticleEffectForUGUI/issues/69)
* getting massive errors on editor ([ef82fa8](ef82fa82a6)), closes [#67](https://github.com/mob-sakai/ParticleEffectForUGUI/issues/67)
* heavy editor UI ([d3b470a](d3b470a2be))
* remove a menu to add overlay camera ([f5d3b6e](f5d3b6edb5))
* rotating the particle rect may cause out of bounds ([3439842](3439842119)), closes [#55](https://github.com/mob-sakai/ParticleEffectForUGUI/issues/55)
* scale will be decrease on editor ([0c59846](0c59846f11))
* UI darker than normal when change to linear color space ([db4d8a7](db4d8a742c)), closes [#57](https://github.com/mob-sakai/ParticleEffectForUGUI/issues/57)

### Build System

* update develop environment ([9fcf169](9fcf169cd3))

### Features

* add menu to import sample ([b8b1827](b8b1827318))
* add samples test ([287b5cc](287b5cc832))
* **editor:** add osc package (portable mode) ([6c7f880](6c7f880435))

### BREAKING CHANGES

* update develop environment to Unity 2018.3.
Unity 2018.2 will continue to be supported.
pull/77/head
semantic-release-bot 2020-02-12 12:38:06 +00:00
parent 9c525ad0f0
commit a4cbebeb29
69 changed files with 91322 additions and 1294 deletions

0
.releaserc Normal file
View File

View File

@ -1,3 +1,35 @@
# [3.0.0-preview.1](https://github.com/mob-sakai/ParticleEffectForUGUI/compare/v2.3.0...v3.0.0-preview.1) (2020-02-12)
### Bug Fixes
* change the text in the inspector to make it more understandable. ([7ca0b6f](https://github.com/mob-sakai/ParticleEffectForUGUI/commit/7ca0b6fa34c1168ef103992e1c69b68631b3bc60)), closes [#66](https://github.com/mob-sakai/ParticleEffectForUGUI/issues/66)
* editor crashes when mesh is set to null when ParticleSystem.RenderMode=Mesh ([e5ebadd](https://github.com/mob-sakai/ParticleEffectForUGUI/commit/e5ebadd84731716f82c63ac5ba3eb676720e3ad6)), closes [#69](https://github.com/mob-sakai/ParticleEffectForUGUI/issues/69)
* getting massive errors on editor ([ef82fa8](https://github.com/mob-sakai/ParticleEffectForUGUI/commit/ef82fa82a69894e643f0d257f99eb9177785f697)), closes [#67](https://github.com/mob-sakai/ParticleEffectForUGUI/issues/67)
* heavy editor UI ([d3b470a](https://github.com/mob-sakai/ParticleEffectForUGUI/commit/d3b470a2be3a21add9e126b357e46bdfaa6f16c8))
* remove a menu to add overlay camera ([f5d3b6e](https://github.com/mob-sakai/ParticleEffectForUGUI/commit/f5d3b6edb5687c4d465992ef5c3c0d54f7b36d74))
* rotating the particle rect may cause out of bounds ([3439842](https://github.com/mob-sakai/ParticleEffectForUGUI/commit/3439842119f334b50910c0a983e561944cc792a2)), closes [#55](https://github.com/mob-sakai/ParticleEffectForUGUI/issues/55)
* scale will be decrease on editor ([0c59846](https://github.com/mob-sakai/ParticleEffectForUGUI/commit/0c59846f11438b12caad04ae5d5b544a28883ea6))
* UI darker than normal when change to linear color space ([db4d8a7](https://github.com/mob-sakai/ParticleEffectForUGUI/commit/db4d8a742ca36c8dd2de6936b9cf2912c72d4b9f)), closes [#57](https://github.com/mob-sakai/ParticleEffectForUGUI/issues/57)
### Build System
* update develop environment ([9fcf169](https://github.com/mob-sakai/ParticleEffectForUGUI/commit/9fcf169cd3ced519611b2ede7f98ad4d678027c6))
### Features
* add menu to import sample ([b8b1827](https://github.com/mob-sakai/ParticleEffectForUGUI/commit/b8b18273185769235101da01f5bbadbac188e387))
* add samples test ([287b5cc](https://github.com/mob-sakai/ParticleEffectForUGUI/commit/287b5cc832f2899796227520bda4d11ad8e4fae9))
* **editor:** add osc package (portable mode) ([6c7f880](https://github.com/mob-sakai/ParticleEffectForUGUI/commit/6c7f8804350112505949c5c296f9e0340877a3e8))
### BREAKING CHANGES
* update develop environment to Unity 2018.3.
Unity 2018.2 will continue to be supported.
# Changelog
## [v2.3.0](https://github.com/mob-sakai/ParticleEffectForUGUI/tree/v2.3.0) (2019-05-12)

16
NewBehaviourScript.cs Normal file
View File

@ -0,0 +1,16 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class NewBehaviourScript : MonoBehaviour {
// Use this for initialization
void Start () {
}
// Update is called once per frame
void Update () {
}
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 7ea8014cf19934959b4d5b1192703a1c
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

8
Samples~/Demo.meta Normal file
View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: dc0fe9e7fe61947fab1522ab29e2fc88
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

8
Samples~/Demo/Animatable.meta Executable file
View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: f815d855ff969234888132ed7c171015
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,251 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!74 &7400000
AnimationClip:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_Name: UIParticle_Demo_Animatable
serializedVersion: 6
m_Legacy: 0
m_Compressed: 0
m_UseHighQualityCurve: 1
m_RotationCurves: []
m_CompressedRotationCurves: []
m_EulerCurves: []
m_PositionCurves: []
m_ScaleCurves: []
m_FloatCurves:
- curve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0
value: 1
inSlope: 0
outSlope: 0
tangentMode: 136
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
attribute: material._MainTex_ST.x
path:
classID: 199
script: {fileID: 0}
- curve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0
value: 1
inSlope: 0
outSlope: 0
tangentMode: 136
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
attribute: material._MainTex_ST.y
path:
classID: 199
script: {fileID: 0}
- curve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0
value: 0
inSlope: 0
outSlope: 0
tangentMode: 136
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
attribute: material._MainTex_ST.z
path:
classID: 199
script: {fileID: 0}
- curve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0
value: 0.1
inSlope: 0
outSlope: 0
tangentMode: 136
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
- serializedVersion: 3
time: 1
value: -0.3
inSlope: 0
outSlope: 0
tangentMode: 136
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
attribute: material._MainTex_ST.w
path:
classID: 199
script: {fileID: 0}
m_PPtrCurves: []
m_SampleRate: 30
m_WrapMode: 0
m_Bounds:
m_Center: {x: 0, y: 0, z: 0}
m_Extent: {x: 0, y: 0, z: 0}
m_ClipBindingConstant:
genericBindings:
- serializedVersion: 2
path: 0
attribute: 914802057
script: {fileID: 0}
typeID: 199
customType: 22
isPPtrCurve: 0
- serializedVersion: 2
path: 0
attribute: 109495689
script: {fileID: 0}
typeID: 199
customType: 22
isPPtrCurve: 0
- serializedVersion: 2
path: 0
attribute: 377931145
script: {fileID: 0}
typeID: 199
customType: 22
isPPtrCurve: 0
- serializedVersion: 2
path: 0
attribute: 646366601
script: {fileID: 0}
typeID: 199
customType: 22
isPPtrCurve: 0
pptrCurveMapping: []
m_AnimationClipSettings:
serializedVersion: 2
m_AdditiveReferencePoseClip: {fileID: 0}
m_AdditiveReferencePoseTime: 0
m_StartTime: 0
m_StopTime: 1
m_OrientationOffsetY: 0
m_Level: 0
m_CycleOffset: 0
m_HasAdditiveReferencePose: 0
m_LoopTime: 0
m_LoopBlend: 0
m_LoopBlendOrientation: 0
m_LoopBlendPositionY: 0
m_LoopBlendPositionXZ: 0
m_KeepOriginalOrientation: 0
m_KeepOriginalPositionY: 1
m_KeepOriginalPositionXZ: 0
m_HeightFromFeet: 0
m_Mirror: 0
m_EditorCurves:
- curve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0
value: 1
inSlope: 0
outSlope: 0
tangentMode: 136
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
attribute: material._MainTex_ST.x
path:
classID: 199
script: {fileID: 0}
- curve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0
value: 1
inSlope: 0
outSlope: 0
tangentMode: 136
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
attribute: material._MainTex_ST.y
path:
classID: 199
script: {fileID: 0}
- curve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0
value: 0
inSlope: 0
outSlope: 0
tangentMode: 136
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
attribute: material._MainTex_ST.z
path:
classID: 199
script: {fileID: 0}
- curve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0
value: 0.1
inSlope: 0
outSlope: 0
tangentMode: 136
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
- serializedVersion: 3
time: 1
value: -0.3
inSlope: 0
outSlope: 0
tangentMode: 136
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
attribute: material._MainTex_ST.w
path:
classID: 199
script: {fileID: 0}
m_EulerEditorCurves: []
m_HasGenericRootTransform: 0
m_HasMotionFloatCurves: 0
m_GenerateMotionCurves: 0
m_Events: []

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 69ad7869b9c72c04b8096c17f666bbaa
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 7400000
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,119 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!91 &9100000
AnimatorController:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_Name: UIParticle_Demo_Animatable
serializedVersion: 5
m_AnimatorParameters: []
m_AnimatorLayers:
- serializedVersion: 5
m_Name: Base Layer
m_StateMachine: {fileID: 1107990299158400902}
m_Mask: {fileID: 0}
m_Motions: []
m_Behaviours: []
m_BlendingMode: 0
m_SyncedLayerIndex: -1
m_DefaultWeight: 0
m_IKPass: 0
m_SyncedLayerAffectsTiming: 0
m_Controller: {fileID: 9100000}
--- !u!1101 &1101675994589164342
AnimatorStateTransition:
m_ObjectHideFlags: 1
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_Name:
m_Conditions: []
m_DstStateMachine: {fileID: 0}
m_DstState: {fileID: 1102591848880857122}
m_Solo: 0
m_Mute: 0
m_IsExit: 0
serializedVersion: 3
m_TransitionDuration: 0.25
m_TransitionOffset: 0
m_ExitTime: 0.8333333
m_HasExitTime: 1
m_HasFixedDuration: 1
m_InterruptionSource: 0
m_OrderedInterruption: 1
m_CanTransitionToSelf: 1
--- !u!1102 &1102093862037490004
AnimatorState:
serializedVersion: 5
m_ObjectHideFlags: 1
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_Name: Play
m_Speed: 1
m_CycleOffset: 0
m_Transitions:
- {fileID: 1101675994589164342}
m_StateMachineBehaviours: []
m_Position: {x: 50, y: 50, z: 0}
m_IKOnFeet: 0
m_WriteDefaultValues: 1
m_Mirror: 0
m_SpeedParameterActive: 0
m_MirrorParameterActive: 0
m_CycleOffsetParameterActive: 0
m_TimeParameterActive: 0
m_Motion: {fileID: 7400000, guid: 69ad7869b9c72c04b8096c17f666bbaa, type: 2}
m_Tag:
m_SpeedParameter:
m_MirrorParameter:
m_CycleOffsetParameter:
m_TimeParameter:
--- !u!1102 &1102591848880857122
AnimatorState:
serializedVersion: 5
m_ObjectHideFlags: 1
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_Name: Idle
m_Speed: 1
m_CycleOffset: 0
m_Transitions: []
m_StateMachineBehaviours: []
m_Position: {x: 50, y: 50, z: 0}
m_IKOnFeet: 0
m_WriteDefaultValues: 1
m_Mirror: 0
m_SpeedParameterActive: 0
m_MirrorParameterActive: 0
m_CycleOffsetParameterActive: 0
m_TimeParameterActive: 0
m_Motion: {fileID: 0}
m_Tag:
m_SpeedParameter:
m_MirrorParameter:
m_CycleOffsetParameter:
m_TimeParameter:
--- !u!1107 &1107990299158400902
AnimatorStateMachine:
serializedVersion: 5
m_ObjectHideFlags: 1
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_Name: Base Layer
m_ChildStates:
- serializedVersion: 1
m_State: {fileID: 1102093862037490004}
m_Position: {x: 288, y: 48, z: 0}
- serializedVersion: 1
m_State: {fileID: 1102591848880857122}
m_Position: {x: 288, y: 120, z: 0}
m_ChildStateMachines: []
m_AnyStateTransitions: []
m_EntryTransitions: []
m_StateMachineTransitions: {}
m_StateMachineBehaviours: []
m_AnyStatePosition: {x: 50, y: 20, z: 0}
m_EntryPosition: {x: 48, y: 120, z: 0}
m_ExitPosition: {x: 800, y: 120, z: 0}
m_ParentStateMachinePosition: {x: 800, y: 20, z: 0}
m_DefaultState: {fileID: 1102591848880857122}

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 23dca587da071cd41ac3a7fc070bea5c
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 9100000
userData:
assetBundleName:
assetBundleVariant:

Binary file not shown.

View File

@ -0,0 +1,95 @@
fileFormatVersion: 2
guid: cc4bae8d676c44e0faffd572cc7599a0
ModelImporter:
serializedVersion: 23
fileIDToRecycleName:
100000: o_ring_00
100002: //RootNode
400000: o_ring_00
400002: //RootNode
2100000: lambert2
2300000: o_ring_00
3300000: o_ring_00
4300000: o_ring_00
externalObjects: {}
materials:
importMaterials: 1
materialName: 0
materialSearch: 1
materialLocation: 1
animations:
legacyGenerateAnimations: 4
bakeSimulation: 0
resampleCurves: 1
optimizeGameObjects: 0
motionNodeName:
rigImportErrors:
rigImportWarnings:
animationImportErrors:
animationImportWarnings:
animationRetargetingWarnings:
animationDoRetargetingWarnings: 0
importAnimatedCustomProperties: 0
importConstraints: 0
animationCompression: 1
animationRotationError: 0.5
animationPositionError: 0.5
animationScaleError: 0.5
animationWrapMode: 0
extraExposedTransformPaths: []
extraUserProperties: []
clipAnimations: []
isReadable: 1
meshes:
lODScreenPercentages: []
globalScale: 1
meshCompression: 0
addColliders: 0
importVisibility: 1
importBlendShapes: 1
importCameras: 1
importLights: 1
swapUVChannels: 0
generateSecondaryUV: 0
useFileUnits: 1
optimizeMeshForGPU: 1
keepQuads: 0
weldVertices: 1
preserveHierarchy: 0
indexFormat: 0
secondaryUVAngleDistortion: 8
secondaryUVAreaDistortion: 15.000001
secondaryUVHardAngle: 88
secondaryUVPackMargin: 4
useFileScale: 1
previousCalculatedGlobalScale: 1
hasPreviousCalculatedGlobalScale: 0
tangentSpace:
normalSmoothAngle: 60
normalImportMode: 0
tangentImportMode: 3
normalCalculationMode: 4
importAnimation: 1
copyAvatar: 0
humanDescription:
serializedVersion: 2
human: []
skeleton: []
armTwist: 0.5
foreArmTwist: 0.5
upperLegTwist: 0.5
legTwist: 0.5
armStretch: 0.05
legStretch: 0.05
feetSpacing: 0
rootMotionBoneName:
hasTranslationDoF: 0
hasExtraRoot: 0
skeletonHasParents: 1
lastHumanDescriptionAvatarSource: {instanceID: 0}
animationType: 0
humanoidOversampling: 1
additionalBone: 0
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,85 @@
%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_Animatable
m_Shader: {fileID: 4800000, guid: ecfa8f5732b504ef98fba10aa18d0326, type: 3}
m_ShaderKeywords:
m_LightmapFlags: 4
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: 2800000, guid: e834c7963556c9b4cbad7f1bee63f597, 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:
- _BumpScale: 1
- _ColorMask: 15
- _Cutoff: 0.5
- _DetailNormalMapScale: 1
- _DstBlend: 0
- _GlossMapScale: 1
- _Glossiness: 0.5
- _GlossyReflections: 1
- _InvFade: 1
- _Metallic: 0
- _Mode: 0
- _OcclusionStrength: 1
- _Parallax: 0.02
- _SmoothnessTextureChannel: 0
- _SpecularHighlights: 1
- _SrcBlend: 1
- _Stencil: 0
- _StencilComp: 8
- _StencilOp: 0
- _StencilReadMask: 255
- _StencilWriteMask: 255
- _UVSec: 0
- _ZWrite: 1
m_Colors:
- _ClipRect: {r: -32767, g: -32767, b: 32767, a: 32767}
- _Color: {r: 1, g: 1, b: 1, a: 1}
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
- _TintColor: {r: 1, g: 1, b: 1, a: 1}

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 63570eac008cb9a469a56188251c00c7
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 2100000
userData:
assetBundleName:
assetBundleVariant:

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

View File

@ -0,0 +1,132 @@
fileFormatVersion: 2
guid: e834c7963556c9b4cbad7f1bee63f597
TextureImporter:
fileIDToRecycleName: {}
externalObjects: {}
serializedVersion: 7
mipmaps:
mipMapMode: 0
enableMipMap: 0
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: 1
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
- serializedVersion: 2
buildTarget: Standalone
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
- serializedVersion: 2
buildTarget: iPhone
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
- serializedVersion: 2
buildTarget: Android
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
- serializedVersion: 2
buildTarget: WebGL
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

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: fd2938b6280d84e328d330be2aedd18f
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 100100000
userData:
assetBundleName:
assetBundleVariant:

File diff suppressed because it is too large Load Diff

View File

@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 6a4ce081d093247179eacb67ef049408
guid: 386ec701f53b9e1409c2448a9ac4194e
DefaultImporter:
externalObjects: {}
userData:

View File

@ -0,0 +1,10 @@
{
"name": "Coffee.UIParticle.Demo",
"references": [
"Coffee.UIParticle"
],
"optionalUnityReferences": [],
"includePlatforms": [],
"excludePlatforms": [],
"allowUnsafeCode": false
}

View File

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 7a2546af409064ee88073040a7454090
AssemblyDefinitionImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

BIN
Samples~/Demo/Light_Frame.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

View File

@ -0,0 +1,100 @@
fileFormatVersion: 2
guid: 077b84be6d052c34d933c79ef500be13
timeCreated: 1472624687
licenseType: Pro
TextureImporter:
fileIDToRecycleName: {}
serializedVersion: 4
mipmaps:
mipMapMode: 0
enableMipMap: 0
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
isReadable: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: -1
maxTextureSize: 2048
textureSettings:
filterMode: -1
aniso: -1
mipBias: -1
wrapMode: 1
nPOTScale: 0
lightmap: 0
compressionQuality: 50
spriteMode: 1
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spritePixelsToUnits: 100
alphaUsage: 1
alphaIsTransparency: 1
spriteTessellationDetail: -1
textureType: 8
textureShape: 1
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
platformSettings:
- buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
- buildTarget: Standalone
maxTextureSize: 2048
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
- buildTarget: iPhone
maxTextureSize: 2048
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
- buildTarget: Android
maxTextureSize: 2048
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
- buildTarget: WebGL
maxTextureSize: 2048
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
spritePackingTag:
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,84 @@
%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: UIAdditive
m_Shader: {fileID: 4800000, guid: ecfa8f5732b504ef98fba10aa18d0326, type: 3}
m_ShaderKeywords:
m_LightmapFlags: 4
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: 2800000, guid: 975570a90d56c477582e12d440dc9931, 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:
- _BumpScale: 1
- _ColorMask: 15
- _Cutoff: 0.5
- _DetailNormalMapScale: 1
- _DstBlend: 0
- _GlossMapScale: 1
- _Glossiness: 0.5
- _GlossyReflections: 1
- _Metallic: 0
- _Mode: 0
- _OcclusionStrength: 1
- _Parallax: 0.02
- _SmoothnessTextureChannel: 0
- _SpecularHighlights: 1
- _SrcBlend: 1
- _Stencil: 0
- _StencilComp: 8
- _StencilOp: 0
- _StencilReadMask: 255
- _StencilWriteMask: 255
- _UVSec: 0
- _UseUIAlphaClip: 0
- _ZWrite: 1
m_Colors:
- _ClipRect: {r: -32767, g: -32767, b: 32767, a: 32767}
- _Color: {r: 1, g: 1, b: 1, a: 1}
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: e44a36783dcfc43bdab399a1adcef4f5
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 2100000
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,335 @@
/// Credit glennpow, Zarlang
/// Sourced from - http://forum.unity3d.com/threads/free-script-particle-systems-in-ui-screen-space-overlay.406862/
/// Updated by Zarlang with a more robust implementation, including TextureSheet annimation support
using UnityEngine;
using UnityEngine.UI;
namespace Coffee.UIExtensions.Demos
{
#if UNITY_5_3_OR_NEWER
[ExecuteInEditMode]
[RequireComponent(typeof(CanvasRenderer), typeof(ParticleSystem))]
public class UIParticleSystem_Demo : MaskableGraphic
{
[Tooltip("Having this enabled run the system in LateUpdate rather than in Update making it faster but less precise (more clunky)")]
public bool fixedTime = true;
private Transform _transform;
private ParticleSystem pSystem;
private ParticleSystem.Particle[] particles;
private UIVertex[] _quad = new UIVertex[4];
private Vector4 imageUV = Vector4.zero;
private ParticleSystem.TextureSheetAnimationModule textureSheetAnimation;
private int textureSheetAnimationFrames;
private Vector2 textureSheetAnimationFrameSize;
private ParticleSystemRenderer pRenderer;
private Material currentMaterial;
private Texture currentTexture;
#if UNITY_5_5_OR_NEWER
private ParticleSystem.MainModule mainModule;
#endif
public override Texture mainTexture
{
get
{
return currentTexture;
}
}
protected bool Initialize()
{
// initialize members
if (_transform == null)
{
_transform = transform;
}
if (pSystem == null)
{
pSystem = GetComponent<ParticleSystem>();
if (pSystem == null)
{
return false;
}
#if UNITY_5_5_OR_NEWER
mainModule = pSystem.main;
if (pSystem.main.maxParticles > 14000)
{
mainModule.maxParticles = 14000;
}
#else
if (pSystem.maxParticles > 14000)
pSystem.maxParticles = 14000;
#endif
pRenderer = pSystem.GetComponent<ParticleSystemRenderer>();
if (pRenderer != null)
pRenderer.enabled = false;
//Shader foundShader = Shader.Find("UI Extensions/Particles/Additive");
//Material pMaterial = new Material(foundShader);
//if (material == null)
//material = pMaterial;
currentMaterial = material;
if (currentMaterial && currentMaterial.HasProperty("_MainTex"))
{
currentTexture = currentMaterial.mainTexture;
if (currentTexture == null)
currentTexture = Texture2D.whiteTexture;
}
material = currentMaterial;
// automatically set scaling
#if UNITY_5_5_OR_NEWER
mainModule.scalingMode = ParticleSystemScalingMode.Hierarchy;
#else
pSystem.scalingMode = ParticleSystemScalingMode.Hierarchy;
#endif
particles = null;
}
#if UNITY_5_5_OR_NEWER
if (particles == null)
particles = new ParticleSystem.Particle[pSystem.main.maxParticles];
#else
if (particles == null)
particles = new ParticleSystem.Particle[pSystem.maxParticles];
#endif
imageUV = new Vector4(0, 0, 1, 1);
// prepare texture sheet animation
textureSheetAnimation = pSystem.textureSheetAnimation;
textureSheetAnimationFrames = 0;
textureSheetAnimationFrameSize = Vector2.zero;
if (textureSheetAnimation.enabled)
{
textureSheetAnimationFrames = textureSheetAnimation.numTilesX * textureSheetAnimation.numTilesY;
textureSheetAnimationFrameSize = new Vector2(1f / textureSheetAnimation.numTilesX, 1f / textureSheetAnimation.numTilesY);
}
return true;
}
protected override void Awake()
{
base.Awake();
if (!Initialize())
enabled = false;
}
protected override void OnPopulateMesh(VertexHelper vh)
{
#if UNITY_EDITOR
if (!Application.isPlaying)
{
if (!Initialize())
{
return;
}
}
#endif
// prepare vertices
vh.Clear();
if (!gameObject.activeInHierarchy)
{
return;
}
Vector2 temp = Vector2.zero;
Vector2 corner1 = Vector2.zero;
Vector2 corner2 = Vector2.zero;
// iterate through current particles
int count = pSystem.GetParticles(particles);
for (int i = 0; i < count; ++i)
{
ParticleSystem.Particle particle = particles[i];
// get particle properties
#if UNITY_5_5_OR_NEWER
Vector2 position = (mainModule.simulationSpace == ParticleSystemSimulationSpace.Local ? particle.position : _transform.InverseTransformPoint(particle.position));
#else
Vector2 position = (pSystem.simulationSpace == ParticleSystemSimulationSpace.Local ? particle.position : _transform.InverseTransformPoint(particle.position));
#endif
float rotation = -particle.rotation * Mathf.Deg2Rad;
float rotation90 = rotation + Mathf.PI / 2;
Color32 color = particle.GetCurrentColor(pSystem);
float size = particle.GetCurrentSize(pSystem) * 0.5f;
// apply scale
#if UNITY_5_5_OR_NEWER
if (mainModule.scalingMode == ParticleSystemScalingMode.Shape)
position /= canvas.scaleFactor;
#else
if (pSystem.scalingMode == ParticleSystemScalingMode.Shape)
position /= canvas.scaleFactor;
#endif
// apply texture sheet animation
Vector4 particleUV = imageUV;
if (textureSheetAnimation.enabled)
{
#if UNITY_5_5_OR_NEWER
float frameProgress = 1 - (particle.remainingLifetime / particle.startLifetime);
if (textureSheetAnimation.frameOverTime.curveMin != null)
{
frameProgress = textureSheetAnimation.frameOverTime.curveMin.Evaluate(1 - (particle.remainingLifetime / particle.startLifetime));
}
else if (textureSheetAnimation.frameOverTime.curve != null)
{
frameProgress = textureSheetAnimation.frameOverTime.curve.Evaluate(1 - (particle.remainingLifetime / particle.startLifetime));
}
else if (textureSheetAnimation.frameOverTime.constant > 0)
{
frameProgress = textureSheetAnimation.frameOverTime.constant - (particle.remainingLifetime / particle.startLifetime);
}
#else
float frameProgress = 1 - (particle.lifetime / particle.startLifetime);
#endif
frameProgress = Mathf.Repeat(frameProgress * textureSheetAnimation.cycleCount, 1);
int frame = 0;
switch (textureSheetAnimation.animation)
{
case ParticleSystemAnimationType.WholeSheet:
frame = Mathf.FloorToInt(frameProgress * textureSheetAnimationFrames);
break;
case ParticleSystemAnimationType.SingleRow:
frame = Mathf.FloorToInt(frameProgress * textureSheetAnimation.numTilesX);
int row = textureSheetAnimation.rowIndex;
// if (textureSheetAnimation.useRandomRow) { // FIXME - is this handled internally by rowIndex?
// row = Random.Range(0, textureSheetAnimation.numTilesY, using: particle.randomSeed);
// }
frame += row * textureSheetAnimation.numTilesX;
break;
}
frame %= textureSheetAnimationFrames;
particleUV.x = (frame % textureSheetAnimation.numTilesX) * textureSheetAnimationFrameSize.x;
particleUV.y = Mathf.FloorToInt(frame / textureSheetAnimation.numTilesX) * textureSheetAnimationFrameSize.y;
particleUV.z = particleUV.x + textureSheetAnimationFrameSize.x;
particleUV.w = particleUV.y + textureSheetAnimationFrameSize.y;
}
temp.x = particleUV.x;
temp.y = particleUV.y;
_quad[0] = UIVertex.simpleVert;
_quad[0].color = color;
_quad[0].uv0 = temp;
temp.x = particleUV.x;
temp.y = particleUV.w;
_quad[1] = UIVertex.simpleVert;
_quad[1].color = color;
_quad[1].uv0 = temp;
temp.x = particleUV.z;
temp.y = particleUV.w;
_quad[2] = UIVertex.simpleVert;
_quad[2].color = color;
_quad[2].uv0 = temp;
temp.x = particleUV.z;
temp.y = particleUV.y;
_quad[3] = UIVertex.simpleVert;
_quad[3].color = color;
_quad[3].uv0 = temp;
if (rotation == 0)
{
// no rotation
corner1.x = position.x - size;
corner1.y = position.y - size;
corner2.x = position.x + size;
corner2.y = position.y + size;
temp.x = corner1.x;
temp.y = corner1.y;
_quad[0].position = temp;
temp.x = corner1.x;
temp.y = corner2.y;
_quad[1].position = temp;
temp.x = corner2.x;
temp.y = corner2.y;
_quad[2].position = temp;
temp.x = corner2.x;
temp.y = corner1.y;
_quad[3].position = temp;
}
else
{
// apply rotation
Vector2 right = new Vector2(Mathf.Cos(rotation), Mathf.Sin(rotation)) * size;
Vector2 up = new Vector2(Mathf.Cos(rotation90), Mathf.Sin(rotation90)) * size;
_quad[0].position = position - right - up;
_quad[1].position = position - right + up;
_quad[2].position = position + right + up;
_quad[3].position = position + right - up;
}
vh.AddUIVertexQuad(_quad);
}
}
void Update()
{
if (!fixedTime && Application.isPlaying)
{
pSystem.Simulate(Time.unscaledDeltaTime, false, false, true);
SetAllDirty();
if ((currentMaterial != null && currentTexture != currentMaterial.mainTexture) ||
(material != null && currentMaterial != null && material.shader != currentMaterial.shader))
{
pSystem = null;
Initialize();
}
}
}
void LateUpdate()
{
if (!Application.isPlaying)
{
SetAllDirty();
}
else
{
if (fixedTime)
{
pSystem.Simulate(Time.unscaledDeltaTime, false, false, true);
SetAllDirty();
if ((currentMaterial != null && currentTexture != currentMaterial.mainTexture) ||
(material != null && currentMaterial != null && material.shader != currentMaterial.shader))
{
pSystem = null;
Initialize();
}
}
}
if (material == currentMaterial)
return;
pSystem = null;
Initialize();
}
}
#endif
}

View File

@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: f5f85388e938d9e4599afc6d9441ed57
timeCreated: 1464383716
licenseType: Pro
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,111 @@
using UnityEngine;
using UnityEngine.SceneManagement;
using UnityEngine.UI;
using System.Collections.Generic;
namespace Coffee.UIExtensions.Demo
{
public class UIParticle_Demo : MonoBehaviour
{
[SerializeField] ParticleSystem [] m_ParticleSystems = new ParticleSystem [0];
[SerializeField] List<Transform> m_ScalingByTransforms = new List<Transform> ();
[SerializeField] List<UIParticle> m_ScalingByUIParticles = new List<UIParticle> ();
public void SetTimeScale (float scale)
{
Time.timeScale = scale;
}
public void EnableTrailRibbon (bool ribbonMode)
{
foreach (var p in m_ParticleSystems)
{
var trails = p.trails;
trails.mode = ribbonMode ? ParticleSystemTrailMode.Ribbon : ParticleSystemTrailMode.PerParticle;
}
}
public void EnableSprite (bool enabled)
{
foreach (var p in m_ParticleSystems)
{
var tex = p.textureSheetAnimation;
tex.enabled = enabled;
}
}
public void EnableMask (bool enabled)
{
foreach (var m in FindObjectsOfType<Mask> ())
{
m.enabled = enabled;
}
}
public void EnableMask2D (bool enabled)
{
foreach (var m in FindObjectsOfType<RectMask2D> ())
{
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);
}
public void SetUIParticleScale (float scale)
{
foreach (var uip in FindObjectsOfType<UIParticle> ())
{
uip.scale = scale;
}
}
public void LoadScene (string name)
{
SceneManager.LoadScene (name);
}
public void PlayAllParticleEffect ()
{
foreach (var animator in FindObjectsOfType<Animator> ())
{
animator.Play ("Play");
}
foreach (var particle in FindObjectsOfType<ParticleSystem> ())
{
particle.Play ();
}
}
public void SetWorldSpase (bool flag)
{
if (flag)
{
GetComponent<Canvas> ().renderMode = RenderMode.ScreenSpaceCamera;
GetComponent<Canvas> ().renderMode = RenderMode.WorldSpace;
transform.rotation = Quaternion.Euler (new Vector3 (0, 6, 0));
}
}
public void SetScreenSpase (bool flag)
{
if (flag)
{
GetComponent<Canvas> ().renderMode = RenderMode.ScreenSpaceCamera;
}
}
public void SetOverlay (bool flag)
{
if (flag)
{
GetComponent<Canvas> ().renderMode = RenderMode.ScreenSpaceOverlay;
}
}
}
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: eba3b7ce20b7f470a891c84def6be7e4
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,33 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!84 &8400000
RenderTexture:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_Name: UIParticle_Demo
m_ImageContentsHash:
serializedVersion: 2
Hash: 00000000000000000000000000000000
m_ForcedFallbackFormat: 4
m_DownscaleFallback: 0
m_Width: 256
m_Height: 256
m_AntiAliasing: 1
m_DepthFormat: 0
m_ColorFormat: 0
m_MipMap: 0
m_GenerateMips: 1
m_SRGB: 0
m_UseDynamicScale: 0
m_BindMS: 0
m_TextureSettings:
serializedVersion: 2
m_FilterMode: 1
m_Aniso: 0
m_MipBias: 0
m_WrapU: 1
m_WrapV: 1
m_WrapW: 1
m_Dimension: 2
m_VolumeDepth: 1

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: ab4cc8f5f51c14175af41c4daa68cbf5
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 8400000
userData:
assetBundleName:
assetBundleVariant:

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 1fc4d0f41c2bd3745b97b439cca95c22
timeCreated: 1494672490
licenseType: Store
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 5d682dd3e44264ff69bd02590123ea73
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 100100000
userData:
assetBundleName:
assetBundleVariant:

View File

@ -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}

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 776677ab3818fb249adaca05f4e04545
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 0
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,85 @@
%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_Fire
m_Shader: {fileID: 4800000, guid: ecfa8f5732b504ef98fba10aa18d0326, type: 3}
m_ShaderKeywords:
m_LightmapFlags: 4
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: 2800000, guid: df33a97a787f8a64a82b59ee073e7cd7, 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:
- _BumpScale: 1
- _ColorMask: 15
- _Cutoff: 0.5
- _DetailNormalMapScale: 1
- _DstBlend: 0
- _GlossMapScale: 1
- _Glossiness: 0.5
- _GlossyReflections: 1
- _InvFade: 1
- _Metallic: 0
- _Mode: 0
- _OcclusionStrength: 1
- _Parallax: 0.02
- _SmoothnessTextureChannel: 0
- _SpecularHighlights: 1
- _SrcBlend: 1
- _Stencil: 0
- _StencilComp: 8
- _StencilOp: 0
- _StencilReadMask: 255
- _StencilWriteMask: 255
- _UVSec: 0
- _ZWrite: 1
m_Colors:
- _ClipRect: {r: -32767, g: -32767, b: 32767, a: 32767}
- _Color: {r: 1, g: 1, b: 1, a: 1}
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
- _TintColor: {r: 1, g: 1, b: 1, a: 1}

View File

@ -0,0 +1,9 @@
fileFormatVersion: 2
guid: 57cef6c0f7570214991e091275f08894
timeCreated: 1494793998
licenseType: Store
NativeFormatImporter:
mainObjectFileID: 2100000
userData:
assetBundleName:
assetBundleVariant:

View File

@ -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}

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 7a306caa8f9f7ed40a5361ce411cdf1b
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 2100000
userData:
assetBundleName:
assetBundleVariant:

Binary file not shown.

View File

@ -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:

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.9 MiB

After

Width:  |  Height:  |  Size: 5.4 MiB

View File

@ -0,0 +1,92 @@
fileFormatVersion: 2
guid: df33a97a787f8a64a82b59ee073e7cd7
timeCreated: 1494793876
licenseType: Store
TextureImporter:
fileIDToRecycleName: {}
serializedVersion: 4
mipmaps:
mipMapMode: 0
enableMipMap: 1
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
isReadable: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
filterMode: 2
aniso: 16
mipBias: -1
wrapMode: -1
nPOTScale: 1
lightmap: 0
compressionQuality: 50
spriteMode: 0
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spritePixelsToUnits: 100
alphaUsage: 1
alphaIsTransparency: 0
spriteTessellationDetail: -1
textureType: 0
textureShape: 1
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
platformSettings:
- buildTarget: DefaultTexturePlatform
maxTextureSize: 4096
textureFormat: -1
textureCompression: 2
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
- buildTarget: Standalone
maxTextureSize: 4096
textureFormat: -1
textureCompression: 2
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
- buildTarget: Android
maxTextureSize: 4096
textureFormat: -1
textureCompression: 2
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
- buildTarget: WebGL
maxTextureSize: 4096
textureFormat: -1
textureCompression: 2
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
spritePackingTag:
userData:
assetBundleName:
assetBundleVariant:

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 93be31a30fbb04a19ab014d2b7c8489e
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 100100000
userData:
assetBundleName:
assetBundleVariant:

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 51072f6aafc134e4bac206c56bc6876b
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,85 @@
%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_Spread
m_Shader: {fileID: 4800000, guid: ecfa8f5732b504ef98fba10aa18d0326, type: 3}
m_ShaderKeywords:
m_LightmapFlags: 4
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: 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}
- _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:
- _BumpScale: 1
- _ColorMask: 15
- _Cutoff: 0.5
- _DetailNormalMapScale: 1
- _DstBlend: 0
- _GlossMapScale: 1
- _Glossiness: 0.5
- _GlossyReflections: 1
- _InvFade: 1
- _Metallic: 0
- _Mode: 0
- _OcclusionStrength: 1
- _Parallax: 0.02
- _SmoothnessTextureChannel: 0
- _SpecularHighlights: 1
- _SrcBlend: 1
- _Stencil: 0
- _StencilComp: 8
- _StencilOp: 0
- _StencilReadMask: 255
- _StencilWriteMask: 255
- _UVSec: 0
- _ZWrite: 1
m_Colors:
- _ClipRect: {r: -32767, g: -32767, b: 32767, a: 32767}
- _Color: {r: 1, g: 1, b: 1, a: 1}
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
- _TintColor: {r: 1, g: 1, b: 1, a: 1}

View File

@ -0,0 +1,9 @@
fileFormatVersion: 2
guid: 356b9d0e2cad849c3b53c7e9e1680cb7
timeCreated: 1494793998
licenseType: Store
NativeFormatImporter:
mainObjectFileID: 2100000
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,152 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!74 &7400000
AnimationClip:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_Name: UIParticle_Demo_Wave
serializedVersion: 6
m_Legacy: 0
m_Compressed: 0
m_UseHighQualityCurve: 1
m_RotationCurves: []
m_CompressedRotationCurves: []
m_EulerCurves: []
m_PositionCurves: []
m_ScaleCurves: []
m_FloatCurves:
- curve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0
value: 0
inSlope: 0
outSlope: 60
tangentMode: 69
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
- serializedVersion: 3
time: 0.5
value: 30
inSlope: 0
outSlope: 0
tangentMode: 136
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
- serializedVersion: 3
time: 1.5
value: -30
inSlope: 0
outSlope: 0
tangentMode: 136
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
- serializedVersion: 3
time: 2
value: 0
inSlope: 60
outSlope: 0
tangentMode: 69
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
attribute: m_AnchoredPosition.y
path:
classID: 224
script: {fileID: 0}
m_PPtrCurves: []
m_SampleRate: 30
m_WrapMode: 0
m_Bounds:
m_Center: {x: 0, y: 0, z: 0}
m_Extent: {x: 0, y: 0, z: 0}
m_ClipBindingConstant:
genericBindings:
- serializedVersion: 2
path: 0
attribute: 538195251
script: {fileID: 0}
typeID: 224
customType: 28
isPPtrCurve: 0
pptrCurveMapping: []
m_AnimationClipSettings:
serializedVersion: 2
m_AdditiveReferencePoseClip: {fileID: 0}
m_AdditiveReferencePoseTime: 0
m_StartTime: 0
m_StopTime: 2
m_OrientationOffsetY: 0
m_Level: 0
m_CycleOffset: 0
m_HasAdditiveReferencePose: 0
m_LoopTime: 1
m_LoopBlend: 0
m_LoopBlendOrientation: 0
m_LoopBlendPositionY: 0
m_LoopBlendPositionXZ: 0
m_KeepOriginalOrientation: 0
m_KeepOriginalPositionY: 1
m_KeepOriginalPositionXZ: 0
m_HeightFromFeet: 0
m_Mirror: 0
m_EditorCurves:
- curve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0
value: 0
inSlope: 0
outSlope: 60
tangentMode: 69
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
- serializedVersion: 3
time: 0.5
value: 30
inSlope: 0
outSlope: 0
tangentMode: 136
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
- serializedVersion: 3
time: 1.5
value: -30
inSlope: 0
outSlope: 0
tangentMode: 136
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
- serializedVersion: 3
time: 2
value: 0
inSlope: 60
outSlope: 0
tangentMode: 69
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
attribute: m_AnchoredPosition.y
path:
classID: 224
script: {fileID: 0}
m_EulerEditorCurves: []
m_HasGenericRootTransform: 0
m_HasMotionFloatCurves: 0
m_GenerateMotionCurves: 0
m_Events: []

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 5c9638a898a1d47de8e77f58e7efa01f
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 7400000
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,69 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!91 &9100000
AnimatorController:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_Name: UIParticle_Demo_Wave
serializedVersion: 5
m_AnimatorParameters: []
m_AnimatorLayers:
- serializedVersion: 5
m_Name: Base Layer
m_StateMachine: {fileID: 1107303963999173640}
m_Mask: {fileID: 0}
m_Motions: []
m_Behaviours: []
m_BlendingMode: 0
m_SyncedLayerIndex: -1
m_DefaultWeight: 0
m_IKPass: 0
m_SyncedLayerAffectsTiming: 0
m_Controller: {fileID: 9100000}
--- !u!1102 &1102311490129699446
AnimatorState:
serializedVersion: 5
m_ObjectHideFlags: 1
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_Name: UIParticle_Demo_Wave
m_Speed: 1
m_CycleOffset: 0
m_Transitions: []
m_StateMachineBehaviours: []
m_Position: {x: 50, y: 50, z: 0}
m_IKOnFeet: 0
m_WriteDefaultValues: 1
m_Mirror: 0
m_SpeedParameterActive: 0
m_MirrorParameterActive: 0
m_CycleOffsetParameterActive: 0
m_TimeParameterActive: 0
m_Motion: {fileID: 7400000, guid: 5c9638a898a1d47de8e77f58e7efa01f, type: 2}
m_Tag:
m_SpeedParameter:
m_MirrorParameter:
m_CycleOffsetParameter:
m_TimeParameter:
--- !u!1107 &1107303963999173640
AnimatorStateMachine:
serializedVersion: 5
m_ObjectHideFlags: 1
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_Name: Base Layer
m_ChildStates:
- serializedVersion: 1
m_State: {fileID: 1102311490129699446}
m_Position: {x: 234, y: 92, z: 0}
m_ChildStateMachines: []
m_AnyStateTransitions: []
m_EntryTransitions: []
m_StateMachineTransitions: {}
m_StateMachineBehaviours: []
m_AnyStatePosition: {x: 50, y: 20, z: 0}
m_EntryPosition: {x: 50, y: 120, z: 0}
m_ExitPosition: {x: 800, y: 120, z: 0}
m_ParentStateMachinePosition: {x: 800, y: 20, z: 0}
m_DefaultState: {fileID: 1102311490129699446}

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 8e7d928ccc1b7404d80e0d0205434aeb
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 9100000
userData:
assetBundleName:
assetBundleVariant:

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 6b0a52075259b45028b8f91c32be0492
timeCreated: 1494672490
licenseType: Store
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:

Binary file not shown.

After

Width:  |  Height:  |  Size: 34 KiB

View File

@ -0,0 +1,57 @@
fileFormatVersion: 2
guid: 925f66fdcc9764b579413b7408c718f2
timeCreated: 1488188399
licenseType: Pro
TextureImporter:
fileIDToRecycleName: {}
serializedVersion: 2
mipmaps:
mipMapMode: 0
enableMipMap: 0
linearTexture: 0
correctGamma: 0
fadeOut: 0
borderMipMap: 0
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
isReadable: 0
grayScaleToAlpha: 0
generateCubemap: 0
cubemapConvolution: 0
cubemapConvolutionSteps: 7
cubemapConvolutionExponent: 1.5
seamlessCubemap: 0
textureFormat: -1
maxTextureSize: 2048
textureSettings:
filterMode: 0
aniso: 16
mipBias: -1
wrapMode: 1
nPOTScale: 0
lightmap: 0
rGBM: 0
compressionQuality: 50
allowsAlphaSplitting: 0
spriteMode: 1
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spritePixelsToUnits: 100
alphaIsTransparency: 1
textureType: 8
buildTargetSettings: []
spriteSheet:
sprites: []
outline: []
spritePackingTag:
userData:
assetBundleName:
assetBundleVariant:

View File

@ -2,6 +2,6 @@ fileFormatVersion: 2
guid: 69deabfe8eed7495886c9daa69c9826a
AssemblyDefinitionImporter:
externalObjects: {}
userData:
userData: '{"OpenSesame":true,"ModifySymbols":""}'
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,90 @@
fileFormatVersion: 2
guid: 7c7d9e45bc2e5d043940f9241153edd5
PluginImporter:
externalObjects: {}
serializedVersion: 2
iconMap: {}
executionOrder: {}
defineConstraints:
- '!OPEN_SESAME_DEV'
isPreloaded: 0
isOverridable: 1
isExplicitlyReferenced: 1
validateReferences: 0
platformData:
- first:
'': Any
second:
enabled: 0
settings:
Exclude Editor: 0
Exclude Linux: 1
Exclude Linux64: 1
Exclude LinuxUniversal: 1
Exclude OSXUniversal: 1
Exclude Win: 1
Exclude Win64: 1
- first:
Any:
second:
enabled: 0
settings: {}
- first:
Editor: Editor
second:
enabled: 1
settings:
CPU: AnyCPU
DefaultValueInitialized: true
OS: AnyOS
- first:
Facebook: Win
second:
enabled: 0
settings:
CPU: AnyCPU
- first:
Facebook: Win64
second:
enabled: 0
settings:
CPU: AnyCPU
- first:
Standalone: Linux
second:
enabled: 0
settings:
CPU: x86
- first:
Standalone: Linux64
second:
enabled: 0
settings:
CPU: x86_64
- first:
Standalone: OSXUniversal
second:
enabled: 0
settings:
CPU: AnyCPU
- first:
Standalone: Win
second:
enabled: 0
settings:
CPU: AnyCPU
- first:
Standalone: Win64
second:
enabled: 0
settings:
CPU: AnyCPU
- first:
Windows Store Apps: WindowsStoreApps
second:
enabled: 0
settings:
CPU: AnyCPU
userData:
assetBundleName:
assetBundleVariant:

View File

@ -3,667 +3,278 @@ using UnityEditor.UI;
using UnityEngine;
using System.Collections.Generic;
using System.Linq;
using UnityEditor.IMGUI.Controls;
using System;
using System.Reflection;
using ShaderPropertyType = Coffee.UIExtensions.UIParticle.AnimatableProperty.ShaderPropertyType;
namespace Coffee.UIExtensions
{
[CustomEditor (typeof (UIParticle))]
[CanEditMultipleObjects]
public class UIParticleEditor : GraphicEditor
{
class AnimatedPropertiesEditor
{
static readonly List<string> s_ActiveNames = new List<string> ();
static readonly System.Text.StringBuilder s_Sb = new System.Text.StringBuilder ();
public string name;
public ShaderPropertyType type;
static string CollectActiveNames (SerializedProperty sp, List<string> result)
{
result.Clear ();
for (int i = 0; i < sp.arraySize; i++)
{
result.Add (sp.GetArrayElementAtIndex (i).FindPropertyRelative ("m_Name").stringValue);
}
s_Sb.Length = 0;
if (result.Count == 0)
{
s_Sb.Append ("Nothing");
}
else
{
result.Aggregate (s_Sb, (a, b) => s_Sb.AppendFormat ("{0}, ", b));
s_Sb.Length -= 2;
}
return s_Sb.ToString ();
}
public static void DrawAnimatableProperties (SerializedProperty sp, Material mat)
{
if (!mat || !mat.shader)
return;
bool isClicked = false;
using (new EditorGUILayout.HorizontalScope (GUILayout.ExpandWidth (false)))
{
var r = EditorGUI.PrefixLabel (EditorGUILayout.GetControlRect (true), new GUIContent (sp.displayName, sp.tooltip));
isClicked = GUI.Button (r, CollectActiveNames (sp, s_ActiveNames), EditorStyles.popup);
}
if (isClicked)
{
GenericMenu gm = new GenericMenu ();
gm.AddItem (new GUIContent ("Nothing"), s_ActiveNames.Count == 0, () =>
{
sp.ClearArray ();
sp.serializedObject.ApplyModifiedProperties ();
});
for (int i = 0; i < sp.arraySize; i++)
{
var p = sp.GetArrayElementAtIndex (i);
var name = p.FindPropertyRelative ("m_Name").stringValue;
var type = (ShaderPropertyType)p.FindPropertyRelative ("m_Type").intValue;
AddMenu (gm, sp, new AnimatedPropertiesEditor () { name = name, type = type }, false);
}
for (int i = 0; i < ShaderUtil.GetPropertyCount (mat.shader); i++)
{
var pName = ShaderUtil.GetPropertyName (mat.shader, i);
var type = (ShaderPropertyType)ShaderUtil.GetPropertyType (mat.shader, i);
AddMenu (gm, sp, new AnimatedPropertiesEditor () { name = pName, type = type }, true);
if (type == ShaderPropertyType.Texture)
{
AddMenu (gm, sp, new AnimatedPropertiesEditor () { name = pName + "_ST", type = ShaderPropertyType.Vector }, true);
AddMenu (gm, sp, new AnimatedPropertiesEditor () { name = pName + "_HDR", type = ShaderPropertyType.Vector }, true);
AddMenu (gm, sp, new AnimatedPropertiesEditor () { name = pName + "_TexelSize", type = ShaderPropertyType.Vector }, true);
}
}
gm.ShowAsContext ();
}
}
public static void AddMenu (GenericMenu menu, SerializedProperty sp, AnimatedPropertiesEditor property, bool add)
{
if (add && s_ActiveNames.Contains (property.name))
return;
menu.AddItem (new GUIContent (string.Format ("{0} ({1})", property.name, property.type)), s_ActiveNames.Contains (property.name), () =>
{
var index = s_ActiveNames.IndexOf (property.name);
if (0 <= index)
{
sp.DeleteArrayElementAtIndex (index);
}
else
{
sp.InsertArrayElementAtIndex (sp.arraySize);
var p = sp.GetArrayElementAtIndex (sp.arraySize - 1);
p.FindPropertyRelative ("m_Name").stringValue = property.name;
p.FindPropertyRelative ("m_Type").intValue = (int)property.type;
}
sp.serializedObject.ApplyModifiedProperties ();
});
}
}
//################################
// Constant or Static Members.
//################################
static readonly GUIContent s_ContentParticleMaterial = new GUIContent ("Particle Material", "The material for rendering particles");
static readonly GUIContent s_ContentTrailMaterial = new GUIContent ("Trail Material", "The material for rendering particle trails");
static readonly List<ParticleSystem> s_ParticleSystems = new List<ParticleSystem> ();
static readonly Matrix4x4 s_ArcHandleOffsetMatrix = Matrix4x4.TRS (Vector3.zero, Quaternion.AngleAxis (90f, Vector3.right) * Quaternion.AngleAxis (90f, Vector3.up), Vector3.one);
static readonly Dictionary<string, MethodInfo> s_InternalMethods = new Dictionary<string, MethodInfo> ();
static readonly Color s_GizmoColor = new Color (1f, 0.7f, 0.7f, 0.9f);
static readonly Color s_ShapeGizmoThicknessTint = new Color (0.7f, 0.7f, 0.7f, 1.0f);
static Material s_Material;
static readonly List<string> s_MaskablePropertyNames = new List<string> ()
{
"_Stencil",
"_StencilComp",
"_StencilOp",
"_StencilWriteMask",
"_StencilReadMask",
"_ColorMask",
};
//################################
// Public/Protected Members.
//################################
/// <summary>
/// This function is called when the object becomes enabled and active.
/// </summary>
protected override void OnEnable ()
{
base.OnEnable ();
_spParticleSystem = serializedObject.FindProperty ("m_ParticleSystem");
_spTrailParticle = serializedObject.FindProperty ("m_TrailParticle");
_spScale = serializedObject.FindProperty ("m_Scale");
_spIgnoreParent = serializedObject.FindProperty ("m_IgnoreParent");
_spAnimatableProperties = serializedObject.FindProperty ("m_AnimatableProperties");
if (!s_Material)
{
s_Material = Call<Material> (typeof (Material), "GetDefaultMaterial");
}
_particles = targets.Cast<UIParticle> ().ToArray ();
}
/// <summary>
/// Implement this function to make a custom inspector.
/// </summary>
public override void OnInspectorGUI ()
{
serializedObject.Update ();
EditorGUILayout.PropertyField (_spParticleSystem);
EditorGUI.indentLevel++;
var ps = _spParticleSystem.objectReferenceValue as ParticleSystem;
if (ps)
{
var pr = ps.GetComponent<ParticleSystemRenderer> ();
var sp = new SerializedObject (pr).FindProperty ("m_Materials");
EditorGUILayout.PropertyField (sp.GetArrayElementAtIndex (0), s_ContentParticleMaterial);
EditorGUILayout.PropertyField (sp.GetArrayElementAtIndex (1), s_ContentTrailMaterial);
sp.serializedObject.ApplyModifiedProperties ();
if (!Application.isPlaying && pr.enabled)
{
EditorGUILayout.HelpBox ("ParticleSystemRenderer will be disable on playing.", MessageType.Info);
}
}
EditorGUI.indentLevel--;
EditorGUI.BeginDisabledGroup (true);
EditorGUILayout.PropertyField (_spTrailParticle);
EditorGUI.EndDisabledGroup ();
var current = target as UIParticle;
EditorGUILayout.PropertyField (_spIgnoreParent);
EditorGUI.BeginDisabledGroup (!current.isRoot);
EditorGUILayout.PropertyField (_spScale);
EditorGUI.EndDisabledGroup ();
// AnimatableProperties
AnimatedPropertiesEditor.DrawAnimatableProperties (_spAnimatableProperties, current.material);
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 ();
if (current.maskable && current.material && current.material.shader)
{
var mat = current.material;
var shader = mat.shader;
foreach (var propName in s_MaskablePropertyNames)
{
if (!mat.HasProperty (propName))
{
EditorGUILayout.HelpBox (string.Format ("Shader {0} doesn't have '{1}' property. This graphic is not maskable.", shader.name, propName), MessageType.Warning);
break;
}
}
}
serializedObject.ApplyModifiedProperties ();
}
//################################
// Private Members.
//################################
SerializedProperty _spParticleSystem;
SerializedProperty _spTrailParticle;
SerializedProperty _spScale;
SerializedProperty _spIgnoreParent;
SerializedProperty _spAnimatableProperties;
UIParticle [] _particles;
ArcHandle _arcHandle = new ArcHandle ();
BoxBoundsHandle _boxBoundsHandle = new BoxBoundsHandle ();
SphereBoundsHandle _sphereBoundsHandle = new SphereBoundsHandle ();
Mesh _spriteMesh;
static T Call<T> (Type type, string method, params object [] args)
{
MethodInfo mi;
if (!s_InternalMethods.TryGetValue (method, out mi))
{
mi = type.GetMethod (method, BindingFlags.Static | BindingFlags.NonPublic);
s_InternalMethods.Add (method, mi);
}
return (T)mi.Invoke (null, args);
}
void OnSceneGUI ()
{
Color origCol = Handles.color;
Handles.color = s_GizmoColor;
Matrix4x4 orgMatrix = Handles.matrix;
EditorGUI.BeginChangeCheck ();
foreach (UIParticle uip in _particles)
{
ParticleSystem ps = uip.cachedParticleSystem;
if (!ps || !uip.canvas)
{
continue;
}
var shapeModule = ps.shape;
var mainModule = ps.main;
ParticleSystemShapeType type = shapeModule.shapeType;
Matrix4x4 transformMatrix = new Matrix4x4 ();
if (mainModule.scalingMode == ParticleSystemScalingMode.Local)
{
transformMatrix.SetTRS (ps.transform.position, ps.transform.rotation, ps.transform.localScale);
}
else if (mainModule.scalingMode == ParticleSystemScalingMode.Hierarchy)
{
transformMatrix = ps.transform.localToWorldMatrix;
}
else
{
transformMatrix.SetTRS (ps.transform.position, ps.transform.rotation, ps.transform.lossyScale);
}
bool isBox = (type == ParticleSystemShapeType.Box || type == ParticleSystemShapeType.BoxShell || type == ParticleSystemShapeType.BoxEdge || type == ParticleSystemShapeType.Rectangle);
Vector3 emitterScale = isBox ? Vector3.one : shapeModule.scale;
Matrix4x4 emitterMatrix = Matrix4x4.TRS (shapeModule.position, Quaternion.Euler (shapeModule.rotation), emitterScale);
transformMatrix *= emitterMatrix;
Handles.matrix = transformMatrix;
if (uip.canvas.renderMode == RenderMode.ScreenSpaceOverlay || ps.main.scalingMode == ParticleSystemScalingMode.Hierarchy)
{
Handles.matrix = Handles.matrix * Matrix4x4.Scale (Vector3.one * uip.scale);
}
else
{
Handles.matrix = Handles.matrix * Matrix4x4.Scale (uip.canvas.rootCanvas.transform.localScale * uip.scale);
}
if (type == ParticleSystemShapeType.Sphere)
{
// Thickness
Handles.color *= s_ShapeGizmoThicknessTint;
EditorGUI.BeginChangeCheck ();
//float radiusThickness = Handles.DoSimpleRadiusHandle (Quaternion.identity, Vector3.zero, shapeModule.radius * (1.0f - shapeModule.radiusThickness), false, shapeModule.arc);
float radiusThickness = Handles.RadiusHandle (Quaternion.identity, Vector3.zero, shapeModule.radius * (1.0f - shapeModule.radiusThickness), false);
if (EditorGUI.EndChangeCheck ())
{
Undo.RecordObject (ps, "Sphere Thickness Handle Change");
shapeModule.radiusThickness = 1.0f - (radiusThickness / shapeModule.radius);
}
// Sphere
Handles.color = s_GizmoColor;
EditorGUI.BeginChangeCheck ();
//float radius = Handles.DoSimpleRadiusHandle (Quaternion.identity, Vector3.zero, shapeModule.radius, false, shapeModule.arc);
float radius = Handles.RadiusHandle (Quaternion.identity, Vector3.zero, shapeModule.radius, false);
if (EditorGUI.EndChangeCheck ())
{
Undo.RecordObject (ps, "Sphere Handle Change");
shapeModule.radius = radius;
}
// Texture
//Matrix4x4 textureTransform = transformMatrix * Matrix4x4.TRS (Vector3.zero, Quaternion.identity, Vector3.one * shapeModule.radius * 2.0f);
//OnSceneViewTextureGUI (shapeModule, s_SphereMesh, false, s_SphereTextureMaterial, textureTransform);
}
else if (type == ParticleSystemShapeType.Circle)
{
// Thickness
EditorGUI.BeginChangeCheck ();
_arcHandle.angle = shapeModule.arc;
_arcHandle.radius = shapeModule.radius * (1.0f - shapeModule.radiusThickness);
_arcHandle.SetColorWithRadiusHandle (s_ShapeGizmoThicknessTint, 0f);
_arcHandle.angleHandleColor = Color.clear;
using (new Handles.DrawingScope (Handles.matrix * s_ArcHandleOffsetMatrix))
_arcHandle.DrawHandle ();
if (EditorGUI.EndChangeCheck ())
{
Undo.RecordObject (ps, "Circle Thickness Handle Change");
shapeModule.radiusThickness = 1.0f - (_arcHandle.radius / shapeModule.radius);
}
// Circle
EditorGUI.BeginChangeCheck ();
_arcHandle.radius = shapeModule.radius;
_arcHandle.SetColorWithRadiusHandle (Color.white, 0f);
using (new Handles.DrawingScope (Handles.matrix * s_ArcHandleOffsetMatrix))
_arcHandle.DrawHandle ();
if (EditorGUI.EndChangeCheck ())
{
Undo.RecordObject (ps, "Circle Handle Change");
shapeModule.radius = _arcHandle.radius;
shapeModule.arc = _arcHandle.angle;
}
// Texture
//Matrix4x4 textureTransform = transformMatrix * Matrix4x4.TRS (Vector3.zero, Quaternion.Euler (90.0f, 0.0f, 180.0f), Vector3.one * shapeModule.radius * 2.0f);
//OnSceneViewTextureGUI (shapeModule, s_CircleMesh, true, s_TextureMaterial, textureTransform);
}
else if (type == ParticleSystemShapeType.Hemisphere)
{
// Thickness
Handles.color *= s_ShapeGizmoThicknessTint;
EditorGUI.BeginChangeCheck ();
//float radiusThickness = Handles.DoSimpleRadiusHandle (Quaternion.identity, Vector3.zero, shapeModule.radius * (1.0f - shapeModule.radiusThickness), true, shapeModule.arc);
//float radiusThickness = Call<float> (typeof (Handles), "DoSimpleRadiusHandle", Quaternion.identity, Vector3.zero, shapeModule.radius * (1.0f - shapeModule.radiusThickness), true, shapeModule.arc);
float radiusThickness = Handles.RadiusHandle (Quaternion.identity, Vector3.zero, shapeModule.radius * (1.0f - shapeModule.radiusThickness), true);
if (EditorGUI.EndChangeCheck ())
{
Undo.RecordObject (ps, "Hemisphere Thickness Handle Change");
shapeModule.radiusThickness = 1.0f - (radiusThickness / shapeModule.radius);
}
// Hemisphere
Handles.color = s_GizmoColor;
EditorGUI.BeginChangeCheck ();
//float radius = Handles.DoSimpleRadiusHandle (Quaternion.identity, Vector3.zero, shapeModule.radius, true, shapeModule.arc);
float radius = Handles.RadiusHandle (Quaternion.identity, Vector3.zero, shapeModule.radius, true);
if (EditorGUI.EndChangeCheck ())
{
Undo.RecordObject (ps, "Hemisphere Handle Change");
shapeModule.radius = radius;
}
// Texture
//Matrix4x4 textureTransform = transformMatrix * Matrix4x4.TRS (Vector3.zero, Quaternion.identity, Vector3.one * shapeModule.radius * 2.0f);
//OnSceneViewTextureGUI (shapeModule, s_HemisphereMesh, false, s_SphereTextureMaterial, textureTransform);
}
else if (type == ParticleSystemShapeType.Cone)
{
// Thickness
Handles.color *= s_ShapeGizmoThicknessTint;
EditorGUI.BeginChangeCheck ();
float angleThickness = Mathf.Lerp (shapeModule.angle, 0.0f, shapeModule.radiusThickness);
Vector3 radiusThicknessAngleRange = new Vector3 (shapeModule.radius * (1.0f - shapeModule.radiusThickness), angleThickness, mainModule.startSpeedMultiplier);
//radiusThicknessAngleRange = Handles.ConeFrustrumHandle (Quaternion.identity, Vector3.zero, radiusThicknessAngleRange, Handles.ConeHandles.Radius);
#if UNITY_2018_3_OR_NEWER
radiusThicknessAngleRange = Call<Vector3> (typeof (Handles), "ConeFrustrumHandle", Quaternion.identity, Vector3.zero, radiusThicknessAngleRange, 1);
#else
radiusThicknessAngleRange = Call<Vector3> (typeof (Handles), "ConeFrustrumHandle", Quaternion.identity, Vector3.zero, radiusThicknessAngleRange);
#endif
if (EditorGUI.EndChangeCheck ())
{
Undo.RecordObject (ps, "Cone Thickness Handle Change");
shapeModule.radiusThickness = 1.0f - (radiusThicknessAngleRange.x / shapeModule.radius);
}
// Cone
Handles.color = s_GizmoColor;
EditorGUI.BeginChangeCheck ();
Vector3 radiusAngleRange = new Vector3 (shapeModule.radius, shapeModule.angle, mainModule.startSpeedMultiplier);
//radiusAngleRange = Handles.ConeFrustrumHandle (Quaternion.identity, Vector3.zero, radiusAngleRange);
#if UNITY_2018_3_OR_NEWER
radiusAngleRange = Call<Vector3> (typeof (Handles), "ConeFrustrumHandle", Quaternion.identity, Vector3.zero, radiusAngleRange, 7);
#else
radiusAngleRange = Call<Vector3> (typeof (Handles), "ConeFrustrumHandle", Quaternion.identity, Vector3.zero, radiusAngleRange);
#endif
if (EditorGUI.EndChangeCheck ())
{
Undo.RecordObject (ps, "Cone Handle Change");
shapeModule.radius = radiusAngleRange.x;
shapeModule.angle = radiusAngleRange.y;
mainModule.startSpeedMultiplier = radiusAngleRange.z;
}
// Texture
//Matrix4x4 textureTransform = transformMatrix * Matrix4x4.TRS (Vector3.zero, Quaternion.Euler (90.0f, 0.0f, 180.0f), Vector3.one * shapeModule.radius * 2.0f);
//OnSceneViewTextureGUI (shapeModule, s_CircleMesh, true, s_TextureMaterial, textureTransform);
}
else if (type == ParticleSystemShapeType.ConeVolume)
{
// Thickness
Handles.color *= s_ShapeGizmoThicknessTint;
EditorGUI.BeginChangeCheck ();
float angleThickness = Mathf.Lerp (shapeModule.angle, 0.0f, shapeModule.radiusThickness);
Vector3 radiusThicknessAngleLength = new Vector3 (shapeModule.radius * (1.0f - shapeModule.radiusThickness), angleThickness, shapeModule.length);
//radiusThicknessAngleLength = Handles.ConeFrustrumHandle (Quaternion.identity, Vector3.zero, radiusThicknessAngleLength, Handles.ConeHandles.Radius);
#if UNITY_2018_3_OR_NEWER
radiusThicknessAngleLength = Call<Vector3> (typeof (Handles), "ConeFrustrumHandle", Quaternion.identity, Vector3.zero, radiusThicknessAngleLength, 1);
#else
radiusThicknessAngleLength = Call<Vector3> (typeof (Handles), "ConeFrustrumHandle", Quaternion.identity, Vector3.zero, radiusThicknessAngleLength);
#endif
if (EditorGUI.EndChangeCheck ())
{
Undo.RecordObject (ps, "Cone Volume Thickness Handle Change");
shapeModule.radiusThickness = 1.0f - (radiusThicknessAngleLength.x / shapeModule.radius);
}
// Cone
Handles.color = s_GizmoColor;
EditorGUI.BeginChangeCheck ();
Vector3 radiusAngleLength = new Vector3 (shapeModule.radius, shapeModule.angle, shapeModule.length);
//radiusAngleLength = Handles.ConeFrustrumHandle (Quaternion.identity, Vector3.zero, radiusAngleLength);
#if UNITY_2018_3_OR_NEWER
radiusAngleLength = Call<Vector3> (typeof (Handles), "ConeFrustrumHandle", Quaternion.identity, Vector3.zero, radiusAngleLength, 7);
#else
radiusAngleLength = Call<Vector3> (typeof (Handles), "ConeFrustrumHandle", Quaternion.identity, Vector3.zero, radiusAngleLength);
#endif
if (EditorGUI.EndChangeCheck ())
{
Undo.RecordObject (ps, "Cone Volume Handle Change");
shapeModule.radius = radiusAngleLength.x;
shapeModule.angle = radiusAngleLength.y;
shapeModule.length = radiusAngleLength.z;
}
// Texture
//Matrix4x4 textureTransform = transformMatrix * Matrix4x4.TRS (Vector3.zero, Quaternion.Euler (90.0f, 0.0f, 180.0f), Vector3.one * shapeModule.radius * 2.0f);
//OnSceneViewTextureGUI (shapeModule, s_CircleMesh, true, s_TextureMaterial, textureTransform);
}
else if (type == ParticleSystemShapeType.Box || type == ParticleSystemShapeType.BoxShell || type == ParticleSystemShapeType.BoxEdge)
{
EditorGUI.BeginChangeCheck ();
_boxBoundsHandle.center = Vector3.zero;
_boxBoundsHandle.size = shapeModule.scale;
_boxBoundsHandle.DrawHandle ();
if (EditorGUI.EndChangeCheck ())
{
Undo.RecordObject (ps, "Box Handle Change");
shapeModule.scale = _boxBoundsHandle.size;
}
//Matrix4x4 textureTransform = transformMatrix * Matrix4x4.TRS (new Vector3 (0.0f, 0.0f, -m_BoxBoundsHandle.size.z * 0.5f), Quaternion.identity, m_BoxBoundsHandle.size);
//OnSceneViewTextureGUI (shapeModule, s_QuadMesh, true, s_TextureMaterial, textureTransform);
}
else if (type == ParticleSystemShapeType.Donut)
{
// Radius
EditorGUI.BeginChangeCheck ();
_arcHandle.radius = shapeModule.radius;
_arcHandle.angle = shapeModule.arc;
_arcHandle.SetColorWithRadiusHandle (Color.white, 0f);
_arcHandle.wireframeColor = Color.clear;
using (new Handles.DrawingScope (Handles.matrix * s_ArcHandleOffsetMatrix))
_arcHandle.DrawHandle ();
if (EditorGUI.EndChangeCheck ())
{
Undo.RecordObject (ps, "Donut Handle Change");
shapeModule.radius = _arcHandle.radius;
shapeModule.arc = _arcHandle.angle;
}
// Donut extents
using (new Handles.DrawingScope (Handles.matrix * s_ArcHandleOffsetMatrix))
{
float excessAngle = shapeModule.arc % 360f;
float angle = Mathf.Abs (shapeModule.arc) >= 360f ? 360f : excessAngle;
Handles.DrawWireArc (new Vector3 (0.0f, shapeModule.donutRadius, 0.0f), Vector3.up, Vector3.forward, angle, shapeModule.radius);
Handles.DrawWireArc (new Vector3 (0.0f, -shapeModule.donutRadius, 0.0f), Vector3.up, Vector3.forward, angle, shapeModule.radius);
Handles.DrawWireArc (Vector3.zero, Vector3.up, Vector3.forward, angle, shapeModule.radius + shapeModule.donutRadius);
Handles.DrawWireArc (Vector3.zero, Vector3.up, Vector3.forward, angle, shapeModule.radius - shapeModule.donutRadius);
if (shapeModule.arc != 360.0f)
{
Quaternion arcRotation = Quaternion.AngleAxis (shapeModule.arc, Vector3.up);
Vector3 capCenter = arcRotation * Vector3.forward * shapeModule.radius;
Handles.DrawWireDisc (capCenter, arcRotation * Vector3.right, shapeModule.donutRadius);
}
}
// Donut thickness
_sphereBoundsHandle.axes = PrimitiveBoundsHandle.Axes.X | PrimitiveBoundsHandle.Axes.Y;
_sphereBoundsHandle.radius = shapeModule.donutRadius * (1.0f - shapeModule.radiusThickness);
_sphereBoundsHandle.center = Vector3.zero;
_sphereBoundsHandle.SetColor (s_ShapeGizmoThicknessTint);
const float handleInterval = 90.0f;
int numOuterRadii = Mathf.Max (1, (int)Mathf.Ceil (shapeModule.arc / handleInterval));
Matrix4x4 donutRadiusStartMatrix = Matrix4x4.TRS (new Vector3 (shapeModule.radius, 0.0f, 0.0f), Quaternion.Euler (90.0f, 0.0f, 0.0f), Vector3.one);
for (int i = 0; i < numOuterRadii; i++)
{
EditorGUI.BeginChangeCheck ();
using (new Handles.DrawingScope (Handles.matrix * (Matrix4x4.Rotate (Quaternion.Euler (0.0f, 0.0f, handleInterval * i)) * donutRadiusStartMatrix)))
_sphereBoundsHandle.DrawHandle ();
if (EditorGUI.EndChangeCheck ())
{
Undo.RecordObject (ps, "Donut Radius Thickness Handle Change");
shapeModule.radiusThickness = 1.0f - (_sphereBoundsHandle.radius / shapeModule.donutRadius);
}
}
// Donut radius
_sphereBoundsHandle.radius = shapeModule.donutRadius;
_sphereBoundsHandle.SetColor (Color.white);
for (int i = 0; i < numOuterRadii; i++)
{
EditorGUI.BeginChangeCheck ();
using (new Handles.DrawingScope (Handles.matrix * (Matrix4x4.Rotate (Quaternion.Euler (0.0f, 0.0f, handleInterval * i)) * donutRadiusStartMatrix)))
_sphereBoundsHandle.DrawHandle ();
if (EditorGUI.EndChangeCheck ())
{
Undo.RecordObject (ps, "Donut Radius Handle Change");
shapeModule.donutRadius = _sphereBoundsHandle.radius;
}
}
// Texture
//Matrix4x4 textureTransform = transformMatrix * Matrix4x4.TRS (new Vector3 (shapeModule.radius, 0.0f, 0.0f), Quaternion.Euler (180.0f, 0.0f, 180.0f), Vector3.one * shapeModule.donutRadius * 2.0f);
//OnSceneViewTextureGUI (shapeModule, s_CircleMesh, true, s_TextureMaterial, textureTransform);
}
else if (type == ParticleSystemShapeType.SingleSidedEdge)
{
EditorGUI.BeginChangeCheck ();
//float radius = Handles.DoSimpleEdgeHandle (Quaternion.identity, Vector3.zero, shapeModule.radius);
float radius = Call<float> (typeof (Handles), "DoSimpleEdgeHandle", Quaternion.identity, Vector3.zero, shapeModule.radius);
if (EditorGUI.EndChangeCheck ())
{
Undo.RecordObject (ps, "Edge Handle Change");
shapeModule.radius = radius;
}
}
else if (type == ParticleSystemShapeType.Mesh)
{
Mesh mesh = shapeModule.mesh;
if (mesh)
{
bool orgWireframeMode = GL.wireframe;
GL.wireframe = true;
s_Material.SetPass (0);
Graphics.DrawMeshNow (mesh, transformMatrix);
GL.wireframe = orgWireframeMode;
//OnSceneViewTextureGUI (shapeModule, mesh, false, s_TextureMaterial, transformMatrix);
}
}
else if (type == ParticleSystemShapeType.Rectangle)
{
EditorGUI.BeginChangeCheck ();
_boxBoundsHandle.center = Vector3.zero;
_boxBoundsHandle.size = new Vector3 (shapeModule.scale.x, shapeModule.scale.y, 0.0f);
_boxBoundsHandle.DrawHandle ();
if (EditorGUI.EndChangeCheck ())
{
Undo.RecordObject (ps, "Rectangle Handle Change");
shapeModule.scale = new Vector3 (_boxBoundsHandle.size.x, _boxBoundsHandle.size.y, 0.0f);
}
//OnSceneViewTextureGUI (shapeModule, s_QuadMesh, true, s_TextureMaterial, transformMatrix * Matrix4x4.Scale (m_BoxBoundsHandle.size));
}
else if (type == ParticleSystemShapeType.Sprite)
{
Sprite sprite = shapeModule.sprite;
if (sprite)
{
if (!_spriteMesh)
{
_spriteMesh = new Mesh ();
_spriteMesh.name = "ParticleSpritePreview";
_spriteMesh.hideFlags |= HideFlags.HideAndDontSave;
}
_spriteMesh.vertices = Array.ConvertAll (sprite.vertices, i => (Vector3)i);
_spriteMesh.uv = sprite.uv;
_spriteMesh.triangles = Array.ConvertAll (sprite.triangles, i => (int)i);
bool orgWireframeMode = GL.wireframe;
GL.wireframe = true;
s_Material.SetPass (0);
Graphics.DrawMeshNow (_spriteMesh, transformMatrix);
GL.wireframe = orgWireframeMode;
//OnSceneViewTextureGUI (shapeModule, m_SpriteMesh, false, s_TextureMaterial, transformMatrix);
}
}
}
Handles.color = origCol;
Handles.matrix = orgMatrix;
}
}
}
[CustomEditor(typeof(UIParticle))]
[CanEditMultipleObjects]
public class UIParticleEditor : GraphicEditor
{
class AnimatedPropertiesEditor
{
static readonly List<string> s_ActiveNames = new List<string>();
static readonly System.Text.StringBuilder s_Sb = new System.Text.StringBuilder();
public string name;
public ShaderPropertyType type;
static string CollectActiveNames(SerializedProperty sp, List<string> result)
{
result.Clear();
for (int i = 0; i < sp.arraySize; i++)
{
result.Add(sp.GetArrayElementAtIndex(i).FindPropertyRelative("m_Name").stringValue);
}
s_Sb.Length = 0;
if (result.Count == 0)
{
s_Sb.Append("Nothing");
}
else
{
result.Aggregate(s_Sb, (a, b) => s_Sb.AppendFormat("{0}, ", b));
s_Sb.Length -= 2;
}
return s_Sb.ToString();
}
public static void DrawAnimatableProperties(SerializedProperty sp, Material mat)
{
if (!mat || !mat.shader)
return;
bool isClicked = false;
using (new EditorGUILayout.HorizontalScope(GUILayout.ExpandWidth(false)))
{
var r = EditorGUI.PrefixLabel(EditorGUILayout.GetControlRect(true), new GUIContent(sp.displayName, sp.tooltip));
isClicked = GUI.Button(r, CollectActiveNames(sp, s_ActiveNames), EditorStyles.popup);
}
if (isClicked)
{
GenericMenu gm = new GenericMenu();
gm.AddItem(new GUIContent("Nothing"), s_ActiveNames.Count == 0, () =>
{
sp.ClearArray();
sp.serializedObject.ApplyModifiedProperties();
});
for (int i = 0; i < sp.arraySize; i++)
{
var p = sp.GetArrayElementAtIndex(i);
var name = p.FindPropertyRelative("m_Name").stringValue;
var type = (ShaderPropertyType)p.FindPropertyRelative("m_Type").intValue;
AddMenu(gm, sp, new AnimatedPropertiesEditor() { name = name, type = type }, false);
}
for (int i = 0; i < ShaderUtil.GetPropertyCount(mat.shader); i++)
{
var pName = ShaderUtil.GetPropertyName(mat.shader, i);
var type = (ShaderPropertyType)ShaderUtil.GetPropertyType(mat.shader, i);
AddMenu(gm, sp, new AnimatedPropertiesEditor() { name = pName, type = type }, true);
if (type == ShaderPropertyType.Texture)
{
AddMenu(gm, sp, new AnimatedPropertiesEditor() { name = pName + "_ST", type = ShaderPropertyType.Vector }, true);
AddMenu(gm, sp, new AnimatedPropertiesEditor() { name = pName + "_HDR", type = ShaderPropertyType.Vector }, true);
AddMenu(gm, sp, new AnimatedPropertiesEditor() { name = pName + "_TexelSize", type = ShaderPropertyType.Vector }, true);
}
}
gm.ShowAsContext();
}
}
public static void AddMenu(GenericMenu menu, SerializedProperty sp, AnimatedPropertiesEditor property, bool add)
{
if (add && s_ActiveNames.Contains(property.name))
return;
menu.AddItem(new GUIContent(string.Format("{0} ({1})", property.name, property.type)), s_ActiveNames.Contains(property.name), () =>
{
var index = s_ActiveNames.IndexOf(property.name);
if (0 <= index)
{
sp.DeleteArrayElementAtIndex(index);
}
else
{
sp.InsertArrayElementAtIndex(sp.arraySize);
var p = sp.GetArrayElementAtIndex(sp.arraySize - 1);
p.FindPropertyRelative("m_Name").stringValue = property.name;
p.FindPropertyRelative("m_Type").intValue = (int)property.type;
}
sp.serializedObject.ApplyModifiedProperties();
});
}
}
//################################
// Constant or Static Members.
//################################
static readonly GUIContent s_ContentParticleMaterial = new GUIContent("Particle Material", "The material for rendering particles");
static readonly GUIContent s_ContentTrailMaterial = new GUIContent("Trail Material", "The material for rendering particle trails");
static readonly List<ParticleSystem> s_ParticleSystems = new List<ParticleSystem>();
static readonly Color s_GizmoColor = new Color(1f, 0.7f, 0.7f, 0.9f);
static readonly List<string> s_MaskablePropertyNames = new List<string>()
{
"_Stencil",
"_StencilComp",
"_StencilOp",
"_StencilWriteMask",
"_StencilReadMask",
"_ColorMask",
};
//################################
// Public/Protected Members.
//################################
/// <summary>
/// This function is called when the object becomes enabled and active.
/// </summary>
protected override void OnEnable()
{
base.OnEnable();
_spParticleSystem = serializedObject.FindProperty("m_ParticleSystem");
_spTrailParticle = serializedObject.FindProperty("m_TrailParticle");
_spScale = serializedObject.FindProperty("m_Scale");
_spIgnoreParent = serializedObject.FindProperty("m_IgnoreParent");
_spAnimatableProperties = serializedObject.FindProperty("m_AnimatableProperties");
_particles = targets.Cast<UIParticle>().ToArray();
_shapeModuleUIs = null;
var targetsGos = targets.Cast<UIParticle>().Select(x => x.gameObject).ToArray();
_inspector = Resources.FindObjectsOfTypeAll<ParticleSystemInspector>()
.FirstOrDefault(x => x.targets.Cast<ParticleSystem>().Select(x => x.gameObject).SequenceEqual(targetsGos));
}
/// <summary>
/// Implement this function to make a custom inspector.
/// </summary>
public override void OnInspectorGUI()
{
serializedObject.Update();
EditorGUILayout.PropertyField(_spParticleSystem);
EditorGUI.indentLevel++;
var ps = _spParticleSystem.objectReferenceValue as ParticleSystem;
if (ps)
{
var pr = ps.GetComponent<ParticleSystemRenderer>();
var sp = new SerializedObject(pr).FindProperty("m_Materials");
EditorGUILayout.PropertyField(sp.GetArrayElementAtIndex(0), s_ContentParticleMaterial);
EditorGUILayout.PropertyField(sp.GetArrayElementAtIndex(1), s_ContentTrailMaterial);
sp.serializedObject.ApplyModifiedProperties();
if (!Application.isPlaying && pr.enabled)
{
EditorGUILayout.HelpBox("UIParticles disable the RendererModule in ParticleSystem at runtime to prevent double rendering.", MessageType.Warning);
}
}
EditorGUI.indentLevel--;
EditorGUI.BeginDisabledGroup(true);
EditorGUILayout.PropertyField(_spTrailParticle);
EditorGUI.EndDisabledGroup();
var current = target as UIParticle;
EditorGUILayout.PropertyField(_spIgnoreParent);
EditorGUI.BeginDisabledGroup(!current.isRoot);
EditorGUILayout.PropertyField(_spScale);
EditorGUI.EndDisabledGroup();
// AnimatableProperties
AnimatedPropertiesEditor.DrawAnimatableProperties(_spAnimatableProperties, current.material);
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();
if (current.maskable && current.material && current.material.shader)
{
var mat = current.material;
var shader = mat.shader;
foreach (var propName in s_MaskablePropertyNames)
{
if (!mat.HasProperty(propName))
{
EditorGUILayout.HelpBox(string.Format("Shader {0} doesn't have '{1}' property. This graphic is not maskable.", shader.name, propName), MessageType.Warning);
break;
}
}
}
serializedObject.ApplyModifiedProperties();
}
//################################
// Private Members.
//################################
SerializedProperty _spParticleSystem;
SerializedProperty _spTrailParticle;
SerializedProperty _spScale;
SerializedProperty _spIgnoreParent;
SerializedProperty _spAnimatableProperties;
UIParticle[] _particles;
ShapeModuleUI[] _shapeModuleUIs;
ParticleSystemInspector _inspector;
void OnSceneGUI()
{
_shapeModuleUIs ??= _inspector?.m_ParticleEffectUI?.m_Emitters?.SelectMany(x => x.m_Modules).OfType<ShapeModuleUI>()?.ToArray();
if (_shapeModuleUIs == null || _shapeModuleUIs.Length == 0 || _shapeModuleUIs[0].GetParticleSystem() != (target as UIParticle).cachedParticleSystem)
return;
Action postAction = () => { };
Color origin = ShapeModuleUI.s_GizmoColor.m_Color;
Color originDark = ShapeModuleUI.s_GizmoColor.m_Color;
ShapeModuleUI.s_GizmoColor.m_Color = s_GizmoColor;
ShapeModuleUI.s_GizmoColor.m_OptionalDarkColor = s_GizmoColor;
_particles
.Distinct()
.Select(x => new { canvas = x.canvas, ps = x.cachedParticleSystem, scale = x.scale })
.Where(x => x.ps && x.canvas)
.ToList()
.ForEach(x =>
{
var trans = x.ps.transform;
var hasChanged = trans.hasChanged;
var localScale = trans.localScale;
postAction += () => trans.localScale = localScale;
trans.localScale = Vector3.Scale(localScale, x.canvas.rootCanvas.transform.localScale * x.scale);
});
foreach (var ui in _shapeModuleUIs)
ui.OnSceneViewGUI();
postAction();
ShapeModuleUI.s_GizmoColor.m_Color = origin;
ShapeModuleUI.s_GizmoColor.m_OptionalDarkColor = originDark;
}
}
}

View File

@ -0,0 +1,25 @@
#if !UNITY_2019_1_OR_NEWER
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEditor;
namespace Coffee.UIExtensions
{
public class UIParticleMenu
{
[MenuItem("Assets/Samples/Import UIParticle Sample")]
static void ImportSample()
{
const string src = "Packages/com.coffee.ui-particle/Samples~/Demo";
const string dst = "Assets/Samples/UI Particle/3.0.0/Demo";
if (FileUtil.PathExists(dst))
FileUtil.DeleteFileOrDirectory(dst);
FileUtil.CopyDirectoryRecursive(src, dst);
AssetDatabase.ImportAsset(dst, ImportAssetOptions.ImportRecursive);
}
}
}
#endif

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 07047cbd3c4af489fbd41f4303a26fe2
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

File diff suppressed because it is too large Load Diff

View File

@ -7,148 +7,149 @@ using PrefabStageUtility = UnityEditor.Experimental.SceneManagement.PrefabStageU
namespace Coffee.UIExtensions
{
/// <summary>
/// </summary>
[ExecuteInEditMode]
public class UIParticleOverlayCamera : MonoBehaviour
{
//################################
// Public/Protected Members.
//################################
/// <summary>
/// Get instance object.
/// If instance does not exist, Find instance in scene, or create new one.
/// </summary>
public static UIParticleOverlayCamera instance
{
get
{
/// <summary>
/// </summary>
[ExecuteInEditMode]
[AddComponentMenu("")]
public class UIParticleOverlayCamera : MonoBehaviour
{
//################################
// Public/Protected Members.
//################################
/// <summary>
/// Get instance object.
/// If instance does not exist, Find instance in scene, or create new one.
/// </summary>
public static UIParticleOverlayCamera instance
{
get
{
#if UNITY_2018_3_OR_NEWER && UNITY_EDITOR
// If current scene is prefab mode, create OverlayCamera for editor.
var prefabStage = PrefabStageUtility.GetCurrentPrefabStage ();
if (prefabStage != null && prefabStage.scene.isLoaded)
{
if (!s_InstanceForPrefabMode)
{
// This GameObject is not saved in prefab.
// This GameObject is not shown in the hierarchy view.
// When you exit prefab mode, this GameObject is destroyed automatically.
var go = new GameObject (typeof (UIParticleOverlayCamera).Name + "_ForEditor")
{
hideFlags = HideFlags.HideAndDontSave,
tag = "EditorOnly",
};
UnityEngine.SceneManagement.SceneManager.MoveGameObjectToScene (go, prefabStage.scene);
s_InstanceForPrefabMode = go.AddComponent<UIParticleOverlayCamera> ();
}
return s_InstanceForPrefabMode;
}
// If current scene is prefab mode, create OverlayCamera for editor.
var prefabStage = PrefabStageUtility.GetCurrentPrefabStage();
if (prefabStage != null && prefabStage.scene.isLoaded)
{
if (!s_InstanceForPrefabMode)
{
// This GameObject is not saved in prefab.
// This GameObject is not shown in the hierarchy view.
// When you exit prefab mode, this GameObject is destroyed automatically.
var go = new GameObject(typeof(UIParticleOverlayCamera).Name + "_ForEditor")
{
hideFlags = HideFlags.HideAndDontSave,
tag = "EditorOnly",
};
UnityEngine.SceneManagement.SceneManager.MoveGameObjectToScene(go, prefabStage.scene);
s_InstanceForPrefabMode = go.AddComponent<UIParticleOverlayCamera>();
}
return s_InstanceForPrefabMode;
}
#endif
// Find instance in scene, or create new one.
if (object.ReferenceEquals (s_Instance, null))
{
s_Instance = FindObjectOfType<UIParticleOverlayCamera> () ?? new GameObject (typeof (UIParticleOverlayCamera).Name, typeof (UIParticleOverlayCamera)).GetComponent<UIParticleOverlayCamera> ();
s_Instance.gameObject.SetActive (true);
s_Instance.enabled = true;
}
return s_Instance;
}
}
// Find instance in scene, or create new one.
if (object.ReferenceEquals(s_Instance, null))
{
s_Instance = FindObjectOfType<UIParticleOverlayCamera>() ?? new GameObject(typeof(UIParticleOverlayCamera).Name, typeof(UIParticleOverlayCamera)).GetComponent<UIParticleOverlayCamera>();
s_Instance.gameObject.SetActive(true);
s_Instance.enabled = true;
}
return s_Instance;
}
}
public static Camera GetCameraForOvrelay (Canvas canvas)
{
var i = instance;
var rt = canvas.rootCanvas.transform as RectTransform;
var cam = i.cameraForOvrelay;
var trans = i.transform;
cam.enabled = false;
public static Camera GetCameraForOvrelay(Canvas canvas)
{
var i = instance;
var rt = canvas.rootCanvas.transform as RectTransform;
var cam = i.cameraForOvrelay;
var trans = i.transform;
cam.enabled = false;
var pos = rt.localPosition;
cam.orthographic = true;
cam.orthographicSize = Mathf.Max (pos.x, pos.y);
cam.nearClipPlane = 0.3f;
cam.farClipPlane = 1000f;
pos.z -= 100;
trans.localPosition = pos;
var pos = rt.localPosition;
cam.orthographic = true;
cam.orthographicSize = Mathf.Max(pos.x, pos.y);
cam.nearClipPlane = 0.3f;
cam.farClipPlane = 1000f;
pos.z -= 100;
trans.localPosition = pos;
return cam;
}
return cam;
}
//################################
// Private Members.
//################################
Camera cameraForOvrelay { get { return m_Camera ? m_Camera : (m_Camera = GetComponent<Camera> ()) ? m_Camera : (m_Camera = gameObject.AddComponent<Camera> ()); } }
Camera m_Camera;
static UIParticleOverlayCamera s_Instance;
//################################
// Private Members.
//################################
Camera cameraForOvrelay { get { return m_Camera ? m_Camera : (m_Camera = GetComponent<Camera>()) ? m_Camera : (m_Camera = gameObject.AddComponent<Camera>()); } }
Camera m_Camera;
static UIParticleOverlayCamera s_Instance;
#if UNITY_2018_3_OR_NEWER && UNITY_EDITOR
static UIParticleOverlayCamera s_InstanceForPrefabMode;
static UIParticleOverlayCamera s_InstanceForPrefabMode;
#endif
/// <summary>
/// Awake is called when the script instance is being loaded.
/// </summary>
void Awake ()
{
/// <summary>
/// Awake is called when the script instance is being loaded.
/// </summary>
void Awake()
{
#if UNITY_2018_3_OR_NEWER && UNITY_EDITOR
// OverlayCamera for editor.
if (hideFlags == HideFlags.HideAndDontSave || s_InstanceForPrefabMode == this)
{
s_InstanceForPrefabMode = GetComponent<UIParticleOverlayCamera> ();
return;
}
// OverlayCamera for editor.
if (hideFlags == HideFlags.HideAndDontSave || s_InstanceForPrefabMode == this)
{
s_InstanceForPrefabMode = GetComponent<UIParticleOverlayCamera>();
return;
}
#endif
// Hold the instance.
if (s_Instance == null)
{
s_Instance = GetComponent<UIParticleOverlayCamera> ();
}
// If the instance is duplicated, destroy itself.
else if (s_Instance != this)
{
UnityEngine.Debug.LogWarning ("Multiple " + typeof (UIParticleOverlayCamera).Name + " in scene.", this.gameObject);
enabled = false;
// Hold the instance.
if (s_Instance == null)
{
s_Instance = GetComponent<UIParticleOverlayCamera>();
}
// If the instance is duplicated, destroy itself.
else if (s_Instance != this)
{
UnityEngine.Debug.LogWarning("Multiple " + typeof(UIParticleOverlayCamera).Name + " in scene.", this.gameObject);
enabled = false;
#if UNITY_EDITOR
if (!Application.isPlaying)
{
DestroyImmediate (gameObject);
}
else
if (!Application.isPlaying)
{
DestroyImmediate(gameObject);
}
else
#endif
{
Destroy (gameObject);
}
return;
}
{
Destroy(gameObject);
}
return;
}
cameraForOvrelay.enabled = false;
cameraForOvrelay.enabled = false;
// Singleton has DontDestroy flag.
if (Application.isPlaying)
{
DontDestroyOnLoad (gameObject);
}
}
// Singleton has DontDestroy flag.
if (Application.isPlaying)
{
DontDestroyOnLoad(gameObject);
}
}
/// <summary>
/// This function is called when the MonoBehaviour will be destroyed.
/// </summary>
void OnDestroy ()
{
/// <summary>
/// This function is called when the MonoBehaviour will be destroyed.
/// </summary>
void OnDestroy()
{
#if UNITY_2018_3_OR_NEWER && UNITY_EDITOR
if (s_InstanceForPrefabMode == this)
{
s_InstanceForPrefabMode = null;
}
if (s_InstanceForPrefabMode == this)
{
s_InstanceForPrefabMode = null;
}
#endif
// Clear instance on destroy.
if (s_Instance == this)
{
s_Instance = null;
}
}
}
// Clear instance on destroy.
if (s_Instance == this)
{
s_Instance = null;
}
}
}
}

View File

@ -1,9 +1,9 @@
{
"name": "com.coffee.ui-particle",
"displayName": "UI Particle",
"description": "This plugin provide a component to render particle effect for uGUI.\nThe particle rendering is maskable and sortable, without Camera, RenderTexture or Canvas.",
"version": "2.3.0",
"unity": "2018.2",
"displayName": "UI Particle",
"description": "This plugin provide a component to render particle effect for uGUI.\nThe particle rendering is maskable and sortable, without Camera, RenderTexture or Canvas.",
"version": "3.0.0-preview.1",
"unity": "2018.2",
"license": "MIT",
"repository": {
"type": "git",
@ -13,7 +13,12 @@
"author": "mob-sakai <sakai861104@gmail.com> (https://github.com/mob-sakai)",
"editorOnly": false,
"upmSupport": true,
"dependencies": {
}
"dependencies": {},
"samples": [
{
"displayName": "Demo",
"description": "UI Particle Demo",
"path": "Samples~/Demo"
}
]
}