Initial commit
This commit is contained in:
8
Assets/Materials/Airplane 3D model Voxel.meta
Normal file
8
Assets/Materials/Airplane 3D model Voxel.meta
Normal file
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 37ee9ac424def3e4e9828b0e0bb2c1de
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
8
Assets/Materials/Airplane 3D model Voxel/Prefabs.meta
Normal file
8
Assets/Materials/Airplane 3D model Voxel/Prefabs.meta
Normal file
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: f7d97252518872343a3563fd621fc148
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,435 @@
|
||||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!1 &38230261665854561
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 4838698039048279779}
|
||||
- component: {fileID: 5795490572879853814}
|
||||
- component: {fileID: 2773987851375378812}
|
||||
- component: {fileID: 8542826241751389635}
|
||||
m_Layer: 0
|
||||
m_Name: m_0
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!4 &4838698039048279779
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 38230261665854561}
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_Children: []
|
||||
m_Father: {fileID: 2846427945705009163}
|
||||
m_RootOrder: 0
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!23 &5795490572879853814
|
||||
MeshRenderer:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 38230261665854561}
|
||||
m_Enabled: 1
|
||||
m_CastShadows: 1
|
||||
m_ReceiveShadows: 1
|
||||
m_DynamicOccludee: 1
|
||||
m_MotionVectors: 1
|
||||
m_LightProbeUsage: 1
|
||||
m_ReflectionProbeUsage: 1
|
||||
m_RayTracingMode: 2
|
||||
m_RayTraceProcedural: 0
|
||||
m_RenderingLayerMask: 1
|
||||
m_RendererPriority: 0
|
||||
m_Materials:
|
||||
- {fileID: -195686079568591132, guid: c4c0b1a60f402e24ba972356bb23eb67, type: 3}
|
||||
m_StaticBatchInfo:
|
||||
firstSubMesh: 0
|
||||
subMeshCount: 0
|
||||
m_StaticBatchRoot: {fileID: 0}
|
||||
m_ProbeAnchor: {fileID: 0}
|
||||
m_LightProbeVolumeOverride: {fileID: 0}
|
||||
m_ScaleInLightmap: 1
|
||||
m_ReceiveGI: 1
|
||||
m_PreserveUVs: 0
|
||||
m_IgnoreNormalsForChartDetection: 0
|
||||
m_ImportantGI: 0
|
||||
m_StitchLightmapSeams: 1
|
||||
m_SelectedEditorRenderState: 3
|
||||
m_MinimumChartSize: 4
|
||||
m_AutoUVMaxDistance: 0.5
|
||||
m_AutoUVMaxAngle: 89
|
||||
m_LightmapParameters: {fileID: 0}
|
||||
m_SortingLayerID: 0
|
||||
m_SortingLayer: 0
|
||||
m_SortingOrder: 0
|
||||
m_AdditionalVertexStreams: {fileID: 0}
|
||||
--- !u!33 &2773987851375378812
|
||||
MeshFilter:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 38230261665854561}
|
||||
m_Mesh: {fileID: -786200203584999737, guid: c4c0b1a60f402e24ba972356bb23eb67, type: 3}
|
||||
--- !u!64 &8542826241751389635
|
||||
MeshCollider:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 38230261665854561}
|
||||
m_Material: {fileID: 0}
|
||||
m_IsTrigger: 0
|
||||
m_Enabled: 1
|
||||
serializedVersion: 4
|
||||
m_Convex: 1
|
||||
m_CookingOptions: 30
|
||||
m_Mesh: {fileID: -786200203584999737, guid: c4c0b1a60f402e24ba972356bb23eb67, type: 3}
|
||||
--- !u!1 &472815906443808636
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 4448708374373888536}
|
||||
m_Layer: 0
|
||||
m_Name: Airplane on the ground
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!4 &4448708374373888536
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 472815906443808636}
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_Children:
|
||||
- {fileID: 2846427945705009163}
|
||||
- {fileID: 2870062497473032247}
|
||||
- {fileID: 1934295690684148878}
|
||||
- {fileID: 2870062498230695462}
|
||||
m_Father: {fileID: 0}
|
||||
m_RootOrder: 0
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!1 &6884456091504962823
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 3218070423094246761}
|
||||
- component: {fileID: 7756643258761881034}
|
||||
- component: {fileID: 7114899040999882926}
|
||||
m_Layer: 0
|
||||
m_Name: m_1
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!4 &3218070423094246761
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 6884456091504962823}
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_Children: []
|
||||
m_Father: {fileID: 2846427945705009163}
|
||||
m_RootOrder: 1
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!23 &7756643258761881034
|
||||
MeshRenderer:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 6884456091504962823}
|
||||
m_Enabled: 1
|
||||
m_CastShadows: 1
|
||||
m_ReceiveShadows: 1
|
||||
m_DynamicOccludee: 1
|
||||
m_MotionVectors: 1
|
||||
m_LightProbeUsage: 1
|
||||
m_ReflectionProbeUsage: 1
|
||||
m_RayTracingMode: 2
|
||||
m_RayTraceProcedural: 0
|
||||
m_RenderingLayerMask: 1
|
||||
m_RendererPriority: 0
|
||||
m_Materials:
|
||||
- {fileID: -195686079568591132, guid: c4c0b1a60f402e24ba972356bb23eb67, type: 3}
|
||||
m_StaticBatchInfo:
|
||||
firstSubMesh: 0
|
||||
subMeshCount: 0
|
||||
m_StaticBatchRoot: {fileID: 0}
|
||||
m_ProbeAnchor: {fileID: 0}
|
||||
m_LightProbeVolumeOverride: {fileID: 0}
|
||||
m_ScaleInLightmap: 1
|
||||
m_ReceiveGI: 1
|
||||
m_PreserveUVs: 0
|
||||
m_IgnoreNormalsForChartDetection: 0
|
||||
m_ImportantGI: 0
|
||||
m_StitchLightmapSeams: 1
|
||||
m_SelectedEditorRenderState: 3
|
||||
m_MinimumChartSize: 4
|
||||
m_AutoUVMaxDistance: 0.5
|
||||
m_AutoUVMaxAngle: 89
|
||||
m_LightmapParameters: {fileID: 0}
|
||||
m_SortingLayerID: 0
|
||||
m_SortingLayer: 0
|
||||
m_SortingOrder: 0
|
||||
m_AdditionalVertexStreams: {fileID: 0}
|
||||
--- !u!33 &7114899040999882926
|
||||
MeshFilter:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 6884456091504962823}
|
||||
m_Mesh: {fileID: -6158549362575458627, guid: c4c0b1a60f402e24ba972356bb23eb67, type: 3}
|
||||
--- !u!1 &8347809513406064432
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 2846427945705009163}
|
||||
m_Layer: 0
|
||||
m_Name: Model 0
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!4 &2846427945705009163
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 8347809513406064432}
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 6, z: -0.25}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_Children:
|
||||
- {fileID: 4838698039048279779}
|
||||
- {fileID: 3218070423094246761}
|
||||
m_Father: {fileID: 4448708374373888536}
|
||||
m_RootOrder: 0
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!1001 &2343305131939061434
|
||||
PrefabInstance:
|
||||
m_ObjectHideFlags: 0
|
||||
serializedVersion: 2
|
||||
m_Modification:
|
||||
m_TransformParent: {fileID: 4448708374373888536}
|
||||
m_Modifications:
|
||||
- target: {fileID: 527366702227205773, guid: 261952d407f91564ea5d763d04a4e06f, type: 3}
|
||||
propertyPath: m_RootOrder
|
||||
value: 1
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 527366702227205773, guid: 261952d407f91564ea5d763d04a4e06f, type: 3}
|
||||
propertyPath: m_LocalPosition.x
|
||||
value: -4.5
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 527366702227205773, guid: 261952d407f91564ea5d763d04a4e06f, type: 3}
|
||||
propertyPath: m_LocalPosition.y
|
||||
value: 6
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 527366702227205773, guid: 261952d407f91564ea5d763d04a4e06f, type: 3}
|
||||
propertyPath: m_LocalPosition.z
|
||||
value: 9
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 527366702227205773, guid: 261952d407f91564ea5d763d04a4e06f, type: 3}
|
||||
propertyPath: m_LocalRotation.w
|
||||
value: 1
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 527366702227205773, guid: 261952d407f91564ea5d763d04a4e06f, type: 3}
|
||||
propertyPath: m_LocalRotation.x
|
||||
value: -0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 527366702227205773, guid: 261952d407f91564ea5d763d04a4e06f, type: 3}
|
||||
propertyPath: m_LocalRotation.y
|
||||
value: -0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 527366702227205773, guid: 261952d407f91564ea5d763d04a4e06f, type: 3}
|
||||
propertyPath: m_LocalRotation.z
|
||||
value: -0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 527366702227205773, guid: 261952d407f91564ea5d763d04a4e06f, type: 3}
|
||||
propertyPath: m_LocalEulerAnglesHint.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 527366702227205773, guid: 261952d407f91564ea5d763d04a4e06f, type: 3}
|
||||
propertyPath: m_LocalEulerAnglesHint.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 527366702227205773, guid: 261952d407f91564ea5d763d04a4e06f, type: 3}
|
||||
propertyPath: m_LocalEulerAnglesHint.z
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 5326498809367280187, guid: 261952d407f91564ea5d763d04a4e06f, type: 3}
|
||||
propertyPath: m_Name
|
||||
value: Landing_Gear1 (1)
|
||||
objectReference: {fileID: 0}
|
||||
m_RemovedComponents: []
|
||||
m_SourcePrefab: {fileID: 100100000, guid: 261952d407f91564ea5d763d04a4e06f, type: 3}
|
||||
--- !u!4 &2870062497473032247 stripped
|
||||
Transform:
|
||||
m_CorrespondingSourceObject: {fileID: 527366702227205773, guid: 261952d407f91564ea5d763d04a4e06f, type: 3}
|
||||
m_PrefabInstance: {fileID: 2343305131939061434}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
--- !u!1001 &2343305133223518354
|
||||
PrefabInstance:
|
||||
m_ObjectHideFlags: 0
|
||||
serializedVersion: 2
|
||||
m_Modification:
|
||||
m_TransformParent: {fileID: 4448708374373888536}
|
||||
m_Modifications:
|
||||
- target: {fileID: 2199712288459955722, guid: 42097b2a2f3ec104bbbe09297bdfaf6a, type: 3}
|
||||
propertyPath: m_LocalPosition.y
|
||||
value: -1.77
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 3786464178926475306, guid: 42097b2a2f3ec104bbbe09297bdfaf6a, type: 3}
|
||||
propertyPath: m_Name
|
||||
value: Landing_Gear2
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 4202676716083022876, guid: 42097b2a2f3ec104bbbe09297bdfaf6a, type: 3}
|
||||
propertyPath: m_RootOrder
|
||||
value: 2
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 4202676716083022876, guid: 42097b2a2f3ec104bbbe09297bdfaf6a, type: 3}
|
||||
propertyPath: m_LocalPosition.x
|
||||
value: 0.51000214
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 4202676716083022876, guid: 42097b2a2f3ec104bbbe09297bdfaf6a, type: 3}
|
||||
propertyPath: m_LocalPosition.y
|
||||
value: 5.95
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 4202676716083022876, guid: 42097b2a2f3ec104bbbe09297bdfaf6a, type: 3}
|
||||
propertyPath: m_LocalPosition.z
|
||||
value: 48.26
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 4202676716083022876, guid: 42097b2a2f3ec104bbbe09297bdfaf6a, type: 3}
|
||||
propertyPath: m_LocalRotation.w
|
||||
value: 1
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 4202676716083022876, guid: 42097b2a2f3ec104bbbe09297bdfaf6a, type: 3}
|
||||
propertyPath: m_LocalRotation.x
|
||||
value: -0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 4202676716083022876, guid: 42097b2a2f3ec104bbbe09297bdfaf6a, type: 3}
|
||||
propertyPath: m_LocalRotation.y
|
||||
value: -0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 4202676716083022876, guid: 42097b2a2f3ec104bbbe09297bdfaf6a, type: 3}
|
||||
propertyPath: m_LocalRotation.z
|
||||
value: -0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 4202676716083022876, guid: 42097b2a2f3ec104bbbe09297bdfaf6a, type: 3}
|
||||
propertyPath: m_LocalEulerAnglesHint.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 4202676716083022876, guid: 42097b2a2f3ec104bbbe09297bdfaf6a, type: 3}
|
||||
propertyPath: m_LocalEulerAnglesHint.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 4202676716083022876, guid: 42097b2a2f3ec104bbbe09297bdfaf6a, type: 3}
|
||||
propertyPath: m_LocalEulerAnglesHint.z
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
m_RemovedComponents: []
|
||||
m_SourcePrefab: {fileID: 100100000, guid: 42097b2a2f3ec104bbbe09297bdfaf6a, type: 3}
|
||||
--- !u!4 &1934295690684148878 stripped
|
||||
Transform:
|
||||
m_CorrespondingSourceObject: {fileID: 4202676716083022876, guid: 42097b2a2f3ec104bbbe09297bdfaf6a, type: 3}
|
||||
m_PrefabInstance: {fileID: 2343305133223518354}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
--- !u!1001 &2343305133232412843
|
||||
PrefabInstance:
|
||||
m_ObjectHideFlags: 0
|
||||
serializedVersion: 2
|
||||
m_Modification:
|
||||
m_TransformParent: {fileID: 4448708374373888536}
|
||||
m_Modifications:
|
||||
- target: {fileID: 527366702227205773, guid: 261952d407f91564ea5d763d04a4e06f, type: 3}
|
||||
propertyPath: m_RootOrder
|
||||
value: 3
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 527366702227205773, guid: 261952d407f91564ea5d763d04a4e06f, type: 3}
|
||||
propertyPath: m_LocalPosition.x
|
||||
value: 4.5
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 527366702227205773, guid: 261952d407f91564ea5d763d04a4e06f, type: 3}
|
||||
propertyPath: m_LocalPosition.y
|
||||
value: 6
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 527366702227205773, guid: 261952d407f91564ea5d763d04a4e06f, type: 3}
|
||||
propertyPath: m_LocalPosition.z
|
||||
value: 9
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 527366702227205773, guid: 261952d407f91564ea5d763d04a4e06f, type: 3}
|
||||
propertyPath: m_LocalRotation.w
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 527366702227205773, guid: 261952d407f91564ea5d763d04a4e06f, type: 3}
|
||||
propertyPath: m_LocalRotation.x
|
||||
value: -0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 527366702227205773, guid: 261952d407f91564ea5d763d04a4e06f, type: 3}
|
||||
propertyPath: m_LocalRotation.y
|
||||
value: 1
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 527366702227205773, guid: 261952d407f91564ea5d763d04a4e06f, type: 3}
|
||||
propertyPath: m_LocalRotation.z
|
||||
value: -0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 527366702227205773, guid: 261952d407f91564ea5d763d04a4e06f, type: 3}
|
||||
propertyPath: m_LocalEulerAnglesHint.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 527366702227205773, guid: 261952d407f91564ea5d763d04a4e06f, type: 3}
|
||||
propertyPath: m_LocalEulerAnglesHint.y
|
||||
value: 180
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 527366702227205773, guid: 261952d407f91564ea5d763d04a4e06f, type: 3}
|
||||
propertyPath: m_LocalEulerAnglesHint.z
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 5326498809367280187, guid: 261952d407f91564ea5d763d04a4e06f, type: 3}
|
||||
propertyPath: m_Name
|
||||
value: Landing_Gear1
|
||||
objectReference: {fileID: 0}
|
||||
m_RemovedComponents: []
|
||||
m_SourcePrefab: {fileID: 100100000, guid: 261952d407f91564ea5d763d04a4e06f, type: 3}
|
||||
--- !u!4 &2870062498230695462 stripped
|
||||
Transform:
|
||||
m_CorrespondingSourceObject: {fileID: 527366702227205773, guid: 261952d407f91564ea5d763d04a4e06f, type: 3}
|
||||
m_PrefabInstance: {fileID: 2343305133232412843}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: bbee0bfde7e5316489b671cc03fc0ec5
|
||||
PrefabImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
701
Assets/Materials/Airplane 3D model Voxel/Prefabs/Airplane.prefab
Normal file
701
Assets/Materials/Airplane 3D model Voxel/Prefabs/Airplane.prefab
Normal file
File diff suppressed because one or more lines are too long
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: c4c0b1a60f402e24ba972356bb23eb67
|
||||
PrefabImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
8
Assets/Materials/Drone.meta
Normal file
8
Assets/Materials/Drone.meta
Normal file
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: b8711b51829e3a84b955bce7cf78bc8b
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
8
Assets/Materials/Drone/Art.meta
Normal file
8
Assets/Materials/Drone/Art.meta
Normal file
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 77e731109bca01643a1bff10840fa062
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
8
Assets/Materials/Drone/Art/animation.meta
Normal file
8
Assets/Materials/Drone/Art/animation.meta
Normal file
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 775f77ba0709c9d46baf7534d3f4e6ee
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,72 @@
|
||||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!91 &9100000
|
||||
AnimatorController:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_Name: Fan Controller
|
||||
serializedVersion: 5
|
||||
m_AnimatorParameters: []
|
||||
m_AnimatorLayers:
|
||||
- serializedVersion: 5
|
||||
m_Name: Base Layer
|
||||
m_StateMachine: {fileID: 5585217743552213370}
|
||||
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 &5331100891494942184
|
||||
AnimatorState:
|
||||
serializedVersion: 5
|
||||
m_ObjectHideFlags: 1
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_Name: Fan Rotation
|
||||
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: 85e93fac93c19ee4daa894ed59f8c60b, type: 2}
|
||||
m_Tag:
|
||||
m_SpeedParameter:
|
||||
m_MirrorParameter:
|
||||
m_CycleOffsetParameter:
|
||||
m_TimeParameter:
|
||||
--- !u!1107 &5585217743552213370
|
||||
AnimatorStateMachine:
|
||||
serializedVersion: 5
|
||||
m_ObjectHideFlags: 1
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_Name: Base Layer
|
||||
m_ChildStates:
|
||||
- serializedVersion: 1
|
||||
m_State: {fileID: 5331100891494942184}
|
||||
m_Position: {x: 200, y: 0, 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: 5331100891494942184}
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: a2c255f835a5f984a931e730b1ed4a95
|
||||
NativeFormatImporter:
|
||||
externalObjects: {}
|
||||
mainObjectFileID: 0
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
199
Assets/Materials/Drone/Art/animation/Fan Rotation.anim
Normal file
199
Assets/Materials/Drone/Art/animation/Fan Rotation.anim
Normal file
@@ -0,0 +1,199 @@
|
||||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!74 &7400000
|
||||
AnimationClip:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_Name: Fan Rotation
|
||||
serializedVersion: 6
|
||||
m_Legacy: 0
|
||||
m_Compressed: 0
|
||||
m_UseHighQualityCurve: 1
|
||||
m_RotationCurves: []
|
||||
m_CompressedRotationCurves: []
|
||||
m_EulerCurves:
|
||||
- curve:
|
||||
serializedVersion: 2
|
||||
m_Curve:
|
||||
- serializedVersion: 3
|
||||
time: 0
|
||||
value: {x: -180, y: 0, z: 0}
|
||||
inSlope: {x: 0, y: 0, z: Infinity}
|
||||
outSlope: {x: 0, y: 0, z: -2160}
|
||||
tangentMode: 0
|
||||
weightedMode: 0
|
||||
inWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334}
|
||||
outWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334}
|
||||
- serializedVersion: 3
|
||||
time: 0.16666667
|
||||
value: {x: -180, y: 0, z: -360}
|
||||
inSlope: {x: 0, y: -0, z: -2160}
|
||||
outSlope: {x: 0, y: 0, z: 0}
|
||||
tangentMode: 0
|
||||
weightedMode: 0
|
||||
inWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334}
|
||||
outWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334}
|
||||
m_PreInfinity: 2
|
||||
m_PostInfinity: 2
|
||||
m_RotationOrder: 4
|
||||
path:
|
||||
m_PositionCurves: []
|
||||
m_ScaleCurves: []
|
||||
m_FloatCurves: []
|
||||
m_PPtrCurves: []
|
||||
m_SampleRate: 60
|
||||
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: 4
|
||||
script: {fileID: 0}
|
||||
typeID: 4
|
||||
customType: 4
|
||||
isPPtrCurve: 0
|
||||
pptrCurveMapping: []
|
||||
m_AnimationClipSettings:
|
||||
serializedVersion: 2
|
||||
m_AdditiveReferencePoseClip: {fileID: 0}
|
||||
m_AdditiveReferencePoseTime: 0
|
||||
m_StartTime: 0
|
||||
m_StopTime: 0.16666667
|
||||
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: -180
|
||||
inSlope: 0
|
||||
outSlope: 0
|
||||
tangentMode: 136
|
||||
weightedMode: 0
|
||||
inWeight: 0.33333334
|
||||
outWeight: 0.33333334
|
||||
- serializedVersion: 3
|
||||
time: 0.16666667
|
||||
value: -180
|
||||
inSlope: 0
|
||||
outSlope: 0
|
||||
tangentMode: 136
|
||||
weightedMode: 0
|
||||
inWeight: 0.33333334
|
||||
outWeight: 0.33333334
|
||||
m_PreInfinity: 2
|
||||
m_PostInfinity: 2
|
||||
m_RotationOrder: 4
|
||||
attribute: localEulerAnglesRaw.x
|
||||
path:
|
||||
classID: 4
|
||||
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
|
||||
- serializedVersion: 3
|
||||
time: 0.16666667
|
||||
value: 0
|
||||
inSlope: -0
|
||||
outSlope: 0
|
||||
tangentMode: 69
|
||||
weightedMode: 0
|
||||
inWeight: 0.33333334
|
||||
outWeight: 0.33333334
|
||||
m_PreInfinity: 2
|
||||
m_PostInfinity: 2
|
||||
m_RotationOrder: 4
|
||||
attribute: localEulerAnglesRaw.y
|
||||
path:
|
||||
classID: 4
|
||||
script: {fileID: 0}
|
||||
- curve:
|
||||
serializedVersion: 2
|
||||
m_Curve:
|
||||
- serializedVersion: 3
|
||||
time: 0
|
||||
value: 0
|
||||
inSlope: Infinity
|
||||
outSlope: -2160
|
||||
tangentMode: 69
|
||||
weightedMode: 0
|
||||
inWeight: 0.33333334
|
||||
outWeight: 0.33333334
|
||||
- serializedVersion: 3
|
||||
time: 0.16666667
|
||||
value: -360
|
||||
inSlope: -2160
|
||||
outSlope: 0
|
||||
tangentMode: 69
|
||||
weightedMode: 0
|
||||
inWeight: 0.33333334
|
||||
outWeight: 0.33333334
|
||||
m_PreInfinity: 2
|
||||
m_PostInfinity: 2
|
||||
m_RotationOrder: 4
|
||||
attribute: localEulerAnglesRaw.z
|
||||
path:
|
||||
classID: 4
|
||||
script: {fileID: 0}
|
||||
m_EulerEditorCurves:
|
||||
- curve:
|
||||
serializedVersion: 2
|
||||
m_Curve: []
|
||||
m_PreInfinity: 2
|
||||
m_PostInfinity: 2
|
||||
m_RotationOrder: 4
|
||||
attribute: m_LocalEulerAngles.x
|
||||
path:
|
||||
classID: 4
|
||||
script: {fileID: 0}
|
||||
- curve:
|
||||
serializedVersion: 2
|
||||
m_Curve: []
|
||||
m_PreInfinity: 2
|
||||
m_PostInfinity: 2
|
||||
m_RotationOrder: 4
|
||||
attribute: m_LocalEulerAngles.y
|
||||
path:
|
||||
classID: 4
|
||||
script: {fileID: 0}
|
||||
- curve:
|
||||
serializedVersion: 2
|
||||
m_Curve: []
|
||||
m_PreInfinity: 2
|
||||
m_PostInfinity: 2
|
||||
m_RotationOrder: 4
|
||||
attribute: m_LocalEulerAngles.z
|
||||
path:
|
||||
classID: 4
|
||||
script: {fileID: 0}
|
||||
m_HasGenericRootTransform: 1
|
||||
m_HasMotionFloatCurves: 0
|
||||
m_Events: []
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 85e93fac93c19ee4daa894ed59f8c60b
|
||||
NativeFormatImporter:
|
||||
externalObjects: {}
|
||||
mainObjectFileID: 0
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
8
Assets/Materials/Drone/Art/material.meta
Normal file
8
Assets/Materials/Drone/Art/material.meta
Normal file
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 903b6361449ebcc47a8cce7dd4ec366e
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
129
Assets/Materials/Drone/Art/material/Green.mat
Normal file
129
Assets/Materials/Drone/Art/material/Green.mat
Normal file
@@ -0,0 +1,129 @@
|
||||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!21 &2100000
|
||||
Material:
|
||||
serializedVersion: 8
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_Name: Green
|
||||
m_Shader: {fileID: 4800000, guid: 933532a4fcc9baf4fa0491de14d08ed7, type: 3}
|
||||
m_ValidKeywords:
|
||||
- _EMISSION
|
||||
m_InvalidKeywords: []
|
||||
m_LightmapFlags: 1
|
||||
m_EnableInstancingVariants: 0
|
||||
m_DoubleSidedGI: 0
|
||||
m_CustomRenderQueue: -1
|
||||
stringTagMap:
|
||||
RenderType: Opaque
|
||||
disabledShaderPasses: []
|
||||
m_SavedProperties:
|
||||
serializedVersion: 3
|
||||
m_TexEnvs:
|
||||
- _BaseMap:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _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}
|
||||
- _SpecGlossMap:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- unity_Lightmaps:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- unity_LightmapsInd:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- unity_ShadowMasks:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
m_Ints: []
|
||||
m_Floats:
|
||||
- _AlphaClip: 0
|
||||
- _Blend: 0
|
||||
- _BumpScale: 1
|
||||
- _ClearCoatMask: 0
|
||||
- _ClearCoatSmoothness: 0
|
||||
- _Cull: 2
|
||||
- _Cutoff: 0.5
|
||||
- _DetailAlbedoMapScale: 1
|
||||
- _DetailNormalMapScale: 1
|
||||
- _DstBlend: 0
|
||||
- _EnvironmentReflections: 1
|
||||
- _GlossMapScale: 1
|
||||
- _Glossiness: 0.5
|
||||
- _GlossyReflections: 1
|
||||
- _Metallic: 0.59
|
||||
- _Mode: 0
|
||||
- _OcclusionStrength: 1
|
||||
- _Parallax: 0.02
|
||||
- _QueueOffset: 0
|
||||
- _ReceiveShadows: 1
|
||||
- _Smoothness: 0.5
|
||||
- _SmoothnessTextureChannel: 0
|
||||
- _SpecularHighlights: 1
|
||||
- _SrcBlend: 1
|
||||
- _Surface: 0
|
||||
- _UVSec: 0
|
||||
- _WorkflowMode: 1
|
||||
- _ZWrite: 1
|
||||
m_Colors:
|
||||
- _BaseColor: {r: 0.20039007, g: 1, b: 0, a: 1}
|
||||
- _Color: {r: 0.20039004, g: 1, b: 0, a: 1}
|
||||
- _EmissionColor: {r: 0, g: 0.5566038, b: 0.009764941, a: 1}
|
||||
- _SpecColor: {r: 0.19999996, g: 0.19999996, b: 0.19999996, a: 1}
|
||||
m_BuildTextureStacks: []
|
||||
--- !u!114 &576781931307674697
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 11
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 0}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: d0353a89b1f911e48b9e16bdc9f2e058, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
version: 5
|
||||
8
Assets/Materials/Drone/Art/material/Green.mat.meta
Normal file
8
Assets/Materials/Drone/Art/material/Green.mat.meta
Normal file
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 4e009e94172ef3943b3a68831c591e45
|
||||
NativeFormatImporter:
|
||||
externalObjects: {}
|
||||
mainObjectFileID: 0
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
129
Assets/Materials/Drone/Art/material/Red.mat
Normal file
129
Assets/Materials/Drone/Art/material/Red.mat
Normal file
@@ -0,0 +1,129 @@
|
||||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!21 &2100000
|
||||
Material:
|
||||
serializedVersion: 8
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_Name: Red
|
||||
m_Shader: {fileID: 4800000, guid: 933532a4fcc9baf4fa0491de14d08ed7, type: 3}
|
||||
m_ValidKeywords:
|
||||
- _EMISSION
|
||||
m_InvalidKeywords: []
|
||||
m_LightmapFlags: 2
|
||||
m_EnableInstancingVariants: 0
|
||||
m_DoubleSidedGI: 0
|
||||
m_CustomRenderQueue: -1
|
||||
stringTagMap:
|
||||
RenderType: Opaque
|
||||
disabledShaderPasses: []
|
||||
m_SavedProperties:
|
||||
serializedVersion: 3
|
||||
m_TexEnvs:
|
||||
- _BaseMap:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _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}
|
||||
- _SpecGlossMap:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- unity_Lightmaps:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- unity_LightmapsInd:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- unity_ShadowMasks:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
m_Ints: []
|
||||
m_Floats:
|
||||
- _AlphaClip: 0
|
||||
- _Blend: 0
|
||||
- _BumpScale: 1
|
||||
- _ClearCoatMask: 0
|
||||
- _ClearCoatSmoothness: 0
|
||||
- _Cull: 2
|
||||
- _Cutoff: 0.5
|
||||
- _DetailAlbedoMapScale: 1
|
||||
- _DetailNormalMapScale: 1
|
||||
- _DstBlend: 0
|
||||
- _EnvironmentReflections: 1
|
||||
- _GlossMapScale: 1
|
||||
- _Glossiness: 0.43
|
||||
- _GlossyReflections: 1
|
||||
- _Metallic: 0.67
|
||||
- _Mode: 0
|
||||
- _OcclusionStrength: 1
|
||||
- _Parallax: 0.02
|
||||
- _QueueOffset: 0
|
||||
- _ReceiveShadows: 1
|
||||
- _Smoothness: 0.43
|
||||
- _SmoothnessTextureChannel: 0
|
||||
- _SpecularHighlights: 1
|
||||
- _SrcBlend: 1
|
||||
- _Surface: 0
|
||||
- _UVSec: 0
|
||||
- _WorkflowMode: 1
|
||||
- _ZWrite: 1
|
||||
m_Colors:
|
||||
- _BaseColor: {r: 1, g: 0, b: 0, a: 1}
|
||||
- _Color: {r: 1, g: 0, b: 0, a: 1}
|
||||
- _EmissionColor: {r: 0.5660378, g: 0.09878961, b: 0.09878961, a: 1}
|
||||
- _SpecColor: {r: 0.19999996, g: 0.19999996, b: 0.19999996, a: 1}
|
||||
m_BuildTextureStacks: []
|
||||
--- !u!114 &1274275020781550457
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 11
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 0}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: d0353a89b1f911e48b9e16bdc9f2e058, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
version: 5
|
||||
8
Assets/Materials/Drone/Art/material/Red.mat.meta
Normal file
8
Assets/Materials/Drone/Art/material/Red.mat.meta
Normal file
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: c41c59688c87e204fbfefb5c2bed24fc
|
||||
NativeFormatImporter:
|
||||
externalObjects: {}
|
||||
mainObjectFileID: 0
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
128
Assets/Materials/Drone/Art/material/Surface Plane.mat
Normal file
128
Assets/Materials/Drone/Art/material/Surface Plane.mat
Normal file
@@ -0,0 +1,128 @@
|
||||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!114 &-3434151677623514411
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 11
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 0}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: d0353a89b1f911e48b9e16bdc9f2e058, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
version: 5
|
||||
--- !u!21 &2100000
|
||||
Material:
|
||||
serializedVersion: 8
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_Name: Surface Plane
|
||||
m_Shader: {fileID: 4800000, guid: 933532a4fcc9baf4fa0491de14d08ed7, type: 3}
|
||||
m_ValidKeywords: []
|
||||
m_InvalidKeywords: []
|
||||
m_LightmapFlags: 4
|
||||
m_EnableInstancingVariants: 0
|
||||
m_DoubleSidedGI: 0
|
||||
m_CustomRenderQueue: -1
|
||||
stringTagMap:
|
||||
RenderType: Opaque
|
||||
disabledShaderPasses: []
|
||||
m_SavedProperties:
|
||||
serializedVersion: 3
|
||||
m_TexEnvs:
|
||||
- _BaseMap:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _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}
|
||||
- _SpecGlossMap:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- unity_Lightmaps:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- unity_LightmapsInd:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- unity_ShadowMasks:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
m_Ints: []
|
||||
m_Floats:
|
||||
- _AlphaClip: 0
|
||||
- _Blend: 0
|
||||
- _BumpScale: 1
|
||||
- _ClearCoatMask: 0
|
||||
- _ClearCoatSmoothness: 0
|
||||
- _Cull: 2
|
||||
- _Cutoff: 0.5
|
||||
- _DetailAlbedoMapScale: 1
|
||||
- _DetailNormalMapScale: 1
|
||||
- _DstBlend: 0
|
||||
- _EnvironmentReflections: 1
|
||||
- _GlossMapScale: 1
|
||||
- _Glossiness: 0.18
|
||||
- _GlossyReflections: 1
|
||||
- _Metallic: 0.86
|
||||
- _Mode: 0
|
||||
- _OcclusionStrength: 1
|
||||
- _Parallax: 0.02
|
||||
- _QueueOffset: 0
|
||||
- _ReceiveShadows: 1
|
||||
- _Smoothness: 0.18
|
||||
- _SmoothnessTextureChannel: 0
|
||||
- _SpecularHighlights: 1
|
||||
- _SrcBlend: 1
|
||||
- _Surface: 0
|
||||
- _UVSec: 0
|
||||
- _WorkflowMode: 1
|
||||
- _ZWrite: 1
|
||||
m_Colors:
|
||||
- _BaseColor: {r: 0.29245278, g: 0.29245278, b: 0.29245278, a: 1}
|
||||
- _Color: {r: 0.29245275, g: 0.29245275, b: 0.29245275, a: 1}
|
||||
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
|
||||
- _SpecColor: {r: 0.19999996, g: 0.19999996, b: 0.19999996, a: 1}
|
||||
m_BuildTextureStacks: []
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 79ae26eea3bce554d86409e78c478c23
|
||||
NativeFormatImporter:
|
||||
externalObjects: {}
|
||||
mainObjectFileID: 0
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
129
Assets/Materials/Drone/Art/material/White.mat
Normal file
129
Assets/Materials/Drone/Art/material/White.mat
Normal file
@@ -0,0 +1,129 @@
|
||||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!21 &2100000
|
||||
Material:
|
||||
serializedVersion: 8
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_Name: White
|
||||
m_Shader: {fileID: 4800000, guid: 933532a4fcc9baf4fa0491de14d08ed7, type: 3}
|
||||
m_ValidKeywords:
|
||||
- _EMISSION
|
||||
m_InvalidKeywords: []
|
||||
m_LightmapFlags: 1
|
||||
m_EnableInstancingVariants: 0
|
||||
m_DoubleSidedGI: 0
|
||||
m_CustomRenderQueue: -1
|
||||
stringTagMap:
|
||||
RenderType: Opaque
|
||||
disabledShaderPasses: []
|
||||
m_SavedProperties:
|
||||
serializedVersion: 3
|
||||
m_TexEnvs:
|
||||
- _BaseMap:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _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}
|
||||
- _SpecGlossMap:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- unity_Lightmaps:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- unity_LightmapsInd:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- unity_ShadowMasks:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
m_Ints: []
|
||||
m_Floats:
|
||||
- _AlphaClip: 0
|
||||
- _Blend: 0
|
||||
- _BumpScale: 1
|
||||
- _ClearCoatMask: 0
|
||||
- _ClearCoatSmoothness: 0
|
||||
- _Cull: 2
|
||||
- _Cutoff: 0.5
|
||||
- _DetailAlbedoMapScale: 1
|
||||
- _DetailNormalMapScale: 1
|
||||
- _DstBlend: 0
|
||||
- _EnvironmentReflections: 1
|
||||
- _GlossMapScale: 1
|
||||
- _Glossiness: 0.35
|
||||
- _GlossyReflections: 1
|
||||
- _Metallic: 0.86
|
||||
- _Mode: 0
|
||||
- _OcclusionStrength: 1
|
||||
- _Parallax: 0.02
|
||||
- _QueueOffset: 0
|
||||
- _ReceiveShadows: 1
|
||||
- _Smoothness: 0.35
|
||||
- _SmoothnessTextureChannel: 0
|
||||
- _SpecularHighlights: 1
|
||||
- _SrcBlend: 1
|
||||
- _Surface: 0
|
||||
- _UVSec: 0
|
||||
- _WorkflowMode: 1
|
||||
- _ZWrite: 1
|
||||
m_Colors:
|
||||
- _BaseColor: {r: 1, g: 1, b: 1, a: 1}
|
||||
- _Color: {r: 1, g: 1, b: 1, a: 1}
|
||||
- _EmissionColor: {r: 0.6226415, g: 0.6226415, b: 0.6226415, a: 1}
|
||||
- _SpecColor: {r: 0.19999996, g: 0.19999996, b: 0.19999996, a: 1}
|
||||
m_BuildTextureStacks: []
|
||||
--- !u!114 &145002026564787266
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 11
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 0}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: d0353a89b1f911e48b9e16bdc9f2e058, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
version: 5
|
||||
8
Assets/Materials/Drone/Art/material/White.mat.meta
Normal file
8
Assets/Materials/Drone/Art/material/White.mat.meta
Normal file
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 91d21386d1235164cb09fa2332de50b6
|
||||
NativeFormatImporter:
|
||||
externalObjects: {}
|
||||
mainObjectFileID: 0
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
128
Assets/Materials/Drone/Art/material/black.mat
Normal file
128
Assets/Materials/Drone/Art/material/black.mat
Normal file
@@ -0,0 +1,128 @@
|
||||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!114 &-6316481006161375702
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 11
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 0}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: d0353a89b1f911e48b9e16bdc9f2e058, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
version: 5
|
||||
--- !u!21 &2100000
|
||||
Material:
|
||||
serializedVersion: 8
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_Name: black
|
||||
m_Shader: {fileID: 4800000, guid: 933532a4fcc9baf4fa0491de14d08ed7, type: 3}
|
||||
m_ValidKeywords: []
|
||||
m_InvalidKeywords: []
|
||||
m_LightmapFlags: 4
|
||||
m_EnableInstancingVariants: 0
|
||||
m_DoubleSidedGI: 0
|
||||
m_CustomRenderQueue: -1
|
||||
stringTagMap:
|
||||
RenderType: Opaque
|
||||
disabledShaderPasses: []
|
||||
m_SavedProperties:
|
||||
serializedVersion: 3
|
||||
m_TexEnvs:
|
||||
- _BaseMap:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _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}
|
||||
- _SpecGlossMap:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- unity_Lightmaps:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- unity_LightmapsInd:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- unity_ShadowMasks:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
m_Ints: []
|
||||
m_Floats:
|
||||
- _AlphaClip: 0
|
||||
- _Blend: 0
|
||||
- _BumpScale: 1
|
||||
- _ClearCoatMask: 0
|
||||
- _ClearCoatSmoothness: 0
|
||||
- _Cull: 2
|
||||
- _Cutoff: 0.5
|
||||
- _DetailAlbedoMapScale: 1
|
||||
- _DetailNormalMapScale: 1
|
||||
- _DstBlend: 0
|
||||
- _EnvironmentReflections: 1
|
||||
- _GlossMapScale: 1
|
||||
- _Glossiness: 0.64
|
||||
- _GlossyReflections: 1
|
||||
- _Metallic: 0.87
|
||||
- _Mode: 0
|
||||
- _OcclusionStrength: 1
|
||||
- _Parallax: 0.02
|
||||
- _QueueOffset: 0
|
||||
- _ReceiveShadows: 1
|
||||
- _Smoothness: 0.64
|
||||
- _SmoothnessTextureChannel: 0
|
||||
- _SpecularHighlights: 1
|
||||
- _SrcBlend: 1
|
||||
- _Surface: 0
|
||||
- _UVSec: 0
|
||||
- _WorkflowMode: 1
|
||||
- _ZWrite: 1
|
||||
m_Colors:
|
||||
- _BaseColor: {r: 0.1132075, g: 0.1132075, b: 0.1132075, a: 1}
|
||||
- _Color: {r: 0.11320745, g: 0.11320745, b: 0.11320745, a: 1}
|
||||
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
|
||||
- _SpecColor: {r: 0.19999996, g: 0.19999996, b: 0.19999996, a: 1}
|
||||
m_BuildTextureStacks: []
|
||||
8
Assets/Materials/Drone/Art/material/black.mat.meta
Normal file
8
Assets/Materials/Drone/Art/material/black.mat.meta
Normal file
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: ca862d9708fb270498ff25634a51396d
|
||||
NativeFormatImporter:
|
||||
externalObjects: {}
|
||||
mainObjectFileID: 0
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
129
Assets/Materials/Drone/Art/material/blue.mat
Normal file
129
Assets/Materials/Drone/Art/material/blue.mat
Normal file
@@ -0,0 +1,129 @@
|
||||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!114 &-8131856362459895997
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 11
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 0}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: d0353a89b1f911e48b9e16bdc9f2e058, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
version: 5
|
||||
--- !u!21 &2100000
|
||||
Material:
|
||||
serializedVersion: 8
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_Name: blue
|
||||
m_Shader: {fileID: 4800000, guid: 933532a4fcc9baf4fa0491de14d08ed7, type: 3}
|
||||
m_ValidKeywords:
|
||||
- _EMISSION
|
||||
m_InvalidKeywords: []
|
||||
m_LightmapFlags: 1
|
||||
m_EnableInstancingVariants: 0
|
||||
m_DoubleSidedGI: 0
|
||||
m_CustomRenderQueue: -1
|
||||
stringTagMap:
|
||||
RenderType: Opaque
|
||||
disabledShaderPasses: []
|
||||
m_SavedProperties:
|
||||
serializedVersion: 3
|
||||
m_TexEnvs:
|
||||
- _BaseMap:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _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}
|
||||
- _SpecGlossMap:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- unity_Lightmaps:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- unity_LightmapsInd:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- unity_ShadowMasks:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
m_Ints: []
|
||||
m_Floats:
|
||||
- _AlphaClip: 0
|
||||
- _Blend: 0
|
||||
- _BumpScale: 1
|
||||
- _ClearCoatMask: 0
|
||||
- _ClearCoatSmoothness: 0
|
||||
- _Cull: 2
|
||||
- _Cutoff: 0.5
|
||||
- _DetailAlbedoMapScale: 1
|
||||
- _DetailNormalMapScale: 1
|
||||
- _DstBlend: 0
|
||||
- _EnvironmentReflections: 1
|
||||
- _GlossMapScale: 1
|
||||
- _Glossiness: 0.5
|
||||
- _GlossyReflections: 1
|
||||
- _Metallic: 0.53
|
||||
- _Mode: 0
|
||||
- _OcclusionStrength: 1
|
||||
- _Parallax: 0.02
|
||||
- _QueueOffset: 0
|
||||
- _ReceiveShadows: 1
|
||||
- _Smoothness: 0.5
|
||||
- _SmoothnessTextureChannel: 0
|
||||
- _SpecularHighlights: 1
|
||||
- _SrcBlend: 1
|
||||
- _Surface: 0
|
||||
- _UVSec: 0
|
||||
- _WorkflowMode: 1
|
||||
- _ZWrite: 1
|
||||
m_Colors:
|
||||
- _BaseColor: {r: 0, g: 0.638464, b: 1, a: 1}
|
||||
- _Color: {r: 0, g: 0.638464, b: 1, a: 1}
|
||||
- _EmissionColor: {r: 0.062032763, g: 0.55507654, b: 0.7735849, a: 1}
|
||||
- _SpecColor: {r: 0.19999996, g: 0.19999996, b: 0.19999996, a: 1}
|
||||
m_BuildTextureStacks: []
|
||||
8
Assets/Materials/Drone/Art/material/blue.mat.meta
Normal file
8
Assets/Materials/Drone/Art/material/blue.mat.meta
Normal file
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 3ed809d028eefbb4ca5472e0a5c732a0
|
||||
NativeFormatImporter:
|
||||
externalObjects: {}
|
||||
mainObjectFileID: 0
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
128
Assets/Materials/Drone/Art/material/grey.mat
Normal file
128
Assets/Materials/Drone/Art/material/grey.mat
Normal file
@@ -0,0 +1,128 @@
|
||||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!21 &2100000
|
||||
Material:
|
||||
serializedVersion: 8
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_Name: grey
|
||||
m_Shader: {fileID: 4800000, guid: 933532a4fcc9baf4fa0491de14d08ed7, type: 3}
|
||||
m_ValidKeywords: []
|
||||
m_InvalidKeywords: []
|
||||
m_LightmapFlags: 4
|
||||
m_EnableInstancingVariants: 0
|
||||
m_DoubleSidedGI: 0
|
||||
m_CustomRenderQueue: -1
|
||||
stringTagMap:
|
||||
RenderType: Opaque
|
||||
disabledShaderPasses: []
|
||||
m_SavedProperties:
|
||||
serializedVersion: 3
|
||||
m_TexEnvs:
|
||||
- _BaseMap:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _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}
|
||||
- _SpecGlossMap:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- unity_Lightmaps:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- unity_LightmapsInd:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- unity_ShadowMasks:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
m_Ints: []
|
||||
m_Floats:
|
||||
- _AlphaClip: 0
|
||||
- _Blend: 0
|
||||
- _BumpScale: 1
|
||||
- _ClearCoatMask: 0
|
||||
- _ClearCoatSmoothness: 0
|
||||
- _Cull: 2
|
||||
- _Cutoff: 0.5
|
||||
- _DetailAlbedoMapScale: 1
|
||||
- _DetailNormalMapScale: 1
|
||||
- _DstBlend: 0
|
||||
- _EnvironmentReflections: 1
|
||||
- _GlossMapScale: 1
|
||||
- _Glossiness: 0.55
|
||||
- _GlossyReflections: 1
|
||||
- _Metallic: 1
|
||||
- _Mode: 0
|
||||
- _OcclusionStrength: 1
|
||||
- _Parallax: 0.02
|
||||
- _QueueOffset: 0
|
||||
- _ReceiveShadows: 1
|
||||
- _Smoothness: 0.55
|
||||
- _SmoothnessTextureChannel: 0
|
||||
- _SpecularHighlights: 1
|
||||
- _SrcBlend: 1
|
||||
- _Surface: 0
|
||||
- _UVSec: 0
|
||||
- _WorkflowMode: 1
|
||||
- _ZWrite: 1
|
||||
m_Colors:
|
||||
- _BaseColor: {r: 0.745283, g: 0.745283, b: 0.745283, a: 1}
|
||||
- _Color: {r: 0.745283, g: 0.745283, b: 0.745283, a: 1}
|
||||
- _EmissionColor: {r: 0.13207549, g: 0.13207549, b: 0.13207549, a: 1}
|
||||
- _SpecColor: {r: 0.19999996, g: 0.19999996, b: 0.19999996, a: 1}
|
||||
m_BuildTextureStacks: []
|
||||
--- !u!114 &5068345603218358836
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 11
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 0}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: d0353a89b1f911e48b9e16bdc9f2e058, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
version: 5
|
||||
8
Assets/Materials/Drone/Art/material/grey.mat.meta
Normal file
8
Assets/Materials/Drone/Art/material/grey.mat.meta
Normal file
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 719efd02f6cfa794ea0a203cf90365a6
|
||||
NativeFormatImporter:
|
||||
externalObjects: {}
|
||||
mainObjectFileID: 0
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
129
Assets/Materials/Drone/Art/material/orange.mat
Normal file
129
Assets/Materials/Drone/Art/material/orange.mat
Normal file
@@ -0,0 +1,129 @@
|
||||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!114 &-4489013235915496577
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 11
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 0}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: d0353a89b1f911e48b9e16bdc9f2e058, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
version: 5
|
||||
--- !u!21 &2100000
|
||||
Material:
|
||||
serializedVersion: 8
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_Name: orange
|
||||
m_Shader: {fileID: 4800000, guid: 933532a4fcc9baf4fa0491de14d08ed7, type: 3}
|
||||
m_ValidKeywords:
|
||||
- _EMISSION
|
||||
m_InvalidKeywords: []
|
||||
m_LightmapFlags: 1
|
||||
m_EnableInstancingVariants: 0
|
||||
m_DoubleSidedGI: 0
|
||||
m_CustomRenderQueue: -1
|
||||
stringTagMap:
|
||||
RenderType: Opaque
|
||||
disabledShaderPasses: []
|
||||
m_SavedProperties:
|
||||
serializedVersion: 3
|
||||
m_TexEnvs:
|
||||
- _BaseMap:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _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}
|
||||
- _SpecGlossMap:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- unity_Lightmaps:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- unity_LightmapsInd:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- unity_ShadowMasks:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
m_Ints: []
|
||||
m_Floats:
|
||||
- _AlphaClip: 0
|
||||
- _Blend: 0
|
||||
- _BumpScale: 1
|
||||
- _ClearCoatMask: 0
|
||||
- _ClearCoatSmoothness: 0
|
||||
- _Cull: 2
|
||||
- _Cutoff: 0.5
|
||||
- _DetailAlbedoMapScale: 1
|
||||
- _DetailNormalMapScale: 1
|
||||
- _DstBlend: 0
|
||||
- _EnvironmentReflections: 1
|
||||
- _GlossMapScale: 1
|
||||
- _Glossiness: 0.5
|
||||
- _GlossyReflections: 1
|
||||
- _Metallic: 0.81
|
||||
- _Mode: 0
|
||||
- _OcclusionStrength: 1
|
||||
- _Parallax: 0.02
|
||||
- _QueueOffset: 0
|
||||
- _ReceiveShadows: 1
|
||||
- _Smoothness: 0.5
|
||||
- _SmoothnessTextureChannel: 0
|
||||
- _SpecularHighlights: 1
|
||||
- _SrcBlend: 1
|
||||
- _Surface: 0
|
||||
- _UVSec: 0
|
||||
- _WorkflowMode: 1
|
||||
- _ZWrite: 1
|
||||
m_Colors:
|
||||
- _BaseColor: {r: 1, g: 0.25387254, b: 0, a: 1}
|
||||
- _Color: {r: 1, g: 0.2538725, b: 0, a: 1}
|
||||
- _EmissionColor: {r: 2, g: 0.50980395, b: 0, a: 1}
|
||||
- _SpecColor: {r: 0.19999996, g: 0.19999996, b: 0.19999996, a: 1}
|
||||
m_BuildTextureStacks: []
|
||||
8
Assets/Materials/Drone/Art/material/orange.mat.meta
Normal file
8
Assets/Materials/Drone/Art/material/orange.mat.meta
Normal file
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 7ce88dd9da3c1b4439824758a237eb28
|
||||
NativeFormatImporter:
|
||||
externalObjects: {}
|
||||
mainObjectFileID: 0
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
8
Assets/Materials/Drone/Art/model.meta
Normal file
8
Assets/Materials/Drone/Art/model.meta
Normal file
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: f593ac7cd33aea3438cf573c3642ece7
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
BIN
Assets/Materials/Drone/Art/model/drone.fbx
Normal file
BIN
Assets/Materials/Drone/Art/model/drone.fbx
Normal file
Binary file not shown.
101
Assets/Materials/Drone/Art/model/drone.fbx.meta
Normal file
101
Assets/Materials/Drone/Art/model/drone.fbx.meta
Normal file
@@ -0,0 +1,101 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 77ec979c4a1053f4fb90fee3d17b240c
|
||||
ModelImporter:
|
||||
serializedVersion: 20101
|
||||
internalIDToNameTable: []
|
||||
externalObjects: {}
|
||||
materials:
|
||||
materialImportMode: 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: 0
|
||||
meshes:
|
||||
lODScreenPercentages: []
|
||||
globalScale: 1
|
||||
meshCompression: 0
|
||||
addColliders: 0
|
||||
useSRGBMaterialColor: 1
|
||||
sortHierarchyByName: 0
|
||||
importVisibility: 0
|
||||
importBlendShapes: 0
|
||||
importCameras: 0
|
||||
importLights: 0
|
||||
fileIdsGeneration: 2
|
||||
swapUVChannels: 0
|
||||
generateSecondaryUV: 0
|
||||
useFileUnits: 1
|
||||
keepQuads: 0
|
||||
weldVertices: 1
|
||||
bakeAxisConversion: 0
|
||||
preserveHierarchy: 0
|
||||
skinWeightsMode: 0
|
||||
maxBonesPerVertex: 4
|
||||
minBoneWeight: 0.001
|
||||
meshOptimizationFlags: -1
|
||||
indexFormat: 0
|
||||
secondaryUVAngleDistortion: 8
|
||||
secondaryUVAreaDistortion: 15.000001
|
||||
secondaryUVHardAngle: 88
|
||||
secondaryUVMarginMethod: 1
|
||||
secondaryUVMinLightmapResolution: 40
|
||||
secondaryUVMinObjectScale: 1
|
||||
secondaryUVPackMargin: 4
|
||||
useFileScale: 1
|
||||
tangentSpace:
|
||||
normalSmoothAngle: 60
|
||||
normalImportMode: 0
|
||||
tangentImportMode: 3
|
||||
normalCalculationMode: 4
|
||||
legacyComputeAllNormalsFromSmoothingGroupsWhenMeshHasBlendShapes: 0
|
||||
blendShapeNormalImportMode: 1
|
||||
normalSmoothingSource: 0
|
||||
referencedClips: []
|
||||
importAnimation: 0
|
||||
humanDescription:
|
||||
serializedVersion: 3
|
||||
human: []
|
||||
skeleton: []
|
||||
armTwist: 0.5
|
||||
foreArmTwist: 0.5
|
||||
upperLegTwist: 0.5
|
||||
legTwist: 0.5
|
||||
armStretch: 0.05
|
||||
legStretch: 0.05
|
||||
feetSpacing: 0
|
||||
globalScale: 1
|
||||
rootMotionBoneName:
|
||||
hasTranslationDoF: 0
|
||||
hasExtraRoot: 0
|
||||
skeletonHasParents: 1
|
||||
lastHumanDescriptionAvatarSource: {instanceID: 0}
|
||||
autoGenerateAvatarMappingIfUnspecified: 1
|
||||
animationType: 0
|
||||
humanoidOversampling: 1
|
||||
avatarSetup: 0
|
||||
additionalBone: 0
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
2
Assets/Materials/JMO Assets.meta
Normal file
2
Assets/Materials/JMO Assets.meta
Normal file
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 976974e4d3018034e87caeb9f51f20f6
|
||||
8
Assets/Materials/JMO Assets/Cartoon FX Remaster.meta
Normal file
8
Assets/Materials/JMO Assets/Cartoon FX Remaster.meta
Normal file
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: b56551e9e3ab84e4180b7b30c06ff232
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: bd9d1d014bf0b14428db03b2527d2d93
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 1a426d2ed10d55c47b7aee95ace55b60
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,14 @@
|
||||
{
|
||||
"name": "CFXREditor",
|
||||
"references": [],
|
||||
"optionalUnityReferences": [],
|
||||
"includePlatforms": [
|
||||
"Editor"
|
||||
],
|
||||
"excludePlatforms": [],
|
||||
"allowUnsafeCode": false,
|
||||
"overrideReferences": false,
|
||||
"precompiledReferences": [],
|
||||
"autoReferenced": true,
|
||||
"defineConstraints": []
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: eb5cb7c323a395242a81960087292f3c
|
||||
AssemblyDefinitionImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,275 @@
|
||||
//--------------------------------------------------------------------------------------------------------------------------------
|
||||
// Cartoon FX
|
||||
// (c) 2012-2025 Jean Moreno
|
||||
//--------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
|
||||
// Parse conditional expressions from CFXR_MaterialInspector to show/hide some parts of the UI easily
|
||||
|
||||
namespace CartoonFX
|
||||
{
|
||||
public static class ExpressionParser
|
||||
{
|
||||
public delegate bool EvaluateFunction(string content);
|
||||
|
||||
//--------------------------------------------------------------------------------------------------------------------------------
|
||||
// Main Function to use
|
||||
|
||||
static public bool EvaluateExpression(string expression, EvaluateFunction evalFunction)
|
||||
{
|
||||
//Remove white spaces and double && ||
|
||||
string cleanExpr = "";
|
||||
for(int i = 0; i < expression.Length; i++)
|
||||
{
|
||||
switch(expression[i])
|
||||
{
|
||||
case ' ': break;
|
||||
case '&': cleanExpr += expression[i]; i++; break;
|
||||
case '|': cleanExpr += expression[i]; i++; break;
|
||||
default: cleanExpr += expression[i]; break;
|
||||
}
|
||||
}
|
||||
|
||||
List<Token> tokens = new List<Token>();
|
||||
StringReader reader = new StringReader(cleanExpr);
|
||||
Token t = null;
|
||||
do
|
||||
{
|
||||
t = new Token(reader);
|
||||
tokens.Add(t);
|
||||
} while(t.type != Token.TokenType.EXPR_END);
|
||||
|
||||
List<Token> polishNotation = Token.TransformToPolishNotation(tokens);
|
||||
|
||||
var enumerator = polishNotation.GetEnumerator();
|
||||
enumerator.MoveNext();
|
||||
Expression root = MakeExpression(ref enumerator, evalFunction);
|
||||
|
||||
return root.Evaluate();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------------------------------------
|
||||
// Expression Token
|
||||
|
||||
public class Token
|
||||
{
|
||||
static Dictionary<char, KeyValuePair<TokenType, string>> typesDict = new Dictionary<char, KeyValuePair<TokenType, string>>()
|
||||
{
|
||||
{'(', new KeyValuePair<TokenType, string>(TokenType.OPEN_PAREN, "(")},
|
||||
{')', new KeyValuePair<TokenType, string>(TokenType.CLOSE_PAREN, ")")},
|
||||
{'!', new KeyValuePair<TokenType, string>(TokenType.UNARY_OP, "NOT")},
|
||||
{'&', new KeyValuePair<TokenType, string>(TokenType.BINARY_OP, "AND")},
|
||||
{'|', new KeyValuePair<TokenType, string>(TokenType.BINARY_OP, "OR")}
|
||||
};
|
||||
|
||||
public enum TokenType
|
||||
{
|
||||
OPEN_PAREN,
|
||||
CLOSE_PAREN,
|
||||
UNARY_OP,
|
||||
BINARY_OP,
|
||||
LITERAL,
|
||||
EXPR_END
|
||||
}
|
||||
|
||||
public TokenType type;
|
||||
public string value;
|
||||
|
||||
public Token(StringReader s)
|
||||
{
|
||||
int c = s.Read();
|
||||
if(c == -1)
|
||||
{
|
||||
type = TokenType.EXPR_END;
|
||||
value = "";
|
||||
return;
|
||||
}
|
||||
|
||||
char ch = (char)c;
|
||||
|
||||
//Special case: solve bug where !COND_FALSE_1 && COND_FALSE_2 would return True
|
||||
bool embeddedNot = (ch == '!' && s.Peek() != '(');
|
||||
|
||||
if(typesDict.ContainsKey(ch) && !embeddedNot)
|
||||
{
|
||||
type = typesDict[ch].Key;
|
||||
value = typesDict[ch].Value;
|
||||
}
|
||||
else
|
||||
{
|
||||
string str = "";
|
||||
str += ch;
|
||||
while(s.Peek() != -1 && !typesDict.ContainsKey((char)s.Peek()))
|
||||
{
|
||||
str += (char)s.Read();
|
||||
}
|
||||
type = TokenType.LITERAL;
|
||||
value = str;
|
||||
}
|
||||
}
|
||||
|
||||
static public List<Token> TransformToPolishNotation(List<Token> infixTokenList)
|
||||
{
|
||||
Queue<Token> outputQueue = new Queue<Token>();
|
||||
Stack<Token> stack = new Stack<Token>();
|
||||
|
||||
int index = 0;
|
||||
while(infixTokenList.Count > index)
|
||||
{
|
||||
Token t = infixTokenList[index];
|
||||
|
||||
switch(t.type)
|
||||
{
|
||||
case Token.TokenType.LITERAL:
|
||||
outputQueue.Enqueue(t);
|
||||
break;
|
||||
case Token.TokenType.BINARY_OP:
|
||||
case Token.TokenType.UNARY_OP:
|
||||
case Token.TokenType.OPEN_PAREN:
|
||||
stack.Push(t);
|
||||
break;
|
||||
case Token.TokenType.CLOSE_PAREN:
|
||||
while(stack.Peek().type != Token.TokenType.OPEN_PAREN)
|
||||
{
|
||||
outputQueue.Enqueue(stack.Pop());
|
||||
}
|
||||
stack.Pop();
|
||||
if(stack.Count > 0 && stack.Peek().type == Token.TokenType.UNARY_OP)
|
||||
{
|
||||
outputQueue.Enqueue(stack.Pop());
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
index++;
|
||||
}
|
||||
while(stack.Count > 0)
|
||||
{
|
||||
outputQueue.Enqueue(stack.Pop());
|
||||
}
|
||||
|
||||
var list = new List<Token>(outputQueue);
|
||||
list.Reverse();
|
||||
return list;
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------------------------------------
|
||||
// Boolean Expression Classes
|
||||
|
||||
public abstract class Expression
|
||||
{
|
||||
public abstract bool Evaluate();
|
||||
}
|
||||
|
||||
public class ExpressionLeaf : Expression
|
||||
{
|
||||
private string content;
|
||||
private EvaluateFunction evalFunction;
|
||||
|
||||
public ExpressionLeaf(EvaluateFunction _evalFunction, string _content)
|
||||
{
|
||||
this.evalFunction = _evalFunction;
|
||||
this.content = _content;
|
||||
}
|
||||
|
||||
override public bool Evaluate()
|
||||
{
|
||||
//embedded not, see special case in Token declaration
|
||||
if(content.StartsWith("!"))
|
||||
{
|
||||
return !this.evalFunction(content.Substring(1));
|
||||
}
|
||||
|
||||
return this.evalFunction(content);
|
||||
}
|
||||
}
|
||||
|
||||
public class ExpressionAnd : Expression
|
||||
{
|
||||
private Expression left;
|
||||
private Expression right;
|
||||
|
||||
public ExpressionAnd(Expression _left, Expression _right)
|
||||
{
|
||||
this.left = _left;
|
||||
this.right = _right;
|
||||
}
|
||||
|
||||
override public bool Evaluate()
|
||||
{
|
||||
return left.Evaluate() && right.Evaluate();
|
||||
}
|
||||
}
|
||||
|
||||
public class ExpressionOr : Expression
|
||||
{
|
||||
private Expression left;
|
||||
private Expression right;
|
||||
|
||||
public ExpressionOr(Expression _left, Expression _right)
|
||||
{
|
||||
this.left = _left;
|
||||
this.right = _right;
|
||||
}
|
||||
|
||||
override public bool Evaluate()
|
||||
{
|
||||
return left.Evaluate() || right.Evaluate();
|
||||
}
|
||||
}
|
||||
|
||||
public class ExpressionNot : Expression
|
||||
{
|
||||
private Expression expr;
|
||||
|
||||
public ExpressionNot(Expression _expr)
|
||||
{
|
||||
this.expr = _expr;
|
||||
}
|
||||
|
||||
override public bool Evaluate()
|
||||
{
|
||||
return !expr.Evaluate();
|
||||
}
|
||||
}
|
||||
|
||||
static public Expression MakeExpression(ref List<Token>.Enumerator polishNotationTokensEnumerator, EvaluateFunction _evalFunction)
|
||||
{
|
||||
if(polishNotationTokensEnumerator.Current.type == Token.TokenType.LITERAL)
|
||||
{
|
||||
Expression lit = new ExpressionLeaf(_evalFunction, polishNotationTokensEnumerator.Current.value);
|
||||
polishNotationTokensEnumerator.MoveNext();
|
||||
return lit;
|
||||
}
|
||||
else
|
||||
{
|
||||
if(polishNotationTokensEnumerator.Current.value == "NOT")
|
||||
{
|
||||
polishNotationTokensEnumerator.MoveNext();
|
||||
Expression operand = MakeExpression(ref polishNotationTokensEnumerator, _evalFunction);
|
||||
return new ExpressionNot(operand);
|
||||
}
|
||||
else if(polishNotationTokensEnumerator.Current.value == "AND")
|
||||
{
|
||||
polishNotationTokensEnumerator.MoveNext();
|
||||
Expression left = MakeExpression(ref polishNotationTokensEnumerator, _evalFunction);
|
||||
Expression right = MakeExpression(ref polishNotationTokensEnumerator, _evalFunction);
|
||||
return new ExpressionAnd(left, right);
|
||||
}
|
||||
else if(polishNotationTokensEnumerator.Current.value == "OR")
|
||||
{
|
||||
polishNotationTokensEnumerator.MoveNext();
|
||||
Expression left = MakeExpression(ref polishNotationTokensEnumerator, _evalFunction);
|
||||
Expression right = MakeExpression(ref polishNotationTokensEnumerator, _evalFunction);
|
||||
return new ExpressionOr(left, right);
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
fileFormatVersion: 2
|
||||
guid: ce7d96d3a4d4f3b4681ab437a9710d60
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,604 @@
|
||||
//--------------------------------------------------------------------------------------------------------------------------------
|
||||
// Cartoon FX
|
||||
// (c) 2012-2025 Jean Moreno
|
||||
//--------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
using UnityEngine;
|
||||
using UnityEditor;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Text.RegularExpressions;
|
||||
|
||||
// Custom material inspector for Stylized FX shaders
|
||||
// - organize UI using comments in the shader code
|
||||
// - more flexibility than the material property drawers
|
||||
// version 2 (dec 2017)
|
||||
|
||||
namespace CartoonFX
|
||||
{
|
||||
public class MaterialInspector : ShaderGUI
|
||||
{
|
||||
//Set by PropertyDrawers to defined if the next properties should be visible
|
||||
static private Stack<bool> ShowStack = new Stack<bool>();
|
||||
|
||||
static public bool ShowNextProperty { get; private set; }
|
||||
static public void PushShowProperty(bool value)
|
||||
{
|
||||
ShowStack.Push(ShowNextProperty);
|
||||
ShowNextProperty &= value;
|
||||
}
|
||||
static public void PopShowProperty()
|
||||
{
|
||||
ShowNextProperty = ShowStack.Pop();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
const string kGuiCommandPrefix = "//#";
|
||||
const string kGC_IfKeyword = "IF_KEYWORD";
|
||||
const string kGC_IfProperty = "IF_PROPERTY";
|
||||
const string kGC_EndIf = "END_IF";
|
||||
const string kGC_HelpBox = "HELP_BOX";
|
||||
const string kGC_Label = "LABEL";
|
||||
|
||||
Dictionary<int, List<GUICommand>> guiCommands = new Dictionary<int, List<GUICommand>>();
|
||||
|
||||
bool initialized = false;
|
||||
AssetImporter shaderImporter;
|
||||
ulong lastTimestamp;
|
||||
void Initialize(MaterialEditor editor, bool force)
|
||||
{
|
||||
if((!initialized || force) && editor != null)
|
||||
{
|
||||
initialized = true;
|
||||
|
||||
guiCommands.Clear();
|
||||
|
||||
//Find the shader and parse the source to find special comments that will organize the GUI
|
||||
//It's hackish, but at least it allows any character to be used (unlike material property drawers/decorators) and can be used along with property drawers
|
||||
|
||||
var materials = new List<Material>();
|
||||
foreach(var o in editor.targets)
|
||||
{
|
||||
var m = o as Material;
|
||||
if(m != null)
|
||||
materials.Add(m);
|
||||
}
|
||||
if(materials.Count > 0 && materials[0].shader != null)
|
||||
{
|
||||
var path = AssetDatabase.GetAssetPath(materials[0].shader);
|
||||
//get asset importer
|
||||
shaderImporter = AssetImporter.GetAtPath(path);
|
||||
if(shaderImporter != null)
|
||||
{
|
||||
lastTimestamp = shaderImporter.assetTimeStamp;
|
||||
}
|
||||
//remove 'Assets' and replace with OS path
|
||||
path = Application.dataPath + path.Substring(6);
|
||||
//convert to cross-platform path
|
||||
path = path.Replace('/', Path.DirectorySeparatorChar);
|
||||
//open file for reading
|
||||
var lines = File.ReadAllLines(path);
|
||||
|
||||
bool insideProperties = false;
|
||||
//regex pattern to find properties, as they need to be counted so that
|
||||
//special commands can be inserted at the right position when enumerating them
|
||||
var regex = new Regex(@"[a-zA-Z0-9_]+\s*\([^\)]*\)");
|
||||
int propertyCount = 0;
|
||||
bool insideCommentBlock = false;
|
||||
foreach(var l in lines)
|
||||
{
|
||||
var line = l.TrimStart();
|
||||
|
||||
if(insideProperties)
|
||||
{
|
||||
bool isComment = line.StartsWith("//");
|
||||
|
||||
if(line.Contains("/*"))
|
||||
insideCommentBlock = true;
|
||||
if(line.Contains("*/"))
|
||||
insideCommentBlock = false;
|
||||
|
||||
//finished properties block?
|
||||
if(line.StartsWith("}"))
|
||||
break;
|
||||
|
||||
//comment
|
||||
if(line.StartsWith(kGuiCommandPrefix))
|
||||
{
|
||||
string command = line.Substring(kGuiCommandPrefix.Length).TrimStart();
|
||||
//space
|
||||
if(string.IsNullOrEmpty(command))
|
||||
AddGUICommand(propertyCount, new GC_Space());
|
||||
//separator
|
||||
else if(command.StartsWith("---"))
|
||||
AddGUICommand(propertyCount, new GC_Separator());
|
||||
//separator
|
||||
else if(command.StartsWith("==="))
|
||||
AddGUICommand(propertyCount, new GC_SeparatorDouble());
|
||||
//if keyword
|
||||
else if(command.StartsWith(kGC_IfKeyword))
|
||||
{
|
||||
var expr = command.Substring(command.LastIndexOf(kGC_IfKeyword) + kGC_IfKeyword.Length + 1);
|
||||
AddGUICommand(propertyCount, new GC_IfKeyword() { expression = expr, materials = materials.ToArray() });
|
||||
}
|
||||
//if property
|
||||
else if(command.StartsWith(kGC_IfProperty))
|
||||
{
|
||||
var expr = command.Substring(command.LastIndexOf(kGC_IfProperty) + kGC_IfProperty.Length + 1);
|
||||
AddGUICommand(propertyCount, new GC_IfProperty() { expression = expr, materials = materials.ToArray() });
|
||||
}
|
||||
//end if
|
||||
else if(command.StartsWith(kGC_EndIf))
|
||||
{
|
||||
AddGUICommand(propertyCount, new GC_EndIf());
|
||||
}
|
||||
//help box
|
||||
else if(command.StartsWith(kGC_HelpBox))
|
||||
{
|
||||
var messageType = MessageType.Error;
|
||||
var message = "Invalid format for HELP_BOX:\n" + command;
|
||||
var cmd = command.Substring(command.LastIndexOf(kGC_HelpBox) + kGC_HelpBox.Length + 1).Split(new string[] { "::" }, System.StringSplitOptions.RemoveEmptyEntries);
|
||||
if(cmd.Length == 1)
|
||||
{
|
||||
message = cmd[0];
|
||||
messageType = MessageType.None;
|
||||
}
|
||||
else if(cmd.Length == 2)
|
||||
{
|
||||
try
|
||||
{
|
||||
var msgType = (MessageType)System.Enum.Parse(typeof(MessageType), cmd[0], true);
|
||||
message = cmd[1].Replace(" ", "\n");
|
||||
messageType = msgType;
|
||||
}
|
||||
catch { }
|
||||
}
|
||||
|
||||
AddGUICommand(propertyCount, new GC_HelpBox()
|
||||
{
|
||||
message = message,
|
||||
messageType = messageType
|
||||
});
|
||||
}
|
||||
//label
|
||||
else if(command.StartsWith(kGC_Label))
|
||||
{
|
||||
var label = command.Substring(command.LastIndexOf(kGC_Label) + kGC_Label.Length + 1);
|
||||
AddGUICommand(propertyCount, new GC_Label() { label = label });
|
||||
}
|
||||
//header: plain text after command
|
||||
else
|
||||
{
|
||||
AddGUICommand(propertyCount, new GC_Header() { label = command });
|
||||
}
|
||||
}
|
||||
else
|
||||
//property
|
||||
{
|
||||
if(regex.IsMatch(line) && !insideCommentBlock && !isComment)
|
||||
propertyCount++;
|
||||
}
|
||||
}
|
||||
|
||||
//start properties block?
|
||||
if(line.StartsWith("Properties"))
|
||||
{
|
||||
insideProperties = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void AddGUICommand(int propertyIndex, GUICommand command)
|
||||
{
|
||||
if(!guiCommands.ContainsKey(propertyIndex))
|
||||
guiCommands.Add(propertyIndex, new List<GUICommand>());
|
||||
|
||||
guiCommands[propertyIndex].Add(command);
|
||||
}
|
||||
|
||||
public override void AssignNewShaderToMaterial(Material material, Shader oldShader, Shader newShader)
|
||||
{
|
||||
initialized = false;
|
||||
base.AssignNewShaderToMaterial(material, oldShader, newShader);
|
||||
}
|
||||
|
||||
public override void OnGUI(MaterialEditor materialEditor, MaterialProperty[] properties)
|
||||
{
|
||||
//init:
|
||||
//- read metadata in properties comment to generate ui layout
|
||||
//- force update if timestamp doesn't match last (= file externally updated)
|
||||
bool force = (shaderImporter != null && shaderImporter.assetTimeStamp != lastTimestamp);
|
||||
Initialize(materialEditor, force);
|
||||
|
||||
var shader = (materialEditor.target as Material).shader;
|
||||
materialEditor.SetDefaultGUIWidths();
|
||||
|
||||
//show all properties by default
|
||||
ShowNextProperty = true;
|
||||
ShowStack.Clear();
|
||||
|
||||
for(int i = 0; i < properties.Length; i++)
|
||||
{
|
||||
if(guiCommands.ContainsKey(i))
|
||||
{
|
||||
for(int j = 0; j < guiCommands[i].Count; j++)
|
||||
{
|
||||
guiCommands[i][j].OnGUI();
|
||||
}
|
||||
}
|
||||
|
||||
//Use custom properties to enable/disable groups based on keywords
|
||||
if(ShowNextProperty)
|
||||
{
|
||||
#if UNITY_6000_1_OR_NEWER
|
||||
if((properties[i].propertyFlags & (UnityEngine.Rendering.ShaderPropertyFlags.HideInInspector | UnityEngine.Rendering.ShaderPropertyFlags.PerRendererData)) == UnityEngine.Rendering.ShaderPropertyFlags.None)
|
||||
#else
|
||||
if((properties[i].flags & (MaterialProperty.PropFlags.HideInInspector | MaterialProperty.PropFlags.PerRendererData)) == MaterialProperty.PropFlags.None)
|
||||
#endif
|
||||
{
|
||||
DisplayProperty(properties[i], materialEditor);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//make sure to show gui commands that are after properties
|
||||
int index = properties.Length;
|
||||
if(guiCommands.ContainsKey(index))
|
||||
{
|
||||
for(int j = 0; j < guiCommands[index].Count; j++)
|
||||
{
|
||||
guiCommands[index][j].OnGUI();
|
||||
}
|
||||
}
|
||||
|
||||
//Special fields
|
||||
Styles.MaterialDrawSeparatorDouble();
|
||||
materialEditor.RenderQueueField();
|
||||
materialEditor.EnableInstancingField();
|
||||
}
|
||||
|
||||
virtual protected void DisplayProperty(MaterialProperty property, MaterialEditor materialEditor)
|
||||
{
|
||||
float propertyHeight = materialEditor.GetPropertyHeight(property, property.displayName);
|
||||
Rect controlRect = EditorGUILayout.GetControlRect(true, propertyHeight, EditorStyles.layerMaskField, new GUILayoutOption[0]);
|
||||
materialEditor.ShaderProperty(controlRect, property, property.displayName);
|
||||
}
|
||||
}
|
||||
|
||||
// Same as Toggle drawer, but doesn't set any keyword
|
||||
// This will avoid adding unnecessary shader keyword to the project
|
||||
internal class MaterialToggleNoKeywordDrawer : MaterialPropertyDrawer
|
||||
{
|
||||
private static bool IsPropertyTypeSuitable(MaterialProperty prop)
|
||||
{
|
||||
#if UNITY_6000_1_OR_NEWER
|
||||
return prop.propertyType == UnityEngine.Rendering.ShaderPropertyType.Float || prop.propertyType == UnityEngine.Rendering.ShaderPropertyType.Range;
|
||||
#else
|
||||
return prop.type == MaterialProperty.PropType.Float || prop.type == MaterialProperty.PropType.Range;
|
||||
#endif
|
||||
}
|
||||
|
||||
public override float GetPropertyHeight(MaterialProperty prop, string label, MaterialEditor editor)
|
||||
{
|
||||
float height;
|
||||
if (!MaterialToggleNoKeywordDrawer.IsPropertyTypeSuitable(prop))
|
||||
{
|
||||
height = 40f;
|
||||
}
|
||||
else
|
||||
{
|
||||
height = base.GetPropertyHeight(prop, label, editor);
|
||||
}
|
||||
return height;
|
||||
}
|
||||
|
||||
public override void OnGUI(Rect position, MaterialProperty prop, GUIContent label, MaterialEditor editor)
|
||||
{
|
||||
if (!MaterialToggleNoKeywordDrawer.IsPropertyTypeSuitable(prop))
|
||||
{
|
||||
EditorGUI.HelpBox(position, "Toggle used on a non-float property: " + prop.name, MessageType.Warning);
|
||||
}
|
||||
else
|
||||
{
|
||||
EditorGUI.BeginChangeCheck();
|
||||
bool flag = Mathf.Abs(prop.floatValue) > 0.001f;
|
||||
EditorGUI.showMixedValue = prop.hasMixedValue;
|
||||
flag = EditorGUI.Toggle(position, label, flag);
|
||||
EditorGUI.showMixedValue = false;
|
||||
if (EditorGUI.EndChangeCheck())
|
||||
{
|
||||
prop.floatValue = ((!flag) ? 0f : 1f);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Same as KeywordEnum drawer, but uses the keyword supplied as is rather than adding a prefix to them
|
||||
internal class MaterialKeywordEnumNoPrefixDrawer : MaterialPropertyDrawer
|
||||
{
|
||||
private readonly GUIContent[] labels;
|
||||
private readonly string[] keywords;
|
||||
|
||||
public MaterialKeywordEnumNoPrefixDrawer(string lbl1, string kw1) : this(new[] { lbl1 }, new[] { kw1 }) { }
|
||||
public MaterialKeywordEnumNoPrefixDrawer(string lbl1, string kw1, string lbl2, string kw2) : this(new[] { lbl1, lbl2 }, new[] { kw1, kw2 }) { }
|
||||
public MaterialKeywordEnumNoPrefixDrawer(string lbl1, string kw1, string lbl2, string kw2, string lbl3, string kw3) : this(new[] { lbl1, lbl2, lbl3 }, new[] { kw1, kw2, kw3 }) { }
|
||||
public MaterialKeywordEnumNoPrefixDrawer(string lbl1, string kw1, string lbl2, string kw2, string lbl3, string kw3, string lbl4, string kw4) : this(new[] { lbl1, lbl2, lbl3, lbl4 }, new[] { kw1, kw2, kw3, kw4 }) { }
|
||||
public MaterialKeywordEnumNoPrefixDrawer(string lbl1, string kw1, string lbl2, string kw2, string lbl3, string kw3, string lbl4, string kw4, string lbl5, string kw5) : this(new[] { lbl1, lbl2, lbl3, lbl4, lbl5 }, new[] { kw1, kw2, kw3, kw4, kw5 }) { }
|
||||
public MaterialKeywordEnumNoPrefixDrawer(string lbl1, string kw1, string lbl2, string kw2, string lbl3, string kw3, string lbl4, string kw4, string lbl5, string kw5, string lbl6, string kw6) : this(new[] { lbl1, lbl2, lbl3, lbl4, lbl5, lbl6 }, new[] { kw1, kw2, kw3, kw4, kw5, kw6 }) { }
|
||||
|
||||
public MaterialKeywordEnumNoPrefixDrawer(string[] labels, string[] keywords)
|
||||
{
|
||||
this.labels= new GUIContent[keywords.Length];
|
||||
this.keywords = new string[keywords.Length];
|
||||
for (int i = 0; i < keywords.Length; ++i)
|
||||
{
|
||||
this.labels[i] = new GUIContent(labels[i]);
|
||||
this.keywords[i] = keywords[i];
|
||||
}
|
||||
}
|
||||
|
||||
static bool IsPropertyTypeSuitable(MaterialProperty prop)
|
||||
{
|
||||
#if UNITY_6000_1_OR_NEWER
|
||||
return prop.propertyType == UnityEngine.Rendering.ShaderPropertyType.Float || prop.propertyType == UnityEngine.Rendering.ShaderPropertyType.Range;
|
||||
#else
|
||||
return prop.type == MaterialProperty.PropType.Float || prop.type == MaterialProperty.PropType.Range;
|
||||
#endif
|
||||
}
|
||||
|
||||
void SetKeyword(MaterialProperty prop, int index)
|
||||
{
|
||||
for (int i = 0; i < keywords.Length; ++i)
|
||||
{
|
||||
string keyword = GetKeywordName(prop.name, keywords[i]);
|
||||
foreach (Material material in prop.targets)
|
||||
{
|
||||
if (index == i)
|
||||
material.EnableKeyword(keyword);
|
||||
else
|
||||
material.DisableKeyword(keyword);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public override float GetPropertyHeight(MaterialProperty prop, string label, MaterialEditor editor)
|
||||
{
|
||||
if (!IsPropertyTypeSuitable(prop))
|
||||
{
|
||||
return EditorGUIUtility.singleLineHeight * 2.5f;
|
||||
}
|
||||
return base.GetPropertyHeight(prop, label, editor);
|
||||
}
|
||||
|
||||
public override void OnGUI(Rect position, MaterialProperty prop, GUIContent label, MaterialEditor editor)
|
||||
{
|
||||
if (!IsPropertyTypeSuitable(prop))
|
||||
{
|
||||
EditorGUI.HelpBox(position, "Toggle used on a non-float property: " + prop.name, MessageType.Warning);
|
||||
return;
|
||||
}
|
||||
|
||||
EditorGUI.BeginChangeCheck();
|
||||
|
||||
EditorGUI.showMixedValue = prop.hasMixedValue;
|
||||
var value = (int)prop.floatValue;
|
||||
value = EditorGUI.Popup(position, label, value, labels);
|
||||
EditorGUI.showMixedValue = false;
|
||||
if (EditorGUI.EndChangeCheck())
|
||||
{
|
||||
prop.floatValue = value;
|
||||
SetKeyword(prop, value);
|
||||
}
|
||||
}
|
||||
|
||||
public override void Apply(MaterialProperty prop)
|
||||
{
|
||||
base.Apply(prop);
|
||||
if (!IsPropertyTypeSuitable(prop))
|
||||
return;
|
||||
|
||||
if (prop.hasMixedValue)
|
||||
return;
|
||||
|
||||
SetKeyword(prop, (int)prop.floatValue);
|
||||
}
|
||||
|
||||
// Final keyword name: property name + "_" + display name. Uppercased,
|
||||
// and spaces replaced with underscores.
|
||||
private static string GetKeywordName(string propName, string name)
|
||||
{
|
||||
// Just return the supplied name
|
||||
return name;
|
||||
|
||||
// Original code:
|
||||
/*
|
||||
string n = propName + "_" + name;
|
||||
return n.Replace(' ', '_').ToUpperInvariant();
|
||||
*/
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//================================================================================================================================================================================================
|
||||
// GUI Commands System
|
||||
//
|
||||
// Workaround to Material Property Drawers limitations:
|
||||
// - uses shader comments to organize the GUI, and show/hide properties based on conditions
|
||||
// - can use any character (unlike property drawers)
|
||||
// - parsed once at material editor initialization
|
||||
|
||||
internal class GUICommand
|
||||
{
|
||||
public virtual bool Visible() { return true; }
|
||||
public virtual void OnGUI() { }
|
||||
}
|
||||
|
||||
internal class GC_Separator : GUICommand { public override void OnGUI() { if(MaterialInspector.ShowNextProperty) Styles.MaterialDrawSeparator(); } }
|
||||
internal class GC_SeparatorDouble : GUICommand { public override void OnGUI() { if(MaterialInspector.ShowNextProperty) Styles.MaterialDrawSeparatorDouble(); } }
|
||||
internal class GC_Space : GUICommand { public override void OnGUI() { if(MaterialInspector.ShowNextProperty) GUILayout.Space(8); } }
|
||||
internal class GC_HelpBox : GUICommand
|
||||
{
|
||||
public string message { get; set; }
|
||||
public MessageType messageType { get; set; }
|
||||
|
||||
public override void OnGUI()
|
||||
{
|
||||
if(MaterialInspector.ShowNextProperty)
|
||||
Styles.HelpBoxRichText(message, messageType);
|
||||
}
|
||||
}
|
||||
internal class GC_Header : GUICommand
|
||||
{
|
||||
public string label { get; set; }
|
||||
GUIContent guiContent;
|
||||
|
||||
public override void OnGUI()
|
||||
{
|
||||
if(guiContent == null)
|
||||
guiContent = new GUIContent(label);
|
||||
|
||||
if(MaterialInspector.ShowNextProperty)
|
||||
Styles.MaterialDrawHeader(guiContent);
|
||||
}
|
||||
}
|
||||
internal class GC_Label : GUICommand
|
||||
{
|
||||
public string label { get; set; }
|
||||
GUIContent guiContent;
|
||||
|
||||
public override void OnGUI()
|
||||
{
|
||||
if(guiContent == null)
|
||||
guiContent = new GUIContent(label);
|
||||
|
||||
if(MaterialInspector.ShowNextProperty)
|
||||
GUILayout.Label(guiContent);
|
||||
}
|
||||
}
|
||||
internal class GC_IfKeyword : GUICommand
|
||||
{
|
||||
public string expression { get; set; }
|
||||
public Material[] materials { get; set; }
|
||||
public override void OnGUI()
|
||||
{
|
||||
bool show = ExpressionParser.EvaluateExpression(expression, (string s) =>
|
||||
{
|
||||
foreach(var m in materials)
|
||||
{
|
||||
if(m.IsKeywordEnabled(s))
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
});
|
||||
MaterialInspector.PushShowProperty(show);
|
||||
}
|
||||
}
|
||||
internal class GC_EndIf : GUICommand { public override void OnGUI() { MaterialInspector.PopShowProperty(); } }
|
||||
|
||||
internal class GC_IfProperty : GUICommand
|
||||
{
|
||||
string _expression;
|
||||
public string expression
|
||||
{
|
||||
get { return _expression; }
|
||||
set { _expression = value.Replace("!=", "<>"); }
|
||||
}
|
||||
public Material[] materials { get; set; }
|
||||
|
||||
public override void OnGUI()
|
||||
{
|
||||
bool show = ExpressionParser.EvaluateExpression(expression, EvaluatePropertyExpression);
|
||||
MaterialInspector.PushShowProperty(show);
|
||||
}
|
||||
|
||||
bool EvaluatePropertyExpression(string expr)
|
||||
{
|
||||
//expression is expected to be in the form of: property operator value
|
||||
var reader = new StringReader(expr);
|
||||
string property = "";
|
||||
string op = "";
|
||||
float value = 0f;
|
||||
|
||||
int overflow = 0;
|
||||
while(true)
|
||||
{
|
||||
char c = (char)reader.Read();
|
||||
|
||||
//operator
|
||||
if(c == '=' || c == '>' || c == '<' || c == '!')
|
||||
{
|
||||
op += c;
|
||||
//second operator character, if any
|
||||
char c2 = (char)reader.Peek();
|
||||
if(c2 == '=' || c2 == '>')
|
||||
{
|
||||
reader.Read();
|
||||
op += c2;
|
||||
}
|
||||
|
||||
//end of string is the value
|
||||
var end = reader.ReadToEnd();
|
||||
if(!float.TryParse(end, out value))
|
||||
{
|
||||
Debug.LogError("Couldn't parse float from property expression:\n" + end);
|
||||
return false;
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
//property name
|
||||
property += c;
|
||||
|
||||
overflow++;
|
||||
if(overflow >= 9999)
|
||||
{
|
||||
Debug.LogError("Expression parsing overflow!\n");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
//evaluate property
|
||||
bool conditionMet = false;
|
||||
foreach(var m in materials)
|
||||
{
|
||||
float propValue = 0f;
|
||||
if(property.Contains(".x") || property.Contains(".y") || property.Contains(".z") || property.Contains(".w"))
|
||||
{
|
||||
string[] split = property.Split('.');
|
||||
string component = split[1];
|
||||
switch(component)
|
||||
{
|
||||
case "x": propValue = m.GetVector(split[0]).x; break;
|
||||
case "y": propValue = m.GetVector(split[0]).y; break;
|
||||
case "z": propValue = m.GetVector(split[0]).z; break;
|
||||
case "w": propValue = m.GetVector(split[0]).w; break;
|
||||
default: Debug.LogError("Invalid component for vector property: '" + property + "'"); break;
|
||||
}
|
||||
}
|
||||
else
|
||||
propValue = m.GetFloat(property);
|
||||
|
||||
switch(op)
|
||||
{
|
||||
case ">=": conditionMet = propValue >= value; break;
|
||||
case "<=": conditionMet = propValue <= value; break;
|
||||
case ">": conditionMet = propValue > value; break;
|
||||
case "<": conditionMet = propValue < value; break;
|
||||
case "<>": conditionMet = propValue != value; break; //not equal, "!=" is replaced by "<>" to prevent bug with leading ! ("not" operator)
|
||||
case "==": conditionMet = propValue == value; break;
|
||||
default:
|
||||
Debug.LogError("Invalid property expression:\n" + expr);
|
||||
break;
|
||||
}
|
||||
if(conditionMet)
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 4fb4c15e772a1cc4baecc7a958bf9cc7
|
||||
timeCreated: 1486392341
|
||||
licenseType: Store
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,423 @@
|
||||
// #define SHOW_EXPORT_BUTTON
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
using System.IO;
|
||||
using System.Reflection;
|
||||
using UnityEditor;
|
||||
using UnityEditor.Rendering;
|
||||
using UnityEngine;
|
||||
#if UNITY_2020_2_OR_NEWER
|
||||
using UnityEditor.AssetImporters;
|
||||
#else
|
||||
using UnityEditor.Experimental.AssetImporters;
|
||||
#endif
|
||||
using UnityEngine.Rendering;
|
||||
|
||||
namespace CartoonFX
|
||||
{
|
||||
namespace CustomShaderImporter
|
||||
{
|
||||
static class Utils
|
||||
{
|
||||
public static bool IsUsingURP()
|
||||
{
|
||||
#if UNITY_2019_3_OR_NEWER
|
||||
var renderPipeline = GraphicsSettings.currentRenderPipeline;
|
||||
#else
|
||||
var renderPipeline = GraphicsSettings.renderPipelineAsset;
|
||||
#endif
|
||||
return renderPipeline != null && renderPipeline.GetType().Name.Contains("Universal");
|
||||
}
|
||||
}
|
||||
|
||||
[ScriptedImporter(0, FILE_EXTENSION)]
|
||||
public class CFXR_ShaderImporter : ScriptedImporter
|
||||
{
|
||||
public enum RenderPipeline
|
||||
{
|
||||
Auto,
|
||||
ForceBuiltInRenderPipeline,
|
||||
ForceUniversalRenderPipeline
|
||||
}
|
||||
|
||||
public const string FILE_EXTENSION = "cfxrshader";
|
||||
|
||||
[Tooltip("In case of errors when building the project or with addressables, you can try forcing a specific render pipeline")]
|
||||
public RenderPipeline renderPipelineDetection = RenderPipeline.Auto;
|
||||
public string detectedRenderPipeline = "Built-In Render Pipeline";
|
||||
public int strippedLinesCount = 0;
|
||||
public string shaderSourceCode;
|
||||
public string shaderName;
|
||||
public string[] shaderErrors;
|
||||
public ulong variantCount;
|
||||
public ulong variantCountUsed;
|
||||
|
||||
enum ComparisonOperator
|
||||
{
|
||||
Equal,
|
||||
Greater,
|
||||
GreaterOrEqual,
|
||||
Less,
|
||||
LessOrEqual
|
||||
}
|
||||
|
||||
#if UNITY_2022_2_OR_NEWER
|
||||
const int URP_VERSION = 14;
|
||||
#elif UNITY_2021_2_OR_NEWER
|
||||
const int URP_VERSION = 12;
|
||||
#elif UNITY_2021_1_OR_NEWER
|
||||
const int URP_VERSION = 11;
|
||||
#elif UNITY_2020_3_OR_NEWER
|
||||
const int URP_VERSION = 10;
|
||||
#else
|
||||
const int URP_VERSION = 7;
|
||||
#endif
|
||||
|
||||
static ComparisonOperator ParseComparisonOperator(string symbols)
|
||||
{
|
||||
switch (symbols)
|
||||
{
|
||||
case "==": return ComparisonOperator.Equal;
|
||||
case "<=": return ComparisonOperator.LessOrEqual;
|
||||
case "<": return ComparisonOperator.Less;
|
||||
case ">": return ComparisonOperator.Greater;
|
||||
case ">=": return ComparisonOperator.GreaterOrEqual;
|
||||
default: throw new Exception("Invalid comparison operator: " + symbols);
|
||||
}
|
||||
}
|
||||
|
||||
static bool CompareWithOperator(int value1, int value2, ComparisonOperator comparisonOperator)
|
||||
{
|
||||
switch (comparisonOperator)
|
||||
{
|
||||
case ComparisonOperator.Equal: return value1 == value2;
|
||||
case ComparisonOperator.Greater: return value1 > value2;
|
||||
case ComparisonOperator.GreaterOrEqual: return value1 >= value2;
|
||||
case ComparisonOperator.Less: return value1 < value2;
|
||||
case ComparisonOperator.LessOrEqual: return value1 <= value2;
|
||||
default: throw new Exception("Invalid comparison operator value: " + comparisonOperator);
|
||||
}
|
||||
}
|
||||
|
||||
bool StartsOrEndWithSpecialTag(string line)
|
||||
{
|
||||
bool startsWithTag = (line.Length > 4 && line[0] == '/' && line[1] == '*' && line[2] == '*' && line[3] == '*');
|
||||
if (startsWithTag) return true;
|
||||
|
||||
int l = line.Length-1;
|
||||
bool endsWithTag = (line.Length > 4 && line[l] == '/' && line[l-1] == '*' && line[l-2] == '*' && line[l-3] == '*');
|
||||
return endsWithTag;
|
||||
}
|
||||
|
||||
public override void OnImportAsset(AssetImportContext context)
|
||||
{
|
||||
bool isUsingURP;
|
||||
switch (renderPipelineDetection)
|
||||
{
|
||||
default:
|
||||
case RenderPipeline.Auto:
|
||||
{
|
||||
isUsingURP = Utils.IsUsingURP();
|
||||
detectedRenderPipeline = isUsingURP ? "Universal Render Pipeline" : "Built-In Render Pipeline";
|
||||
break;
|
||||
}
|
||||
case RenderPipeline.ForceBuiltInRenderPipeline:
|
||||
{
|
||||
detectedRenderPipeline = "Built-In Render Pipeline";
|
||||
isUsingURP = false;
|
||||
break;
|
||||
}
|
||||
case RenderPipeline.ForceUniversalRenderPipeline:
|
||||
{
|
||||
detectedRenderPipeline = "Universal Render Pipeline";
|
||||
isUsingURP = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
StringWriter shaderSource = new StringWriter();
|
||||
string[] sourceLines = File.ReadAllLines(context.assetPath);
|
||||
Stack<bool> excludeCurrentLines = new Stack<bool>();
|
||||
strippedLinesCount = 0;
|
||||
|
||||
for (int i = 0; i < sourceLines.Length; i++)
|
||||
{
|
||||
bool excludeThisLine = excludeCurrentLines.Count > 0 && excludeCurrentLines.Peek();
|
||||
|
||||
string line = sourceLines[i];
|
||||
if (StartsOrEndWithSpecialTag(line))
|
||||
{
|
||||
if (line.StartsWith("/*** BIRP ***/"))
|
||||
{
|
||||
excludeCurrentLines.Push(excludeThisLine || isUsingURP);
|
||||
}
|
||||
else if (line.StartsWith("/*** URP ***/"))
|
||||
{
|
||||
excludeCurrentLines.Push(excludeThisLine || !isUsingURP);
|
||||
}
|
||||
else if (line.StartsWith("/*** URP_VERSION "))
|
||||
{
|
||||
string subline = line.Substring("/*** URP_VERSION ".Length);
|
||||
int spaceIndex = subline.IndexOf(' ');
|
||||
string version = subline.Substring(spaceIndex, subline.LastIndexOf(' ') - spaceIndex);
|
||||
string op = subline.Substring(0, spaceIndex);
|
||||
|
||||
var compOp = ParseComparisonOperator(op);
|
||||
int compVersion = int.Parse(version);
|
||||
|
||||
bool isCorrectURP = CompareWithOperator(URP_VERSION, compVersion, compOp);
|
||||
excludeCurrentLines.Push(excludeThisLine || !isCorrectURP);
|
||||
}
|
||||
else if (excludeThisLine && line.StartsWith("/*** END"))
|
||||
{
|
||||
excludeCurrentLines.Pop();
|
||||
}
|
||||
else if (!excludeThisLine && line.StartsWith("/*** #define URP_VERSION ***/"))
|
||||
{
|
||||
shaderSource.WriteLine("\t\t\t#define URP_VERSION " + URP_VERSION);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (excludeThisLine)
|
||||
{
|
||||
strippedLinesCount++;
|
||||
continue;
|
||||
}
|
||||
|
||||
shaderSource.WriteLine(line);
|
||||
}
|
||||
}
|
||||
|
||||
// Get source code and extract name
|
||||
shaderSourceCode = shaderSource.ToString();
|
||||
int idx = shaderSourceCode.IndexOf("Shader \"", StringComparison.InvariantCulture) + 8;
|
||||
int idx2 = shaderSourceCode.IndexOf('"', idx);
|
||||
shaderName = shaderSourceCode.Substring(idx, idx2 - idx);
|
||||
shaderErrors = null;
|
||||
|
||||
Shader shader = ShaderUtil.CreateShaderAsset(context, shaderSourceCode, true);
|
||||
|
||||
if (ShaderUtil.ShaderHasError(shader))
|
||||
{
|
||||
string[] shaderSourceLines = shaderSourceCode.Split(new [] {'\n'}, StringSplitOptions.None);
|
||||
var errors = ShaderUtil.GetShaderMessages(shader);
|
||||
shaderErrors = Array.ConvertAll(errors, err => $"{err.message} (line {err.line})");
|
||||
foreach (ShaderMessage error in errors)
|
||||
{
|
||||
string message = error.line <= 0 ?
|
||||
string.Format("Shader Error in '{0}' (in file '{2}')\nError: {1}\n", shaderName, error.message, error.file) :
|
||||
string.Format("Shader Error in '{0}' (line {2} in file '{3}')\nError: {1}\nLine: {4}\n", shaderName, error.message, error.line, error.file, shaderSourceLines[error.line-1]);
|
||||
if (error.severity == ShaderCompilerMessageSeverity.Warning)
|
||||
{
|
||||
Debug.LogWarning(message);
|
||||
}
|
||||
else
|
||||
{
|
||||
Debug.LogError(message);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
ShaderUtil.ClearShaderMessages(shader);
|
||||
}
|
||||
|
||||
context.AddObjectToAsset("MainAsset", shader);
|
||||
context.SetMainObject(shader);
|
||||
|
||||
// Try to count variant using reflection:
|
||||
// internal static extern ulong GetVariantCount(Shader s, bool usedBySceneOnly);
|
||||
variantCount = 0;
|
||||
variantCountUsed = 0;
|
||||
MethodInfo getVariantCountReflection = typeof(ShaderUtil).GetMethod("GetVariantCount", BindingFlags.Static | BindingFlags.NonPublic);
|
||||
if (getVariantCountReflection != null)
|
||||
{
|
||||
try
|
||||
{
|
||||
object result = getVariantCountReflection.Invoke(null, new object[] {shader, false});
|
||||
variantCount = (ulong)result;
|
||||
result = getVariantCountReflection.Invoke(null, new object[] {shader, true});
|
||||
variantCountUsed = (ulong)result;
|
||||
}
|
||||
catch
|
||||
{
|
||||
// ignored
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
namespace Inspector
|
||||
{
|
||||
[CustomEditor(typeof(CFXR_ShaderImporter)), CanEditMultipleObjects]
|
||||
public class TCP2ShaderImporter_Editor : Editor
|
||||
{
|
||||
CFXR_ShaderImporter Importer => (CFXR_ShaderImporter) this.target;
|
||||
|
||||
// From: UnityEditor.ShaderInspectorPlatformsPopup
|
||||
static string FormatCount(ulong count)
|
||||
{
|
||||
bool flag = count > 1000000000uL;
|
||||
string result;
|
||||
if (flag)
|
||||
{
|
||||
result = (count / 1000000000.0).ToString("f2", CultureInfo.InvariantCulture.NumberFormat) + "B";
|
||||
}
|
||||
else
|
||||
{
|
||||
bool flag2 = count > 1000000uL;
|
||||
if (flag2)
|
||||
{
|
||||
result = (count / 1000000.0).ToString("f2", CultureInfo.InvariantCulture.NumberFormat) + "M";
|
||||
}
|
||||
else
|
||||
{
|
||||
bool flag3 = count > 1000uL;
|
||||
if (flag3)
|
||||
{
|
||||
result = (count / 1000.0).ToString("f2", CultureInfo.InvariantCulture.NumberFormat) + "k";
|
||||
}
|
||||
else
|
||||
{
|
||||
result = count.ToString();
|
||||
}
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
static GUIStyle _HelpBoxRichTextStyle;
|
||||
static GUIStyle HelpBoxRichTextStyle
|
||||
{
|
||||
get
|
||||
{
|
||||
if (_HelpBoxRichTextStyle == null)
|
||||
{
|
||||
_HelpBoxRichTextStyle = new GUIStyle("HelpBox");
|
||||
_HelpBoxRichTextStyle.richText = true;
|
||||
_HelpBoxRichTextStyle.margin = new RectOffset(4, 4, 0, 0);
|
||||
_HelpBoxRichTextStyle.padding = new RectOffset(4, 4, 4, 4);
|
||||
}
|
||||
return _HelpBoxRichTextStyle;
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnInspectorGUI()
|
||||
{
|
||||
bool multipleValues = serializedObject.isEditingMultipleObjects;
|
||||
|
||||
CFXR_ShaderImporter.RenderPipeline detection = ((CFXR_ShaderImporter)target).renderPipelineDetection;
|
||||
bool isUsingURP = Utils.IsUsingURP();
|
||||
serializedObject.Update();
|
||||
|
||||
GUILayout.Label(Importer.shaderName);
|
||||
string variantsText = "";
|
||||
if (Importer.variantCount > 0 && Importer.variantCountUsed > 0)
|
||||
{
|
||||
string variantsCount = multipleValues ? "-" : FormatCount(Importer.variantCount);
|
||||
string variantsCountUsed = multipleValues ? "-" : FormatCount(Importer.variantCountUsed);
|
||||
variantsText = $"\nVariants (currently used): <b>{variantsCountUsed}</b>\nVariants (including unused): <b>{variantsCount}</b>";
|
||||
}
|
||||
string strippedLinesCount = multipleValues ? "-" : Importer.strippedLinesCount.ToString();
|
||||
string renderPipeline = Importer.detectedRenderPipeline;
|
||||
if (targets is { Length: > 1 })
|
||||
{
|
||||
foreach (CFXR_ShaderImporter importer in targets)
|
||||
{
|
||||
if (importer.detectedRenderPipeline != renderPipeline)
|
||||
{
|
||||
renderPipeline = "-";
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
GUILayout.Label($"{(detection == CFXR_ShaderImporter.RenderPipeline.Auto ? "Detected" : "Forced")} render pipeline: <b>{renderPipeline}</b>\nStripped lines: <b>{strippedLinesCount}</b>{variantsText}", HelpBoxRichTextStyle);
|
||||
|
||||
if (Importer.shaderErrors != null && Importer.shaderErrors.Length > 0)
|
||||
{
|
||||
GUILayout.Space(4);
|
||||
var color = GUI.color;
|
||||
GUI.color = new Color32(0xFF, 0x80, 0x80, 0xFF);
|
||||
GUILayout.Label($"<b>Errors:</b>\n{string.Join("\n", Importer.shaderErrors)}", HelpBoxRichTextStyle);
|
||||
GUI.color = color;
|
||||
}
|
||||
|
||||
bool shouldReimportShader = false;
|
||||
bool compiledForURP = Importer.detectedRenderPipeline.Contains("Universal");
|
||||
if (detection == CFXR_ShaderImporter.RenderPipeline.Auto
|
||||
&& ((isUsingURP && !compiledForURP) || (!isUsingURP && compiledForURP)))
|
||||
{
|
||||
GUILayout.Space(4);
|
||||
Color guiColor = GUI.color;
|
||||
GUI.color *= Color.yellow;
|
||||
EditorGUILayout.HelpBox("The detected render pipeline doesn't match the pipeline this shader was compiled for!\nPlease reimport the shaders for them to work in the current render pipeline.", MessageType.Warning);
|
||||
if (GUILayout.Button("Reimport Shader"))
|
||||
{
|
||||
shouldReimportShader = true;
|
||||
}
|
||||
GUI.color = guiColor;
|
||||
}
|
||||
|
||||
GUILayout.Space(4);
|
||||
|
||||
|
||||
EditorGUI.BeginChangeCheck();
|
||||
EditorGUILayout.PropertyField(serializedObject.FindProperty(nameof(CFXR_ShaderImporter.renderPipelineDetection)));
|
||||
if (EditorGUI.EndChangeCheck())
|
||||
{
|
||||
shouldReimportShader = true;
|
||||
}
|
||||
|
||||
if (GUILayout.Button("View Source", GUILayout.ExpandWidth(false)))
|
||||
{
|
||||
string path = Application.temporaryCachePath + "/" + Importer.shaderName.Replace("/", "-") + "_Source.shader";
|
||||
if (File.Exists(path))
|
||||
{
|
||||
File.SetAttributes(path, FileAttributes.Normal);
|
||||
}
|
||||
|
||||
File.WriteAllText(path, Importer.shaderSourceCode);
|
||||
File.SetAttributes(path, FileAttributes.ReadOnly);
|
||||
UnityEditorInternal.InternalEditorUtility.OpenFileAtLineExternal(path, 0);
|
||||
}
|
||||
|
||||
#if SHOW_EXPORT_BUTTON
|
||||
GUILayout.Space(8);
|
||||
|
||||
EditorGUI.BeginDisabledGroup(string.IsNullOrEmpty(importer.shaderSourceCode));
|
||||
{
|
||||
if (GUILayout.Button("Export .shader file", GUILayout.ExpandWidth(false)))
|
||||
{
|
||||
string savePath = EditorUtility.SaveFilePanel("Export CFXR shader", Application.dataPath, "CFXR Shader","shader");
|
||||
if (!string.IsNullOrEmpty(savePath))
|
||||
{
|
||||
File.WriteAllText(savePath, importer.shaderSourceCode);
|
||||
}
|
||||
}
|
||||
}
|
||||
EditorGUI.EndDisabledGroup();
|
||||
#endif
|
||||
|
||||
serializedObject.ApplyModifiedProperties();
|
||||
|
||||
if (shouldReimportShader)
|
||||
{
|
||||
ReimportShader();
|
||||
}
|
||||
}
|
||||
|
||||
void ReimportShader()
|
||||
{
|
||||
foreach (UnityEngine.Object t in targets)
|
||||
{
|
||||
string path = AssetDatabase.GetAssetPath(t);
|
||||
AssetDatabase.ImportAsset(path, ImportAssetOptions.ForceSynchronousImport);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: fe56ec25963759b49955809beeb4324b
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,38 @@
|
||||
using System;
|
||||
using UnityEditor;
|
||||
using UnityEngine;
|
||||
|
||||
namespace CartoonFX
|
||||
{
|
||||
namespace CustomShaderImporter
|
||||
{
|
||||
public class CFXR_ShaderPostProcessor : AssetPostprocessor
|
||||
{
|
||||
static void OnPostprocessAllAssets(string[] importedAssets, string[] deletedAssets, string[] movedAssets, string[] movedFromAssetPaths)
|
||||
{
|
||||
CleanCFXRShaders(importedAssets);
|
||||
}
|
||||
|
||||
static void CleanCFXRShaders(string[] paths)
|
||||
{
|
||||
foreach (var assetPath in paths)
|
||||
{
|
||||
if (!assetPath.EndsWith(CFXR_ShaderImporter.FILE_EXTENSION, StringComparison.InvariantCultureIgnoreCase))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
var shader = AssetDatabase.LoadMainAssetAtPath(assetPath) as Shader;
|
||||
if (shader != null)
|
||||
{
|
||||
ShaderUtil.ClearShaderMessages(shader);
|
||||
if (!ShaderUtil.ShaderHasError(shader))
|
||||
{
|
||||
ShaderUtil.RegisterShader(shader);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 29d46695388f9a84d9ae71b5140727a3
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,362 @@
|
||||
//--------------------------------------------------------------------------------------------------------------------------------
|
||||
// Cartoon FX
|
||||
// (c) 2012-2025 Jean Moreno
|
||||
//--------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
using UnityEngine;
|
||||
using UnityEditor;
|
||||
|
||||
// GUI Styles and UI methods
|
||||
|
||||
namespace CartoonFX
|
||||
{
|
||||
public static class Styles
|
||||
{
|
||||
//================================================================================================================================
|
||||
// GUI Styles
|
||||
//================================================================================================================================
|
||||
|
||||
//================================================================================================================================
|
||||
// (x) close button
|
||||
static GUIStyle _closeCrossButton;
|
||||
public static GUIStyle CloseCrossButton
|
||||
{
|
||||
get
|
||||
{
|
||||
if(_closeCrossButton == null)
|
||||
{
|
||||
//Try to load GUISkin according to its GUID
|
||||
//Assumes that its .meta file should always stick with it!
|
||||
string guiSkinPath = AssetDatabase.GUIDToAssetPath("02d396fa782e5d7438e231ea9f8be23c");
|
||||
var gs = AssetDatabase.LoadAssetAtPath<GUISkin>(guiSkinPath);
|
||||
if(gs != null)
|
||||
{
|
||||
_closeCrossButton = System.Array.Find<GUIStyle>(gs.customStyles, x => x.name == "CloseCrossButton");
|
||||
}
|
||||
|
||||
//Else fall back to minibutton
|
||||
if(_closeCrossButton == null)
|
||||
_closeCrossButton = EditorStyles.miniButton;
|
||||
}
|
||||
return _closeCrossButton;
|
||||
}
|
||||
}
|
||||
|
||||
//================================================================================================================================
|
||||
// Shuriken Toggle with label alignment fix
|
||||
static GUIStyle _shurikenToggle;
|
||||
public static GUIStyle ShurikenToggle
|
||||
{
|
||||
get
|
||||
{
|
||||
if(_shurikenToggle == null)
|
||||
{
|
||||
_shurikenToggle = new GUIStyle("ShurikenToggle");
|
||||
_shurikenToggle.fontSize = 9;
|
||||
_shurikenToggle.contentOffset = new Vector2(16, -1);
|
||||
if(EditorGUIUtility.isProSkin)
|
||||
{
|
||||
var textColor = new Color(.8f, .8f, .8f);
|
||||
_shurikenToggle.normal.textColor = textColor;
|
||||
_shurikenToggle.active.textColor = textColor;
|
||||
_shurikenToggle.focused.textColor = textColor;
|
||||
_shurikenToggle.hover.textColor = textColor;
|
||||
_shurikenToggle.onNormal.textColor = textColor;
|
||||
_shurikenToggle.onActive.textColor = textColor;
|
||||
_shurikenToggle.onFocused.textColor = textColor;
|
||||
_shurikenToggle.onHover.textColor = textColor;
|
||||
}
|
||||
}
|
||||
return _shurikenToggle;
|
||||
}
|
||||
}
|
||||
|
||||
//================================================================================================================================
|
||||
// Bold mini-label (the one from EditorStyles isn't actually "mini")
|
||||
static GUIStyle _miniBoldLabel;
|
||||
public static GUIStyle MiniBoldLabel
|
||||
{
|
||||
get
|
||||
{
|
||||
if(_miniBoldLabel == null)
|
||||
{
|
||||
_miniBoldLabel = new GUIStyle(EditorStyles.boldLabel);
|
||||
_miniBoldLabel.fontSize = 10;
|
||||
_miniBoldLabel.margin = new RectOffset(0, 0, 0, 0);
|
||||
}
|
||||
return _miniBoldLabel;
|
||||
}
|
||||
}
|
||||
|
||||
//================================================================================================================================
|
||||
// Bold mini-foldout
|
||||
static GUIStyle _miniBoldFoldout;
|
||||
public static GUIStyle MiniBoldFoldout
|
||||
{
|
||||
get
|
||||
{
|
||||
if(_miniBoldFoldout == null)
|
||||
{
|
||||
_miniBoldFoldout = new GUIStyle(EditorStyles.foldout);
|
||||
_miniBoldFoldout.fontSize = 10;
|
||||
_miniBoldFoldout.fontStyle = FontStyle.Bold;
|
||||
_miniBoldFoldout.margin = new RectOffset(0, 0, 0, 0);
|
||||
}
|
||||
return _miniBoldFoldout;
|
||||
}
|
||||
}
|
||||
|
||||
//================================================================================================================================
|
||||
// Gray right-aligned label for Orderable List (Material Animator)
|
||||
static GUIStyle _PropertyTypeLabel;
|
||||
public static GUIStyle PropertyTypeLabel
|
||||
{
|
||||
get
|
||||
{
|
||||
if(_PropertyTypeLabel == null)
|
||||
{
|
||||
_PropertyTypeLabel = new GUIStyle(EditorStyles.label);
|
||||
_PropertyTypeLabel.alignment = TextAnchor.MiddleRight;
|
||||
_PropertyTypeLabel.normal.textColor = Color.gray;
|
||||
_PropertyTypeLabel.fontSize = 9;
|
||||
}
|
||||
return _PropertyTypeLabel;
|
||||
}
|
||||
}
|
||||
|
||||
// Dark Gray right-aligned label for Orderable List (Material Animator)
|
||||
static GUIStyle _PropertyTypeLabelFocused;
|
||||
public static GUIStyle PropertyTypeLabelFocused
|
||||
{
|
||||
get
|
||||
{
|
||||
if(_PropertyTypeLabelFocused == null)
|
||||
{
|
||||
_PropertyTypeLabelFocused = new GUIStyle(EditorStyles.label);
|
||||
_PropertyTypeLabelFocused.alignment = TextAnchor.MiddleRight;
|
||||
_PropertyTypeLabelFocused.normal.textColor = new Color(.2f, .2f, .2f);
|
||||
_PropertyTypeLabelFocused.fontSize = 9;
|
||||
}
|
||||
return _PropertyTypeLabelFocused;
|
||||
}
|
||||
}
|
||||
|
||||
//================================================================================================================================
|
||||
// Rounded Box
|
||||
static GUIStyle _roundedBox;
|
||||
public static GUIStyle RoundedBox
|
||||
{
|
||||
get
|
||||
{
|
||||
if(_roundedBox == null)
|
||||
{
|
||||
_roundedBox = new GUIStyle(EditorStyles.helpBox);
|
||||
}
|
||||
return _roundedBox;
|
||||
}
|
||||
}
|
||||
|
||||
//================================================================================================================================
|
||||
// Center White Label ("Editing Spline" label in Scene View)
|
||||
static GUIStyle _CenteredWhiteLabel;
|
||||
public static GUIStyle CenteredWhiteLabel
|
||||
{
|
||||
get
|
||||
{
|
||||
if(_CenteredWhiteLabel == null)
|
||||
{
|
||||
_CenteredWhiteLabel = new GUIStyle(EditorStyles.centeredGreyMiniLabel);
|
||||
_CenteredWhiteLabel.fontSize = 20;
|
||||
_CenteredWhiteLabel.normal.textColor = Color.white;
|
||||
}
|
||||
return _CenteredWhiteLabel;
|
||||
}
|
||||
}
|
||||
|
||||
//================================================================================================================================
|
||||
// Used to draw lines for separators
|
||||
static public GUIStyle _LineStyle;
|
||||
static public GUIStyle LineStyle
|
||||
{
|
||||
get
|
||||
{
|
||||
if(_LineStyle == null)
|
||||
{
|
||||
_LineStyle = new GUIStyle();
|
||||
_LineStyle.normal.background = EditorGUIUtility.whiteTexture;
|
||||
_LineStyle.stretchWidth = true;
|
||||
}
|
||||
|
||||
return _LineStyle;
|
||||
}
|
||||
}
|
||||
|
||||
//================================================================================================================================
|
||||
// HelpBox with rich text formatting support
|
||||
static GUIStyle _HelpBoxRichTextStyle;
|
||||
static public GUIStyle HelpBoxRichTextStyle
|
||||
{
|
||||
get
|
||||
{
|
||||
if(_HelpBoxRichTextStyle == null)
|
||||
{
|
||||
_HelpBoxRichTextStyle = new GUIStyle("HelpBox");
|
||||
_HelpBoxRichTextStyle.richText = true;
|
||||
}
|
||||
return _HelpBoxRichTextStyle;
|
||||
}
|
||||
}
|
||||
|
||||
//================================================================================================================================
|
||||
// Material Blue Header
|
||||
static public GUIStyle _MaterialHeaderStyle;
|
||||
static public GUIStyle MaterialHeaderStyle
|
||||
{
|
||||
get
|
||||
{
|
||||
if(_MaterialHeaderStyle == null)
|
||||
{
|
||||
_MaterialHeaderStyle = new GUIStyle(EditorStyles.label);
|
||||
_MaterialHeaderStyle.fontStyle = FontStyle.Bold;
|
||||
_MaterialHeaderStyle.fontSize = 11;
|
||||
_MaterialHeaderStyle.padding.top = 0;
|
||||
_MaterialHeaderStyle.padding.bottom = 0;
|
||||
_MaterialHeaderStyle.normal.textColor = EditorGUIUtility.isProSkin ? new Color32(75, 128, 255, 255) : new Color32(0, 50, 230, 255);
|
||||
_MaterialHeaderStyle.stretchWidth = true;
|
||||
}
|
||||
|
||||
return _MaterialHeaderStyle;
|
||||
}
|
||||
}
|
||||
|
||||
//================================================================================================================================
|
||||
// Material Header emboss effect
|
||||
static public GUIStyle _MaterialHeaderStyleHighlight;
|
||||
static public GUIStyle MaterialHeaderStyleHighlight
|
||||
{
|
||||
get
|
||||
{
|
||||
if(_MaterialHeaderStyleHighlight == null)
|
||||
{
|
||||
_MaterialHeaderStyleHighlight = new GUIStyle(MaterialHeaderStyle);
|
||||
_MaterialHeaderStyleHighlight.contentOffset = new Vector2(1, 1);
|
||||
_MaterialHeaderStyleHighlight.normal.textColor = EditorGUIUtility.isProSkin ? new Color32(255, 255, 255, 16) : new Color32(255, 255, 255, 32);
|
||||
}
|
||||
|
||||
return _MaterialHeaderStyleHighlight;
|
||||
}
|
||||
}
|
||||
|
||||
//================================================================================================================================
|
||||
// Filled rectangle
|
||||
|
||||
static private GUIStyle _WhiteRectangleStyle;
|
||||
|
||||
static public void DrawRectangle(Rect position, Color color)
|
||||
{
|
||||
var col = GUI.color;
|
||||
GUI.color *= color;
|
||||
DrawRectangle(position);
|
||||
GUI.color = col;
|
||||
}
|
||||
static public void DrawRectangle(Rect position)
|
||||
{
|
||||
if(_WhiteRectangleStyle == null)
|
||||
{
|
||||
_WhiteRectangleStyle = new GUIStyle();
|
||||
_WhiteRectangleStyle.normal.background = EditorGUIUtility.whiteTexture;
|
||||
}
|
||||
|
||||
if(Event.current != null && Event.current.type == EventType.Repaint)
|
||||
{
|
||||
_WhiteRectangleStyle.Draw(position, false, false, false, false);
|
||||
}
|
||||
}
|
||||
|
||||
//================================================================================================================================
|
||||
// Methods
|
||||
//================================================================================================================================
|
||||
|
||||
static public void DrawLine(float height = 2f)
|
||||
{
|
||||
DrawLine(Color.black, height);
|
||||
}
|
||||
static public void DrawLine(Color color, float height = 1f)
|
||||
{
|
||||
Rect position = GUILayoutUtility.GetRect(0f, float.MaxValue, height, height, LineStyle);
|
||||
DrawLine(position, color);
|
||||
}
|
||||
static public void DrawLine(Rect position, Color color)
|
||||
{
|
||||
if(Event.current.type == EventType.Repaint)
|
||||
{
|
||||
Color orgColor = GUI.color;
|
||||
GUI.color = orgColor * color;
|
||||
LineStyle.Draw(position, false, false, false, false);
|
||||
GUI.color = orgColor;
|
||||
}
|
||||
}
|
||||
|
||||
static public void MaterialDrawHeader(GUIContent guiContent)
|
||||
{
|
||||
var rect = GUILayoutUtility.GetRect(guiContent, MaterialHeaderStyle);
|
||||
GUI.Label(rect, guiContent, MaterialHeaderStyleHighlight);
|
||||
GUI.Label(rect, guiContent, MaterialHeaderStyle);
|
||||
}
|
||||
|
||||
static public void MaterialDrawSeparator()
|
||||
{
|
||||
GUILayout.Space(4);
|
||||
if(EditorGUIUtility.isProSkin)
|
||||
DrawLine(new Color(.3f, .3f, .3f, 1f), 1);
|
||||
else
|
||||
DrawLine(new Color(.6f, .6f, .6f, 1f), 1);
|
||||
GUILayout.Space(4);
|
||||
}
|
||||
|
||||
static public void MaterialDrawSeparatorDouble()
|
||||
{
|
||||
GUILayout.Space(6);
|
||||
if(EditorGUIUtility.isProSkin)
|
||||
{
|
||||
DrawLine(new Color(.1f, .1f, .1f, 1f), 1);
|
||||
DrawLine(new Color(.4f, .4f, .4f, 1f), 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
DrawLine(new Color(.3f, .3f, .3f, 1f), 1);
|
||||
DrawLine(new Color(.9f, .9f, .9f, 1f), 1);
|
||||
}
|
||||
GUILayout.Space(6);
|
||||
}
|
||||
|
||||
//built-in console icons, also used in help box
|
||||
static Texture2D warnIcon;
|
||||
static Texture2D infoIcon;
|
||||
static Texture2D errorIcon;
|
||||
|
||||
static public void HelpBoxRichText(Rect position, string message, MessageType msgType)
|
||||
{
|
||||
Texture2D icon = null;
|
||||
switch(msgType)
|
||||
{
|
||||
case MessageType.Warning: icon = warnIcon ?? (warnIcon = EditorGUIUtility.Load("console.warnicon") as Texture2D); break;
|
||||
case MessageType.Info: icon = infoIcon ?? (infoIcon = EditorGUIUtility.Load("console.infoicon") as Texture2D); break;
|
||||
case MessageType.Error: icon = errorIcon ?? (errorIcon = EditorGUIUtility.Load("console.erroricon") as Texture2D); break;
|
||||
}
|
||||
EditorGUI.LabelField(position, GUIContent.none, new GUIContent(message, icon), HelpBoxRichTextStyle);
|
||||
}
|
||||
|
||||
static public void HelpBoxRichText(string message, MessageType msgType)
|
||||
{
|
||||
Texture2D icon = null;
|
||||
switch(msgType)
|
||||
{
|
||||
case MessageType.Warning: icon = warnIcon ?? (warnIcon = EditorGUIUtility.Load("console.warnicon") as Texture2D); break;
|
||||
case MessageType.Info: icon = infoIcon ?? (infoIcon = EditorGUIUtility.Load("console.infoicon") as Texture2D); break;
|
||||
case MessageType.Error: icon = errorIcon ?? (errorIcon = EditorGUIUtility.Load("console.erroricon") as Texture2D); break;
|
||||
}
|
||||
EditorGUILayout.LabelField(GUIContent.none, new GUIContent(message, icon), HelpBoxRichTextStyle);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 26306333afc273640814fd7a7b3968e0
|
||||
timeCreated: 1501149213
|
||||
licenseType: Store
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: ae70c5d833aa6d74e9429910c18b70c6
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,163 @@
|
||||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!21 &2100000
|
||||
Material:
|
||||
serializedVersion: 8
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_Name: cfxr ember blur hdr ab
|
||||
m_Shader: {fileID: -6465566751694194690, guid: 1a29b4d27eb8b04479ef89c00dea533d,
|
||||
type: 3}
|
||||
m_ValidKeywords:
|
||||
- _ALPHABLEND_ON
|
||||
- _CFXR_DITHERED_SHADOWS_ON
|
||||
- _FADING_ON
|
||||
m_InvalidKeywords:
|
||||
- _
|
||||
- _CFXR_HDR_BOOST
|
||||
- _CFXR_OVERLAYBLEND_RGBA
|
||||
- _CFXR_OVERLAYTEX_OFF
|
||||
- _CFXR_SINGLE_CHANNEL
|
||||
- _OVERLAYTEX_OFF
|
||||
- _SINGLECHANNEL_ON
|
||||
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}
|
||||
- _DissolveTex:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _DistortTex:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _DitherCustom:
|
||||
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}
|
||||
- _GradientMap:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _MainTex:
|
||||
m_Texture: {fileID: 2800000, guid: 209460ccb2aaaf847a61d7e73c92f193, 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}
|
||||
- _OverlayTex:
|
||||
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}
|
||||
- _SecondColorTex:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
m_Ints: []
|
||||
m_Floats:
|
||||
- _BacklightTransmittance: 1
|
||||
- _BlendingType: 0
|
||||
- _BumpScale: 1
|
||||
- _CFXR_DITHERED_SHADOWS: 1
|
||||
- _CFXR_OVERLAYBLEND: 0
|
||||
- _CFXR_OVERLAYTEX: 0
|
||||
- _Cutoff: 0.5
|
||||
- _DetailNormalMapScale: 1
|
||||
- _DirLightScreenAtten: 1
|
||||
- _DirectLightingMix: 0.5
|
||||
- _DirectLightingRamp: 1
|
||||
- _DissolveSmooth: 0.2
|
||||
- _Distort: 0.1
|
||||
- _DoubleDissolve: 0
|
||||
- _DstBlend: 10
|
||||
- _EdgeFadeMax: 2
|
||||
- _EdgeFadeMin: 3
|
||||
- _EdgeFadePow: 2
|
||||
- _FadeAlongU: 0
|
||||
- _GlossMapScale: 1
|
||||
- _Glossiness: 0.5
|
||||
- _GlossyReflections: 1
|
||||
- _HdrBoost: 1
|
||||
- _HdrMultiply: 10
|
||||
- _IndirectLightingMix: 0.5
|
||||
- _InvertDissolveTex: 0
|
||||
- _LightingWorldPosStrength: 0.2
|
||||
- _Metallic: 0
|
||||
- _Mode: 0
|
||||
- _OVERLAYBLEND: 0
|
||||
- _OVERLAYTEX: 0
|
||||
- _OcclusionStrength: 1
|
||||
- _Parallax: 0.02
|
||||
- _SecondColorSmooth: 0.2
|
||||
- _ShadowStrength: 0.5
|
||||
- _SingleChannel: 1
|
||||
- _SmoothnessTextureChannel: 0
|
||||
- _SoftParticlesFadeDistanceFar: 1
|
||||
- _SoftParticlesFadeDistanceNear: 0
|
||||
- _SpecularHighlights: 1
|
||||
- _SrcBlend: 5
|
||||
- _UVDistortionAdd: 0
|
||||
- _UVSec: 0
|
||||
- _UseAlphaClip: 0
|
||||
- _UseBackLighting: 0
|
||||
- _UseDissolve: 0
|
||||
- _UseDissolveOffsetUV: 0
|
||||
- _UseEF: 0
|
||||
- _UseEmission: 0
|
||||
- _UseFB: 0
|
||||
- _UseFontColor: 0
|
||||
- _UseGradientMap: 0
|
||||
- _UseLighting: 0
|
||||
- _UseLightingWorldPosOffset: 0
|
||||
- _UseNormalMap: 0
|
||||
- _UseSP: 1
|
||||
- _UseSecondColor: 0
|
||||
- _UseUV2Distortion: 0
|
||||
- _UseUVDistortion: 0
|
||||
- _ZWrite: 0
|
||||
m_Colors:
|
||||
- _Color: {r: 1, g: 1, b: 1, a: 1}
|
||||
- _DissolveScroll: {r: 0, g: 0, b: 0, a: 0}
|
||||
- _DistortScrolling: {r: 0, g: 0, b: 1, a: 1}
|
||||
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
|
||||
- _OverlayTex_Scroll: {r: 0.1, g: 0.1, b: 1, a: 1}
|
||||
- _ShadowColor: {r: 0, g: 0, b: 0, a: 1}
|
||||
m_BuildTextureStacks: []
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 6cd2d08f4a4d93542aa0004bdac91566
|
||||
NativeFormatImporter:
|
||||
externalObjects: {}
|
||||
mainObjectFileID: 2100000
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 5.3 KiB |
@@ -0,0 +1,121 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 209460ccb2aaaf847a61d7e73c92f193
|
||||
TextureImporter:
|
||||
fileIDToRecycleName: {}
|
||||
externalObjects: {}
|
||||
serializedVersion: 9
|
||||
mipmaps:
|
||||
mipMapMode: 0
|
||||
enableMipMap: 1
|
||||
sRGBTexture: 0
|
||||
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: 2
|
||||
alphaIsTransparency: 0
|
||||
spriteTessellationDetail: -1
|
||||
textureType: 10
|
||||
textureShape: 1
|
||||
singleChannelComponent: 1
|
||||
maxTextureSizeSet: 0
|
||||
compressionQualitySet: 0
|
||||
textureFormatSet: 0
|
||||
platformSettings:
|
||||
- serializedVersion: 2
|
||||
buildTarget: DefaultTexturePlatform
|
||||
maxTextureSize: 64
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: -1
|
||||
textureCompression: 1
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
androidETC2FallbackOverride: 0
|
||||
- serializedVersion: 2
|
||||
buildTarget: Standalone
|
||||
maxTextureSize: 64
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: -1
|
||||
textureCompression: 1
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
androidETC2FallbackOverride: 0
|
||||
- serializedVersion: 2
|
||||
buildTarget: Android
|
||||
maxTextureSize: 64
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: -1
|
||||
textureCompression: 1
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
androidETC2FallbackOverride: 0
|
||||
- serializedVersion: 2
|
||||
buildTarget: WebGL
|
||||
maxTextureSize: 64
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: 63
|
||||
textureCompression: 1
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 1
|
||||
androidETC2FallbackOverride: 0
|
||||
spriteSheet:
|
||||
serializedVersion: 2
|
||||
sprites: []
|
||||
outline: []
|
||||
physicsShape: []
|
||||
bones: []
|
||||
spriteID:
|
||||
vertices: []
|
||||
indices:
|
||||
edges: []
|
||||
weights: []
|
||||
spritePackingTag:
|
||||
pSDRemoveMatte: 0
|
||||
pSDShowRemoveMatteOption: 0
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,122 @@
|
||||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!21 &2100000
|
||||
Material:
|
||||
serializedVersion: 8
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_Name: cfxr stretch fire crisp fade hdr ab
|
||||
m_Shader: {fileID: -6465566751694194690, guid: 1a29b4d27eb8b04479ef89c00dea533d,
|
||||
type: 3}
|
||||
m_ValidKeywords:
|
||||
- _ALPHABLEND_ON
|
||||
- _CFXR_DISSOLVE
|
||||
- _CFXR_HDR_BOOST
|
||||
- _CFXR_SINGLE_CHANNEL
|
||||
- _CFXR_UV_DISTORTION
|
||||
- _CFXR_UV_DISTORTION_ADD
|
||||
- _FADING_ON
|
||||
m_InvalidKeywords:
|
||||
- _
|
||||
- _CFXR_DITHERED_SHADOWS_OFF
|
||||
- _CFXR_OVERLAYBLEND_RGBA
|
||||
- _CFXR_OVERLAYTEX_OFF
|
||||
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}
|
||||
- _DissolveTex:
|
||||
m_Texture: {fileID: 2800000, guid: bad5d0fa763e08742a9f746be9781732, type: 3}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _DistortTex:
|
||||
m_Texture: {fileID: 2800000, guid: 74db0952acdd7ba488d3d0b114954504, type: 3}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _DitherCustom:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _GradientMap:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _MainTex:
|
||||
m_Texture: {fileID: 2800000, guid: 221462f4c3da8604c9dcc63641989a98, type: 3}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _OverlayTex:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _SecondColorTex:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
m_Ints: []
|
||||
m_Floats:
|
||||
- _BacklightTransmittance: 1
|
||||
- _BlendingType: 0
|
||||
- _BumpScale: 1
|
||||
- _CFXR_DITHERED_SHADOWS: 0
|
||||
- _CFXR_OVERLAYBLEND: 0
|
||||
- _CFXR_OVERLAYTEX: 0
|
||||
- _Cutoff: 0.1
|
||||
- _DirLightScreenAtten: 1
|
||||
- _DirectLightingRamp: 1
|
||||
- _DissolveSmooth: 0.05
|
||||
- _Distort: 0.4
|
||||
- _DoubleDissolve: 0
|
||||
- _DstBlend: 10
|
||||
- _EdgeFadePow: 1
|
||||
- _FadeAlongU: 1
|
||||
- _HdrBoost: 1
|
||||
- _HdrMultiply: 8
|
||||
- _IndirectLightingMix: 0.5
|
||||
- _InvertDissolveTex: 0
|
||||
- _LightingWorldPosStrength: 0.2
|
||||
- _OVERLAYBLEND: 0
|
||||
- _OVERLAYTEX: 0
|
||||
- _ReceivedShadowsStrength: 0.5
|
||||
- _SecondColorSmooth: 0.2
|
||||
- _ShadowStrength: 1
|
||||
- _SingleChannel: 1
|
||||
- _SoftParticlesFadeDistanceFar: 1
|
||||
- _SoftParticlesFadeDistanceNear: 0
|
||||
- _SrcBlend: 5
|
||||
- _UVDistortionAdd: 1
|
||||
- _UseAlphaClip: 0
|
||||
- _UseBackLighting: 0
|
||||
- _UseDissolve: 1
|
||||
- _UseDissolveOffsetUV: 0
|
||||
- _UseEF: 0
|
||||
- _UseEmission: 0
|
||||
- _UseFB: 0
|
||||
- _UseFontColor: 0
|
||||
- _UseGradientMap: 0
|
||||
- _UseLighting: 0
|
||||
- _UseLightingWorldPosOffset: 0
|
||||
- _UseNormalMap: 0
|
||||
- _UseSP: 1
|
||||
- _UseSecondColor: 0
|
||||
- _UseUV2Distortion: 0
|
||||
- _UseUVDistortion: 1
|
||||
- _ZWrite: 0
|
||||
m_Colors:
|
||||
- _DissolveScroll: {r: 0, g: 0, b: 0, a: 0}
|
||||
- _DistortScrolling: {r: 1, g: 0, b: 1, a: 1}
|
||||
- _OverlayTex_Scroll: {r: 0.1, g: 0.1, b: 1, a: 1}
|
||||
- _ShadowColor: {r: 0, g: 0, b: 0, a: 1}
|
||||
- _SoftParticlesFadeDistance: {r: 0, g: 1, b: 0, a: 0}
|
||||
m_BuildTextureStacks: []
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 2e32f93f5ce765e47b0cabd37ce2b73d
|
||||
NativeFormatImporter:
|
||||
externalObjects: {}
|
||||
mainObjectFileID: 2100000
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 22 KiB |
@@ -0,0 +1,121 @@
|
||||
fileFormatVersion: 2
|
||||
guid: bad5d0fa763e08742a9f746be9781732
|
||||
TextureImporter:
|
||||
fileIDToRecycleName: {}
|
||||
externalObjects: {}
|
||||
serializedVersion: 9
|
||||
mipmaps:
|
||||
mipMapMode: 0
|
||||
enableMipMap: 1
|
||||
sRGBTexture: 0
|
||||
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: 10
|
||||
textureShape: 1
|
||||
singleChannelComponent: 1
|
||||
maxTextureSizeSet: 0
|
||||
compressionQualitySet: 0
|
||||
textureFormatSet: 0
|
||||
platformSettings:
|
||||
- serializedVersion: 2
|
||||
buildTarget: DefaultTexturePlatform
|
||||
maxTextureSize: 64
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: -1
|
||||
textureCompression: 1
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
androidETC2FallbackOverride: 0
|
||||
- serializedVersion: 2
|
||||
buildTarget: Standalone
|
||||
maxTextureSize: 64
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: -1
|
||||
textureCompression: 1
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
androidETC2FallbackOverride: 0
|
||||
- serializedVersion: 2
|
||||
buildTarget: Android
|
||||
maxTextureSize: 64
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: -1
|
||||
textureCompression: 1
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
androidETC2FallbackOverride: 0
|
||||
- serializedVersion: 2
|
||||
buildTarget: WebGL
|
||||
maxTextureSize: 128
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: 63
|
||||
textureCompression: 1
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 1
|
||||
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.
|
After Width: | Height: | Size: 22 KiB |
@@ -0,0 +1,121 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 221462f4c3da8604c9dcc63641989a98
|
||||
TextureImporter:
|
||||
fileIDToRecycleName: {}
|
||||
externalObjects: {}
|
||||
serializedVersion: 9
|
||||
mipmaps:
|
||||
mipMapMode: 0
|
||||
enableMipMap: 1
|
||||
sRGBTexture: 0
|
||||
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: 10
|
||||
textureShape: 1
|
||||
singleChannelComponent: 1
|
||||
maxTextureSizeSet: 0
|
||||
compressionQualitySet: 0
|
||||
textureFormatSet: 0
|
||||
platformSettings:
|
||||
- serializedVersion: 2
|
||||
buildTarget: DefaultTexturePlatform
|
||||
maxTextureSize: 128
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: -1
|
||||
textureCompression: 1
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
androidETC2FallbackOverride: 0
|
||||
- serializedVersion: 2
|
||||
buildTarget: Standalone
|
||||
maxTextureSize: 128
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: -1
|
||||
textureCompression: 1
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
androidETC2FallbackOverride: 0
|
||||
- serializedVersion: 2
|
||||
buildTarget: Android
|
||||
maxTextureSize: 128
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: -1
|
||||
textureCompression: 1
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
androidETC2FallbackOverride: 0
|
||||
- serializedVersion: 2
|
||||
buildTarget: WebGL
|
||||
maxTextureSize: 128
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: 63
|
||||
textureCompression: 1
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 1
|
||||
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.
|
After Width: | Height: | Size: 52 KiB |
@@ -0,0 +1,99 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 74db0952acdd7ba488d3d0b114954504
|
||||
TextureImporter:
|
||||
fileIDToRecycleName: {}
|
||||
externalObjects: {}
|
||||
serializedVersion: 9
|
||||
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: 64
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: -1
|
||||
textureCompression: 0
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
androidETC2FallbackOverride: 0
|
||||
- serializedVersion: 2
|
||||
buildTarget: Standalone
|
||||
maxTextureSize: 64
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: -1
|
||||
textureCompression: 0
|
||||
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:
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 869785f887ca9d74f972d5727c91e1c8
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Binary file not shown.
@@ -0,0 +1,97 @@
|
||||
fileFormatVersion: 2
|
||||
guid: b10f0a773262b9c478542ff2d1a04863
|
||||
ModelImporter:
|
||||
serializedVersion: 23
|
||||
fileIDToRecycleName:
|
||||
100000: //RootNode
|
||||
400000: //RootNode
|
||||
2100000: No Name
|
||||
2300000: //RootNode
|
||||
3300000: //RootNode
|
||||
4300000: cfxr electric_arc_circle
|
||||
externalObjects: {}
|
||||
materials:
|
||||
importMaterials: 0
|
||||
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: 0
|
||||
meshes:
|
||||
lODScreenPercentages: []
|
||||
globalScale: 0.2
|
||||
meshCompression: 0
|
||||
addColliders: 0
|
||||
useSRGBMaterialColor: 1
|
||||
importVisibility: 0
|
||||
importBlendShapes: 0
|
||||
importCameras: 0
|
||||
importLights: 0
|
||||
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
|
||||
legacyComputeAllNormalsFromSmoothingGroupsWhenMeshHasBlendShapes: 0
|
||||
blendShapeNormalImportMode: 1
|
||||
normalSmoothingSource: 0
|
||||
importAnimation: 0
|
||||
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:
|
||||
Binary file not shown.
@@ -0,0 +1,114 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 1a6345b23d834ab4290d4498136e1abc
|
||||
ModelImporter:
|
||||
serializedVersion: 23
|
||||
fileIDToRecycleName:
|
||||
100000: //RootNode
|
||||
100002: cfxr electric_barrier_01
|
||||
100004: cfxr electric_barrier_02
|
||||
100006: cfxr electric_barrier_03
|
||||
100008: cfxr electric_barrier_04
|
||||
400000: //RootNode
|
||||
400002: cfxr electric_barrier_01
|
||||
400004: cfxr electric_barrier_02
|
||||
400006: cfxr electric_barrier_03
|
||||
400008: cfxr electric_barrier_04
|
||||
2100000: No Name
|
||||
2300000: cfxr electric_barrier_01
|
||||
2300002: cfxr electric_barrier_02
|
||||
2300004: cfxr electric_barrier_03
|
||||
2300006: cfxr electric_barrier_04
|
||||
3300000: cfxr electric_barrier_01
|
||||
3300002: cfxr electric_barrier_02
|
||||
3300004: cfxr electric_barrier_03
|
||||
3300006: cfxr electric_barrier_04
|
||||
4300000: cfxr electric_barrier_01
|
||||
4300002: cfxr electric_barrier_02
|
||||
4300004: cfxr electric_barrier_03
|
||||
4300006: cfxr electric_barrier_04
|
||||
externalObjects: {}
|
||||
materials:
|
||||
importMaterials: 0
|
||||
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: 0
|
||||
meshes:
|
||||
lODScreenPercentages: []
|
||||
globalScale: 1
|
||||
meshCompression: 0
|
||||
addColliders: 0
|
||||
useSRGBMaterialColor: 1
|
||||
importVisibility: 0
|
||||
importBlendShapes: 0
|
||||
importCameras: 0
|
||||
importLights: 0
|
||||
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
|
||||
legacyComputeAllNormalsFromSmoothingGroupsWhenMeshHasBlendShapes: 0
|
||||
blendShapeNormalImportMode: 1
|
||||
normalSmoothingSource: 0
|
||||
importAnimation: 0
|
||||
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:
|
||||
Binary file not shown.
@@ -0,0 +1,97 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 7874f2765cea0a547827d03a8933235d
|
||||
ModelImporter:
|
||||
serializedVersion: 23
|
||||
fileIDToRecycleName:
|
||||
100000: //RootNode
|
||||
400000: //RootNode
|
||||
2100000: No Name
|
||||
2300000: //RootNode
|
||||
3300000: //RootNode
|
||||
4300000: cfxr mesh disk
|
||||
externalObjects: {}
|
||||
materials:
|
||||
importMaterials: 0
|
||||
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: 0
|
||||
meshes:
|
||||
lODScreenPercentages: []
|
||||
globalScale: 1
|
||||
meshCompression: 0
|
||||
addColliders: 0
|
||||
useSRGBMaterialColor: 1
|
||||
importVisibility: 0
|
||||
importBlendShapes: 0
|
||||
importCameras: 0
|
||||
importLights: 0
|
||||
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
|
||||
legacyComputeAllNormalsFromSmoothingGroupsWhenMeshHasBlendShapes: 0
|
||||
blendShapeNormalImportMode: 1
|
||||
normalSmoothingSource: 0
|
||||
importAnimation: 0
|
||||
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:
|
||||
Binary file not shown.
@@ -0,0 +1,97 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 5d48695472dfda94b92ac5316397da95
|
||||
ModelImporter:
|
||||
serializedVersion: 19301
|
||||
internalIDToNameTable: []
|
||||
externalObjects: {}
|
||||
materials:
|
||||
materialImportMode: 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: 0
|
||||
meshes:
|
||||
lODScreenPercentages: []
|
||||
globalScale: 1
|
||||
meshCompression: 0
|
||||
addColliders: 0
|
||||
useSRGBMaterialColor: 1
|
||||
sortHierarchyByName: 1
|
||||
importVisibility: 1
|
||||
importBlendShapes: 1
|
||||
importCameras: 1
|
||||
importLights: 1
|
||||
fileIdsGeneration: 2
|
||||
swapUVChannels: 0
|
||||
generateSecondaryUV: 0
|
||||
useFileUnits: 1
|
||||
keepQuads: 0
|
||||
weldVertices: 1
|
||||
preserveHierarchy: 0
|
||||
skinWeightsMode: 0
|
||||
maxBonesPerVertex: 4
|
||||
minBoneWeight: 0.001
|
||||
meshOptimizationFlags: -1
|
||||
indexFormat: 0
|
||||
secondaryUVAngleDistortion: 8
|
||||
secondaryUVAreaDistortion: 15.000001
|
||||
secondaryUVHardAngle: 88
|
||||
secondaryUVPackMargin: 4
|
||||
useFileScale: 1
|
||||
tangentSpace:
|
||||
normalSmoothAngle: 60
|
||||
normalImportMode: 0
|
||||
tangentImportMode: 3
|
||||
normalCalculationMode: 4
|
||||
legacyComputeAllNormalsFromSmoothingGroupsWhenMeshHasBlendShapes: 0
|
||||
blendShapeNormalImportMode: 1
|
||||
normalSmoothingSource: 0
|
||||
referencedClips: []
|
||||
importAnimation: 1
|
||||
humanDescription:
|
||||
serializedVersion: 3
|
||||
human: []
|
||||
skeleton: []
|
||||
armTwist: 0.5
|
||||
foreArmTwist: 0.5
|
||||
upperLegTwist: 0.5
|
||||
legTwist: 0.5
|
||||
armStretch: 0.05
|
||||
legStretch: 0.05
|
||||
feetSpacing: 0
|
||||
globalScale: 1
|
||||
rootMotionBoneName:
|
||||
hasTranslationDoF: 0
|
||||
hasExtraRoot: 0
|
||||
skeletonHasParents: 1
|
||||
lastHumanDescriptionAvatarSource: {instanceID: 0}
|
||||
autoGenerateAvatarMappingIfUnspecified: 1
|
||||
animationType: 2
|
||||
humanoidOversampling: 1
|
||||
avatarSetup: 0
|
||||
additionalBone: 0
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Binary file not shown.
@@ -0,0 +1,97 @@
|
||||
fileFormatVersion: 2
|
||||
guid: efd0ff1193063db498e9ddb30e96e4ee
|
||||
ModelImporter:
|
||||
serializedVersion: 23
|
||||
fileIDToRecycleName:
|
||||
100000: //RootNode
|
||||
400000: //RootNode
|
||||
2100000: Material.001
|
||||
2300000: //RootNode
|
||||
3300000: //RootNode
|
||||
4300000: cfxr mesh foam
|
||||
externalObjects: {}
|
||||
materials:
|
||||
importMaterials: 0
|
||||
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
|
||||
useSRGBMaterialColor: 1
|
||||
importVisibility: 0
|
||||
importBlendShapes: 0
|
||||
importCameras: 0
|
||||
importLights: 0
|
||||
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
|
||||
legacyComputeAllNormalsFromSmoothingGroupsWhenMeshHasBlendShapes: 0
|
||||
blendShapeNormalImportMode: 1
|
||||
normalSmoothingSource: 0
|
||||
importAnimation: 0
|
||||
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:
|
||||
Binary file not shown.
@@ -0,0 +1,97 @@
|
||||
fileFormatVersion: 2
|
||||
guid: e82f2cbd6def7ff4c98963f706f00d3e
|
||||
ModelImporter:
|
||||
serializedVersion: 19301
|
||||
internalIDToNameTable: []
|
||||
externalObjects: {}
|
||||
materials:
|
||||
materialImportMode: 0
|
||||
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: 0
|
||||
meshes:
|
||||
lODScreenPercentages: []
|
||||
globalScale: 1
|
||||
meshCompression: 0
|
||||
addColliders: 0
|
||||
useSRGBMaterialColor: 1
|
||||
sortHierarchyByName: 1
|
||||
importVisibility: 0
|
||||
importBlendShapes: 0
|
||||
importCameras: 0
|
||||
importLights: 0
|
||||
fileIdsGeneration: 2
|
||||
swapUVChannels: 0
|
||||
generateSecondaryUV: 0
|
||||
useFileUnits: 1
|
||||
keepQuads: 0
|
||||
weldVertices: 1
|
||||
preserveHierarchy: 0
|
||||
skinWeightsMode: 0
|
||||
maxBonesPerVertex: 4
|
||||
minBoneWeight: 0.001
|
||||
meshOptimizationFlags: -1
|
||||
indexFormat: 0
|
||||
secondaryUVAngleDistortion: 8
|
||||
secondaryUVAreaDistortion: 15.000001
|
||||
secondaryUVHardAngle: 88
|
||||
secondaryUVPackMargin: 4
|
||||
useFileScale: 1
|
||||
tangentSpace:
|
||||
normalSmoothAngle: 60
|
||||
normalImportMode: 0
|
||||
tangentImportMode: 2
|
||||
normalCalculationMode: 4
|
||||
legacyComputeAllNormalsFromSmoothingGroupsWhenMeshHasBlendShapes: 0
|
||||
blendShapeNormalImportMode: 1
|
||||
normalSmoothingSource: 0
|
||||
referencedClips: []
|
||||
importAnimation: 0
|
||||
humanDescription:
|
||||
serializedVersion: 3
|
||||
human: []
|
||||
skeleton: []
|
||||
armTwist: 0.5
|
||||
foreArmTwist: 0.5
|
||||
upperLegTwist: 0.5
|
||||
legTwist: 0.5
|
||||
armStretch: 0.05
|
||||
legStretch: 0.05
|
||||
feetSpacing: 0
|
||||
globalScale: 1
|
||||
rootMotionBoneName:
|
||||
hasTranslationDoF: 0
|
||||
hasExtraRoot: 1
|
||||
skeletonHasParents: 1
|
||||
lastHumanDescriptionAvatarSource: {instanceID: 0}
|
||||
autoGenerateAvatarMappingIfUnspecified: 1
|
||||
animationType: 0
|
||||
humanoidOversampling: 1
|
||||
avatarSetup: 0
|
||||
additionalBone: 0
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Binary file not shown.
@@ -0,0 +1,114 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 192a51b0671a3e949b6876606c3205db
|
||||
ModelImporter:
|
||||
serializedVersion: 23
|
||||
fileIDToRecycleName:
|
||||
100000: cfxr particle_electric_arc_1
|
||||
100002: //RootNode
|
||||
100004: cfxr particle_electric_arc_2
|
||||
100006: cfxr particle_electric_arc_3
|
||||
100008: cfxr particle_electric_arc_4
|
||||
400000: cfxr particle_electric_arc_1
|
||||
400002: //RootNode
|
||||
400004: cfxr particle_electric_arc_2
|
||||
400006: cfxr particle_electric_arc_3
|
||||
400008: cfxr particle_electric_arc_4
|
||||
2100000: No Name
|
||||
2300000: cfxr particle_electric_arc_1
|
||||
2300002: cfxr particle_electric_arc_2
|
||||
2300004: cfxr particle_electric_arc_3
|
||||
2300006: cfxr particle_electric_arc_4
|
||||
3300000: cfxr particle_electric_arc_1
|
||||
3300002: cfxr particle_electric_arc_2
|
||||
3300004: cfxr particle_electric_arc_3
|
||||
3300006: cfxr particle_electric_arc_4
|
||||
4300000: cfxr particle_electric_arc_1
|
||||
4300002: cfxr particle_electric_arc_2
|
||||
4300004: cfxr particle_electric_arc_3
|
||||
4300006: cfxr particle_electric_arc_4
|
||||
externalObjects: {}
|
||||
materials:
|
||||
importMaterials: 0
|
||||
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: 0
|
||||
meshes:
|
||||
lODScreenPercentages: []
|
||||
globalScale: 0.2
|
||||
meshCompression: 0
|
||||
addColliders: 0
|
||||
useSRGBMaterialColor: 1
|
||||
importVisibility: 0
|
||||
importBlendShapes: 0
|
||||
importCameras: 0
|
||||
importLights: 0
|
||||
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
|
||||
legacyComputeAllNormalsFromSmoothingGroupsWhenMeshHasBlendShapes: 0
|
||||
blendShapeNormalImportMode: 1
|
||||
normalSmoothingSource: 0
|
||||
importAnimation: 0
|
||||
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:
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 90cebaa0afdacee48a8b5ea661f8a1a7
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"name": "CFXRRuntime"
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 785156d0baf9e564e92265c9169511bb
|
||||
AssemblyDefinitionImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,287 @@
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using UnityEngine.Rendering;
|
||||
#if UNITY_EDITOR
|
||||
using UnityEditor;
|
||||
#endif
|
||||
|
||||
namespace CartoonFX
|
||||
{
|
||||
public partial class CFXR_Effect : MonoBehaviour
|
||||
{
|
||||
[System.Serializable]
|
||||
public class CameraShake
|
||||
{
|
||||
public enum ShakeSpace
|
||||
{
|
||||
Screen,
|
||||
World
|
||||
}
|
||||
|
||||
static public bool editorPreview = true;
|
||||
|
||||
//--------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
public bool enabled = false;
|
||||
[Space]
|
||||
public bool useMainCamera = true;
|
||||
public List<Camera> cameras = new List<Camera>();
|
||||
[Space]
|
||||
public float delay = 0.0f;
|
||||
public float duration = 1.0f;
|
||||
public ShakeSpace shakeSpace = ShakeSpace.Screen;
|
||||
public Vector3 shakeStrength = new Vector3(0.1f, 0.1f, 0.1f);
|
||||
public AnimationCurve shakeCurve = AnimationCurve.Linear(0, 1, 1, 0);
|
||||
[Space]
|
||||
[Range(0, 0.1f)] public float shakesDelay = 0;
|
||||
|
||||
[System.NonSerialized] public bool isShaking;
|
||||
Dictionary<Camera, Vector3> camerasPreRenderPosition = new Dictionary<Camera, Vector3>();
|
||||
Vector3 shakeVector;
|
||||
float delaysTimer;
|
||||
|
||||
//--------------------------------------------------------------------------------------------------------------------------------
|
||||
// STATIC
|
||||
// Use static methods to dispatch the Camera callbacks, to ensure that ScreenShake components are called in an order in PreRender,
|
||||
// and in the _reverse_ order for PostRender, so that the final Camera position is the same as it is originally (allowing concurrent
|
||||
// screen shake to be active)
|
||||
|
||||
static bool s_CallbackRegistered;
|
||||
static List<CameraShake> s_CameraShakes = new List<CameraShake>();
|
||||
|
||||
#if UNITY_2019_1_OR_NEWER
|
||||
static void OnPreRenderCamera_Static_URP(ScriptableRenderContext context, Camera cam)
|
||||
{
|
||||
OnPreRenderCamera_Static(cam);
|
||||
}
|
||||
static void OnPostRenderCamera_Static_URP(ScriptableRenderContext context, Camera cam)
|
||||
{
|
||||
OnPostRenderCamera_Static(cam);
|
||||
}
|
||||
#endif
|
||||
|
||||
static void OnPreRenderCamera_Static(Camera cam)
|
||||
{
|
||||
int count = s_CameraShakes.Count;
|
||||
for (int i = 0; i < count; i++)
|
||||
{
|
||||
var ss = s_CameraShakes[i];
|
||||
ss.onPreRenderCamera(cam);
|
||||
}
|
||||
}
|
||||
|
||||
static void OnPostRenderCamera_Static(Camera cam)
|
||||
{
|
||||
int count = s_CameraShakes.Count;
|
||||
for (int i = count-1; i >= 0; i--)
|
||||
{
|
||||
var ss = s_CameraShakes[i];
|
||||
ss.onPostRenderCamera(cam);
|
||||
}
|
||||
}
|
||||
|
||||
static void RegisterStaticCallback(CameraShake cameraShake)
|
||||
{
|
||||
s_CameraShakes.Add(cameraShake);
|
||||
|
||||
if (!s_CallbackRegistered)
|
||||
{
|
||||
#if UNITY_2019_1_OR_NEWER
|
||||
#if UNITY_2019_3_OR_NEWER
|
||||
if (GraphicsSettings.currentRenderPipeline == null)
|
||||
#else
|
||||
if (GraphicsSettings.renderPipelineAsset == null)
|
||||
#endif
|
||||
{
|
||||
// Built-in Render Pipeline
|
||||
Camera.onPreRender += OnPreRenderCamera_Static;
|
||||
Camera.onPostRender += OnPostRenderCamera_Static;
|
||||
}
|
||||
else
|
||||
{
|
||||
// URP
|
||||
RenderPipelineManager.beginCameraRendering += OnPreRenderCamera_Static_URP;
|
||||
RenderPipelineManager.endCameraRendering += OnPostRenderCamera_Static_URP;
|
||||
}
|
||||
#else
|
||||
Camera.onPreRender += OnPreRenderCamera_Static;
|
||||
Camera.onPostRender += OnPostRenderCamera_Static;
|
||||
#endif
|
||||
|
||||
s_CallbackRegistered = true;
|
||||
}
|
||||
}
|
||||
|
||||
static void UnregisterStaticCallback(CameraShake cameraShake)
|
||||
{
|
||||
s_CameraShakes.Remove(cameraShake);
|
||||
|
||||
if (s_CallbackRegistered && s_CameraShakes.Count == 0)
|
||||
{
|
||||
#if UNITY_2019_1_OR_NEWER
|
||||
#if UNITY_2019_3_OR_NEWER
|
||||
if (GraphicsSettings.currentRenderPipeline == null)
|
||||
#else
|
||||
if (GraphicsSettings.renderPipelineAsset == null)
|
||||
#endif
|
||||
{
|
||||
// Built-in Render Pipeline
|
||||
Camera.onPreRender -= OnPreRenderCamera_Static;
|
||||
Camera.onPostRender -= OnPostRenderCamera_Static;
|
||||
}
|
||||
else
|
||||
{
|
||||
// URP
|
||||
RenderPipelineManager.beginCameraRendering -= OnPreRenderCamera_Static_URP;
|
||||
RenderPipelineManager.endCameraRendering -= OnPostRenderCamera_Static_URP;
|
||||
}
|
||||
#else
|
||||
Camera.onPreRender -= OnPreRenderCamera_Static;
|
||||
Camera.onPostRender -= OnPostRenderCamera_Static;
|
||||
#endif
|
||||
|
||||
s_CallbackRegistered = false;
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
void onPreRenderCamera(Camera cam)
|
||||
{
|
||||
#if UNITY_EDITOR
|
||||
//add scene view camera if necessary
|
||||
if (SceneView.currentDrawingSceneView != null && SceneView.currentDrawingSceneView.camera == cam && !camerasPreRenderPosition.ContainsKey(cam))
|
||||
{
|
||||
camerasPreRenderPosition.Add(cam, cam.transform.localPosition);
|
||||
}
|
||||
#endif
|
||||
|
||||
if (isShaking && camerasPreRenderPosition.ContainsKey(cam))
|
||||
{
|
||||
camerasPreRenderPosition[cam] = cam.transform.localPosition;
|
||||
|
||||
if (Time.timeScale <= 0) return;
|
||||
|
||||
switch (shakeSpace)
|
||||
{
|
||||
case ShakeSpace.Screen: cam.transform.localPosition += cam.transform.rotation * shakeVector; break;
|
||||
case ShakeSpace.World: cam.transform.localPosition += shakeVector; break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void onPostRenderCamera(Camera cam)
|
||||
{
|
||||
if (camerasPreRenderPosition.ContainsKey(cam))
|
||||
{
|
||||
cam.transform.localPosition = camerasPreRenderPosition[cam];
|
||||
}
|
||||
}
|
||||
|
||||
public void fetchCameras()
|
||||
{
|
||||
#if UNITY_EDITOR
|
||||
if (!EditorApplication.isPlayingOrWillChangePlaymode)
|
||||
{
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
|
||||
foreach (var cam in cameras)
|
||||
{
|
||||
if (cam == null) continue;
|
||||
|
||||
camerasPreRenderPosition.Remove(cam);
|
||||
}
|
||||
|
||||
cameras.Clear();
|
||||
|
||||
if (useMainCamera && Camera.main != null)
|
||||
{
|
||||
cameras.Add(Camera.main);
|
||||
}
|
||||
|
||||
foreach (var cam in cameras)
|
||||
{
|
||||
if (cam == null) continue;
|
||||
|
||||
if (!camerasPreRenderPosition.ContainsKey(cam))
|
||||
{
|
||||
camerasPreRenderPosition.Add(cam, Vector3.zero);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void StartShake()
|
||||
{
|
||||
if (isShaking)
|
||||
{
|
||||
StopShake();
|
||||
}
|
||||
|
||||
isShaking = true;
|
||||
RegisterStaticCallback(this);
|
||||
}
|
||||
|
||||
public void StopShake()
|
||||
{
|
||||
isShaking = false;
|
||||
shakeVector = Vector3.zero;
|
||||
UnregisterStaticCallback(this);
|
||||
}
|
||||
|
||||
public void animate(float time)
|
||||
{
|
||||
#if UNITY_EDITOR
|
||||
if (!editorPreview && !EditorApplication.isPlaying)
|
||||
{
|
||||
shakeVector = Vector3.zero;
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
|
||||
float totalDuration = duration + delay;
|
||||
if (time < totalDuration)
|
||||
{
|
||||
if (time < delay)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (!isShaking)
|
||||
{
|
||||
this.StartShake();
|
||||
}
|
||||
|
||||
// duration of the camera shake
|
||||
float delta = Mathf.Clamp01(time/totalDuration);
|
||||
|
||||
// delay between each camera move
|
||||
if (shakesDelay > 0)
|
||||
{
|
||||
delaysTimer += Time.deltaTime;
|
||||
if (delaysTimer < shakesDelay)
|
||||
{
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
while (delaysTimer >= shakesDelay)
|
||||
{
|
||||
delaysTimer -= shakesDelay;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
var randomVec = new Vector3(Random.value, Random.value, Random.value);
|
||||
var shakeVec = Vector3.Scale(randomVec, shakeStrength) * (Random.value > 0.5f ? -1 : 1);
|
||||
shakeVector = shakeVec * shakeCurve.Evaluate(delta) * GLOBAL_CAMERA_SHAKE_MULTIPLIER;
|
||||
}
|
||||
else if (isShaking)
|
||||
{
|
||||
StopShake();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 04efd1cc0f5c31c4da57d931c6665976
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,915 @@
|
||||
//--------------------------------------------------------------------------------------------------------------------------------
|
||||
// Cartoon FX
|
||||
// (c) 2012-2025 Jean Moreno
|
||||
//--------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
|
||||
//--------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
// Use the defines below to globally disable features:
|
||||
|
||||
// #define DISABLE_CAMERA_SHAKE
|
||||
// #define DISABLE_LIGHTS
|
||||
// #define DISABLE_LIGHTS_LINEAR_REMAPPING
|
||||
// #define DISABLE_CLEAR_BEHAVIOR
|
||||
|
||||
//--------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
using UnityEngine;
|
||||
using UnityEngine.Rendering;
|
||||
#if UNITY_EDITOR
|
||||
using UnityEditor;
|
||||
#endif
|
||||
|
||||
namespace CartoonFX
|
||||
{
|
||||
[RequireComponent(typeof(ParticleSystem))]
|
||||
[DisallowMultipleComponent]
|
||||
public partial class CFXR_Effect : MonoBehaviour
|
||||
{
|
||||
// Change this value to easily tune the camera shake strength for all effects
|
||||
const float GLOBAL_CAMERA_SHAKE_MULTIPLIER = 1.0f;
|
||||
|
||||
static readonly int _GameObjectWorldPosition = Shader.PropertyToID("_GameObjectWorldPosition");
|
||||
|
||||
#if UNITY_EDITOR
|
||||
[InitializeOnLoadMethod]
|
||||
static void InitGlobalOptions()
|
||||
{
|
||||
AnimatedLight.editorPreview = EditorPrefs.GetBool("CFXR Light EditorPreview", true);
|
||||
#if !DISABLE_CAMERA_SHAKE
|
||||
CameraShake.editorPreview = EditorPrefs.GetBool("CFXR CameraShake EditorPreview", true);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
public enum ClearBehavior
|
||||
{
|
||||
None,
|
||||
Disable,
|
||||
Destroy
|
||||
}
|
||||
|
||||
[System.Serializable]
|
||||
public class AnimatedLight
|
||||
{
|
||||
static public bool editorPreview = true;
|
||||
|
||||
public Light light;
|
||||
|
||||
public bool loop;
|
||||
|
||||
public bool animateIntensity;
|
||||
public float intensityStart = 8f;
|
||||
public float intensityEnd = 0f;
|
||||
public float intensityDuration = 0.5f;
|
||||
public AnimationCurve intensityCurve = AnimationCurve.EaseInOut(0f, 1f, 1f, 0f);
|
||||
public bool perlinIntensity;
|
||||
public float perlinIntensitySpeed = 1f;
|
||||
public bool fadeIn;
|
||||
public float fadeInDuration = 0.5f;
|
||||
public bool fadeOut;
|
||||
public float fadeOutDuration = 0.5f;
|
||||
|
||||
public bool animateRange;
|
||||
public float rangeStart = 8f;
|
||||
public float rangeEnd = 0f;
|
||||
public float rangeDuration = 0.5f;
|
||||
public AnimationCurve rangeCurve = AnimationCurve.EaseInOut(0f, 1f, 1f, 0f);
|
||||
public bool perlinRange;
|
||||
public float perlinRangeSpeed = 1f;
|
||||
|
||||
public bool animateColor;
|
||||
public Gradient colorGradient;
|
||||
public float colorDuration = 0.5f;
|
||||
public AnimationCurve colorCurve = AnimationCurve.EaseInOut(0f, 1f, 1f, 0f);
|
||||
public bool perlinColor;
|
||||
public float perlinColorSpeed = 1f;
|
||||
|
||||
public void animate(float time)
|
||||
{
|
||||
#if UNITY_EDITOR
|
||||
if (!editorPreview && !EditorApplication.isPlaying)
|
||||
{
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
|
||||
if (light != null)
|
||||
{
|
||||
if (animateIntensity)
|
||||
{
|
||||
float delta = loop ? Mathf.Clamp01((time % intensityDuration)/intensityDuration) : Mathf.Clamp01(time/intensityDuration);
|
||||
delta = perlinIntensity ? Mathf.PerlinNoise(Time.time * perlinIntensitySpeed, 0f) : intensityCurve.Evaluate(delta);
|
||||
light.intensity = Mathf.LerpUnclamped(intensityEnd, intensityStart, delta);
|
||||
|
||||
if (fadeIn && time < fadeInDuration)
|
||||
{
|
||||
light.intensity *= Mathf.Clamp01(time / fadeInDuration);
|
||||
}
|
||||
}
|
||||
|
||||
if (animateRange)
|
||||
{
|
||||
float delta = loop ? Mathf.Clamp01((time % rangeDuration)/rangeDuration) : Mathf.Clamp01(time/rangeDuration);
|
||||
delta = perlinRange ? Mathf.PerlinNoise(Time.time * perlinRangeSpeed, 10f) : rangeCurve.Evaluate(delta);
|
||||
light.range = Mathf.LerpUnclamped(rangeEnd, rangeStart, delta);
|
||||
}
|
||||
|
||||
if (animateColor)
|
||||
{
|
||||
float delta = loop ? Mathf.Clamp01((time % colorDuration)/colorDuration) : Mathf.Clamp01(time/colorDuration);
|
||||
delta = perlinColor ? Mathf.PerlinNoise(Time.time * perlinColorSpeed, 0f) : colorCurve.Evaluate(delta);
|
||||
light.color = colorGradient.Evaluate(delta);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void animateFadeOut(float time)
|
||||
{
|
||||
if (fadeOut && light != null)
|
||||
{
|
||||
light.intensity *= 1.0f - Mathf.Clamp01(time / fadeOutDuration);
|
||||
}
|
||||
}
|
||||
|
||||
public void reset()
|
||||
{
|
||||
if (light != null)
|
||||
{
|
||||
if (animateIntensity)
|
||||
{
|
||||
light.intensity = (fadeIn || fadeOut) ? 0 : intensityEnd;
|
||||
}
|
||||
|
||||
if (animateRange)
|
||||
{
|
||||
light.range = rangeEnd;
|
||||
}
|
||||
|
||||
if (animateColor)
|
||||
{
|
||||
light.color = colorGradient.Evaluate(1f);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#region Animated Light Property Drawer
|
||||
#if UNITY_EDITOR
|
||||
[CustomPropertyDrawer(typeof(AnimatedLight))]
|
||||
public class AnimatedLightDrawer : PropertyDrawer
|
||||
{
|
||||
SerializedProperty light;
|
||||
|
||||
SerializedProperty loop;
|
||||
|
||||
SerializedProperty animateIntensity;
|
||||
SerializedProperty intensityStart;
|
||||
SerializedProperty intensityEnd;
|
||||
SerializedProperty intensityDuration;
|
||||
SerializedProperty intensityCurve;
|
||||
SerializedProperty perlinIntensity;
|
||||
SerializedProperty perlinIntensitySpeed;
|
||||
SerializedProperty fadeIn;
|
||||
SerializedProperty fadeInDuration;
|
||||
SerializedProperty fadeOut;
|
||||
SerializedProperty fadeOutDuration;
|
||||
|
||||
SerializedProperty animateRange;
|
||||
SerializedProperty rangeStart;
|
||||
SerializedProperty rangeEnd;
|
||||
SerializedProperty rangeDuration;
|
||||
SerializedProperty rangeCurve;
|
||||
SerializedProperty perlinRange;
|
||||
SerializedProperty perlinRangeSpeed;
|
||||
|
||||
SerializedProperty animateColor;
|
||||
SerializedProperty colorGradient;
|
||||
SerializedProperty colorDuration;
|
||||
SerializedProperty colorCurve;
|
||||
SerializedProperty perlinColor;
|
||||
SerializedProperty perlinColorSpeed;
|
||||
|
||||
void fetchProperties(SerializedProperty property)
|
||||
{
|
||||
light = property.FindPropertyRelative("light");
|
||||
|
||||
loop = property.FindPropertyRelative("loop");
|
||||
|
||||
animateIntensity = property.FindPropertyRelative("animateIntensity");
|
||||
intensityStart = property.FindPropertyRelative("intensityStart");
|
||||
intensityEnd = property.FindPropertyRelative("intensityEnd");
|
||||
intensityDuration = property.FindPropertyRelative("intensityDuration");
|
||||
intensityCurve = property.FindPropertyRelative("intensityCurve");
|
||||
perlinIntensity = property.FindPropertyRelative("perlinIntensity");
|
||||
perlinIntensitySpeed = property.FindPropertyRelative("perlinIntensitySpeed");
|
||||
fadeIn = property.FindPropertyRelative("fadeIn");
|
||||
fadeInDuration = property.FindPropertyRelative("fadeInDuration");
|
||||
fadeOut = property.FindPropertyRelative("fadeOut");
|
||||
fadeOutDuration = property.FindPropertyRelative("fadeOutDuration");
|
||||
|
||||
animateRange = property.FindPropertyRelative("animateRange");
|
||||
rangeStart = property.FindPropertyRelative("rangeStart");
|
||||
rangeEnd = property.FindPropertyRelative("rangeEnd");
|
||||
rangeDuration = property.FindPropertyRelative("rangeDuration");
|
||||
rangeCurve = property.FindPropertyRelative("rangeCurve");
|
||||
perlinRange = property.FindPropertyRelative("perlinRange");
|
||||
perlinRangeSpeed = property.FindPropertyRelative("perlinRangeSpeed");
|
||||
|
||||
animateColor = property.FindPropertyRelative("animateColor");
|
||||
colorGradient = property.FindPropertyRelative("colorGradient");
|
||||
colorDuration = property.FindPropertyRelative("colorDuration");
|
||||
colorCurve = property.FindPropertyRelative("colorCurve");
|
||||
perlinColor = property.FindPropertyRelative("perlinColor");
|
||||
perlinColorSpeed = property.FindPropertyRelative("perlinColorSpeed");
|
||||
}
|
||||
|
||||
static GUIContent[] ModePopupLabels = new GUIContent[] { new GUIContent("Curve"), new GUIContent("Perlin Noise") };
|
||||
static GUIContent IntensityModeLabel = new GUIContent("Intensity Mode");
|
||||
static GUIContent RangeModeLabel = new GUIContent("Range Mode");
|
||||
static GUIContent ColorModeLabel = new GUIContent("Color Mode");
|
||||
|
||||
const float INDENT_WIDTH = 15f;
|
||||
const float PADDING = 4f;
|
||||
|
||||
void startIndent(ref Rect rect)
|
||||
{
|
||||
EditorGUIUtility.labelWidth -= INDENT_WIDTH;
|
||||
rect.xMin += INDENT_WIDTH;
|
||||
}
|
||||
|
||||
void endIndent(ref Rect rect)
|
||||
{
|
||||
EditorGUIUtility.labelWidth += INDENT_WIDTH;
|
||||
rect.xMin -= INDENT_WIDTH;
|
||||
}
|
||||
|
||||
public override void OnGUI(Rect position, SerializedProperty property, GUIContent label)
|
||||
{
|
||||
fetchProperties(property);
|
||||
|
||||
Rect rect = EditorGUI.IndentedRect(position);
|
||||
|
||||
//Rect lineRect = rect;
|
||||
//lineRect.height = 1;
|
||||
//lineRect.y -= 2;
|
||||
//EditorGUI.DrawRect(lineRect, Color.gray);
|
||||
|
||||
if (Event.current.type == EventType.Repaint)
|
||||
{
|
||||
EditorStyles.helpBox.Draw(rect, GUIContent.none, 0);
|
||||
}
|
||||
|
||||
EditorGUIUtility.labelWidth -= INDENT_WIDTH;
|
||||
|
||||
rect.height = EditorGUIUtility.singleLineHeight;
|
||||
rect.xMax -= PADDING;
|
||||
rect.y += PADDING;
|
||||
float propSpace = EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
|
||||
|
||||
EditorGUI.PropertyField(rect, light); rect.y += propSpace;
|
||||
EditorGUI.PropertyField(rect, loop); rect.y += propSpace;
|
||||
|
||||
EditorGUI.PropertyField(rect, animateIntensity); rect.y += propSpace;
|
||||
if (animateIntensity.boolValue)
|
||||
{
|
||||
startIndent(ref rect);
|
||||
{
|
||||
|
||||
EditorGUI.PropertyField(rect, intensityStart); rect.y += propSpace;
|
||||
EditorGUI.PropertyField(rect, intensityEnd); rect.y += propSpace;
|
||||
|
||||
int val = EditorGUI.Popup(rect, IntensityModeLabel, perlinIntensity.boolValue ? 1 : 0, ModePopupLabels); rect.y += propSpace;
|
||||
if (val == 1 && !perlinIntensity.boolValue)
|
||||
{
|
||||
perlinIntensity.boolValue = true;
|
||||
}
|
||||
else if (val == 0 && perlinIntensity.boolValue)
|
||||
{
|
||||
perlinIntensity.boolValue = false;
|
||||
}
|
||||
|
||||
startIndent(ref rect);
|
||||
{
|
||||
if (perlinIntensity.boolValue)
|
||||
{
|
||||
EditorGUI.PropertyField(rect, perlinIntensitySpeed); rect.y += propSpace;
|
||||
}
|
||||
else
|
||||
{
|
||||
EditorGUI.PropertyField(rect, intensityDuration); rect.y += propSpace;
|
||||
EditorGUI.PropertyField(rect, intensityCurve); rect.y += propSpace;
|
||||
}
|
||||
}
|
||||
endIndent(ref rect);
|
||||
|
||||
EditorGUI.PropertyField(rect, fadeIn); rect.y += propSpace;
|
||||
if (fadeIn.boolValue)
|
||||
{
|
||||
startIndent(ref rect);
|
||||
EditorGUI.PropertyField(rect, fadeInDuration); rect.y += propSpace;
|
||||
endIndent(ref rect);
|
||||
}
|
||||
|
||||
EditorGUI.PropertyField(rect, fadeOut); rect.y += propSpace;
|
||||
if (fadeOut.boolValue)
|
||||
{
|
||||
startIndent(ref rect);
|
||||
EditorGUI.PropertyField(rect, fadeOutDuration); rect.y += propSpace;
|
||||
endIndent(ref rect);
|
||||
}
|
||||
|
||||
}
|
||||
endIndent(ref rect);
|
||||
}
|
||||
|
||||
EditorGUI.PropertyField(rect, animateRange); rect.y += propSpace;
|
||||
if (animateRange.boolValue)
|
||||
{
|
||||
startIndent(ref rect);
|
||||
{
|
||||
EditorGUI.PropertyField(rect, rangeStart); rect.y += propSpace;
|
||||
EditorGUI.PropertyField(rect, rangeEnd); rect.y += propSpace;
|
||||
|
||||
int val = EditorGUI.Popup(rect, RangeModeLabel, perlinRange.boolValue ? 1 : 0, ModePopupLabels); rect.y += propSpace;
|
||||
if (val == 1 && !perlinRange.boolValue)
|
||||
{
|
||||
perlinRange.boolValue = true;
|
||||
}
|
||||
else if (val == 0 && perlinRange.boolValue)
|
||||
{
|
||||
perlinRange.boolValue = false;
|
||||
}
|
||||
|
||||
startIndent(ref rect);
|
||||
{
|
||||
if (perlinRange.boolValue)
|
||||
{
|
||||
EditorGUI.PropertyField(rect, perlinRangeSpeed); rect.y += propSpace;
|
||||
}
|
||||
else
|
||||
{
|
||||
EditorGUI.PropertyField(rect, rangeDuration); rect.y += propSpace;
|
||||
EditorGUI.PropertyField(rect, rangeCurve); rect.y += propSpace;
|
||||
}
|
||||
}
|
||||
endIndent(ref rect);
|
||||
}
|
||||
endIndent(ref rect);
|
||||
}
|
||||
|
||||
EditorGUI.PropertyField(rect, animateColor); rect.y += propSpace;
|
||||
if (animateColor.boolValue)
|
||||
{
|
||||
startIndent(ref rect);
|
||||
{
|
||||
|
||||
EditorGUI.PropertyField(rect, colorGradient); rect.y += propSpace;
|
||||
|
||||
int val = EditorGUI.Popup(rect, ColorModeLabel, perlinColor.boolValue ? 1 : 0, ModePopupLabels); rect.y += propSpace;
|
||||
if (val == 1 && !perlinColor.boolValue)
|
||||
{
|
||||
perlinColor.boolValue = true;
|
||||
}
|
||||
else if (val == 0 && perlinColor.boolValue)
|
||||
{
|
||||
perlinColor.boolValue = false;
|
||||
}
|
||||
|
||||
startIndent(ref rect);
|
||||
{
|
||||
|
||||
if (perlinColor.boolValue)
|
||||
{
|
||||
EditorGUI.PropertyField(rect, perlinColorSpeed); rect.y += propSpace;
|
||||
}
|
||||
else
|
||||
{
|
||||
EditorGUI.PropertyField(rect, colorDuration); rect.y += propSpace;
|
||||
EditorGUI.PropertyField(rect, colorCurve); rect.y += propSpace;
|
||||
}
|
||||
}
|
||||
endIndent(ref rect);
|
||||
}
|
||||
endIndent(ref rect);
|
||||
}
|
||||
|
||||
EditorGUIUtility.labelWidth += INDENT_WIDTH;
|
||||
|
||||
if (GUI.changed)
|
||||
{
|
||||
property.serializedObject.ApplyModifiedProperties();
|
||||
}
|
||||
}
|
||||
|
||||
public override float GetPropertyHeight(SerializedProperty property, GUIContent label)
|
||||
{
|
||||
fetchProperties(property);
|
||||
|
||||
float propSpace = EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
|
||||
int count = 5;
|
||||
|
||||
if (animateIntensity.boolValue)
|
||||
{
|
||||
count += 3;
|
||||
count += perlinIntensity.boolValue ? 1 : 2;
|
||||
count += 1;
|
||||
count += fadeIn.boolValue ? 1 : 0;
|
||||
count += 1;
|
||||
count += fadeOut.boolValue ? 1 : 0;
|
||||
}
|
||||
|
||||
if (animateRange.boolValue)
|
||||
{
|
||||
count += 3;
|
||||
count += perlinRange.boolValue ? 1 : 2;
|
||||
}
|
||||
|
||||
if (animateColor.boolValue)
|
||||
{
|
||||
count += 2;
|
||||
count += perlinColor.boolValue ? 1 : 2;
|
||||
}
|
||||
|
||||
return count * propSpace + PADDING * 2;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
#endregion
|
||||
|
||||
}
|
||||
|
||||
// ================================================================================================================================
|
||||
|
||||
// Globally disable features
|
||||
public static bool GlobalDisableCameraShake;
|
||||
public static bool GlobalDisableLights;
|
||||
|
||||
// ================================================================================================================================
|
||||
|
||||
[Tooltip("Defines an action to execute when the Particle System has completely finished playing and emitting particles.")]
|
||||
public ClearBehavior clearBehavior = ClearBehavior.Destroy;
|
||||
[Space]
|
||||
public CameraShake cameraShake;
|
||||
[Space]
|
||||
public AnimatedLight[] animatedLights;
|
||||
[Tooltip("Defines which Particle System to track to trigger light fading out.\nLeave empty if not using fading out.")]
|
||||
public ParticleSystem fadeOutReference;
|
||||
|
||||
#if !DISABLE_LIGHTS || !DISABLE_CAMERA_SHAKE
|
||||
float time;
|
||||
#endif
|
||||
ParticleSystem rootParticleSystem;
|
||||
[System.NonSerialized] MaterialPropertyBlock materialPropertyBlock;
|
||||
[System.NonSerialized] Renderer particleRenderer;
|
||||
|
||||
// ================================================================================================================================
|
||||
|
||||
public void ResetState()
|
||||
{
|
||||
#if !DISABLE_LIGHTS || !DISABLE_CAMERA_SHAKE
|
||||
time = 0f;
|
||||
#endif
|
||||
|
||||
#if !DISABLE_LIGHTS
|
||||
fadingOutStartTime = 0f;
|
||||
isFadingOut = false;
|
||||
if (animatedLights != null)
|
||||
{
|
||||
foreach (var animLight in animatedLights)
|
||||
{
|
||||
animLight.reset();
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
#if !DISABLE_CAMERA_SHAKE
|
||||
if (cameraShake != null && cameraShake.enabled)
|
||||
{
|
||||
cameraShake.StopShake();
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
#if !DISABLE_CAMERA_SHAKE || !DISABLE_CLEAR_BEHAVIOR
|
||||
void Awake()
|
||||
{
|
||||
#if !DISABLE_CAMERA_SHAKE
|
||||
if (cameraShake != null && cameraShake.enabled)
|
||||
{
|
||||
cameraShake.fetchCameras();
|
||||
}
|
||||
#endif
|
||||
#if !DISABLE_CLEAR_BEHAVIOR
|
||||
startFrameOffset = GlobalStartFrameOffset++;
|
||||
#endif
|
||||
// Detect if world position needs to be passed to the shader
|
||||
particleRenderer = this.GetComponent<ParticleSystemRenderer>();
|
||||
if (particleRenderer.sharedMaterial != null && particleRenderer.sharedMaterial.IsKeywordEnabled("_CFXR_LIGHTING_WPOS_OFFSET"))
|
||||
{
|
||||
materialPropertyBlock = new MaterialPropertyBlock();
|
||||
}
|
||||
|
||||
#if !DISABLE_LIGHTS && !DISABLE_LIGHTS_LINEAR_REMAPPING
|
||||
// Lights were calibrated using the built-in rendering pipeline, but
|
||||
// when using URP their intensities are transmitted using linear values.
|
||||
// This internal Unity flag defines that behavior, so we compensate here
|
||||
// such that original values remain.
|
||||
if (!GraphicsSettings.lightsUseLinearIntensity && animatedLights != null)
|
||||
{
|
||||
foreach (var animLight in animatedLights)
|
||||
{
|
||||
animLight.intensityStart = Mathf.LinearToGammaSpace(animLight.intensityStart);
|
||||
animLight.intensityEnd = Mathf.LinearToGammaSpace(animLight.intensityEnd);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
void OnEnable()
|
||||
{
|
||||
foreach (var animLight in animatedLights)
|
||||
{
|
||||
if (animLight.light != null)
|
||||
{
|
||||
#if !DISABLE_LIGHTS
|
||||
animLight.light.enabled = !GlobalDisableLights;
|
||||
#else
|
||||
animLight.light.enabled = false;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void OnDisable()
|
||||
{
|
||||
ResetState();
|
||||
}
|
||||
|
||||
#if !DISABLE_LIGHTS || !DISABLE_CAMERA_SHAKE || !DISABLE_CLEAR_BEHAVIOR
|
||||
const int CHECK_EVERY_N_FRAME = 20;
|
||||
#if !DISABLE_CLEAR_BEHAVIOR
|
||||
static int GlobalStartFrameOffset;
|
||||
#endif
|
||||
int startFrameOffset;
|
||||
void Update()
|
||||
{
|
||||
#if !DISABLE_LIGHTS || !DISABLE_CAMERA_SHAKE
|
||||
time += Time.deltaTime;
|
||||
|
||||
Animate(time);
|
||||
|
||||
#if !DISABLE_LIGHTS
|
||||
if (fadeOutReference != null && !fadeOutReference.isEmitting && (fadeOutReference.isPlaying || isFadingOut))
|
||||
{
|
||||
FadeOut(time);
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
#if !DISABLE_CLEAR_BEHAVIOR
|
||||
if (clearBehavior != ClearBehavior.None)
|
||||
{
|
||||
if (rootParticleSystem == null)
|
||||
{
|
||||
rootParticleSystem = this.GetComponent<ParticleSystem>();
|
||||
}
|
||||
|
||||
// Check isAlive every N frame, with an offset so that all active effects aren't checked at once
|
||||
if ((Time.renderedFrameCount + startFrameOffset) % CHECK_EVERY_N_FRAME == 0)
|
||||
{
|
||||
if (!rootParticleSystem.IsAlive(true))
|
||||
{
|
||||
if (clearBehavior == ClearBehavior.Destroy)
|
||||
{
|
||||
GameObject.Destroy(this.gameObject);
|
||||
}
|
||||
else
|
||||
{
|
||||
this.gameObject.SetActive(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
if (materialPropertyBlock != null)
|
||||
{
|
||||
particleRenderer.GetPropertyBlock(materialPropertyBlock);
|
||||
materialPropertyBlock.SetVector(_GameObjectWorldPosition, this.transform.position);
|
||||
particleRenderer.SetPropertyBlock(materialPropertyBlock);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
#if !DISABLE_LIGHTS || !DISABLE_CAMERA_SHAKE
|
||||
public void Animate(float _time)
|
||||
{
|
||||
#if !DISABLE_LIGHTS
|
||||
if (animatedLights != null && !GlobalDisableLights)
|
||||
{
|
||||
foreach (var animLight in animatedLights)
|
||||
{
|
||||
animLight.animate(_time);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
#if !DISABLE_CAMERA_SHAKE
|
||||
if (cameraShake != null && cameraShake.enabled && !GlobalDisableCameraShake)
|
||||
{
|
||||
#if UNITY_EDITOR
|
||||
if (!cameraShake.isShaking)
|
||||
{
|
||||
cameraShake.fetchCameras();
|
||||
}
|
||||
#endif
|
||||
cameraShake.animate(_time);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
#if !DISABLE_LIGHTS
|
||||
bool isFadingOut;
|
||||
float fadingOutStartTime;
|
||||
public void FadeOut(float _time)
|
||||
{
|
||||
if (animatedLights == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (!isFadingOut)
|
||||
{
|
||||
isFadingOut = true;
|
||||
fadingOutStartTime = _time;
|
||||
}
|
||||
|
||||
foreach (var animLight in animatedLights)
|
||||
{
|
||||
animLight.animateFadeOut(_time - fadingOutStartTime);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
#if UNITY_EDITOR
|
||||
// Editor preview
|
||||
// Detect when the Particle System is previewing and trigger this animation too
|
||||
|
||||
[System.NonSerialized] ParticleSystem _parentParticle;
|
||||
ParticleSystem parentParticle
|
||||
{
|
||||
get
|
||||
{
|
||||
if (_parentParticle == null)
|
||||
{
|
||||
_parentParticle = this.GetComponent<ParticleSystem>();
|
||||
}
|
||||
return _parentParticle;
|
||||
}
|
||||
}
|
||||
[System.NonSerialized] public bool editorUpdateRegistered;
|
||||
|
||||
[System.NonSerialized] bool particleWasStopped;
|
||||
[System.NonSerialized] float particleTime;
|
||||
#if !DISABLE_LIGHTS || !DISABLE_CAMERA_SHAKE
|
||||
[System.NonSerialized] float particleTimeUnwrapped;
|
||||
#endif
|
||||
|
||||
void OnDestroy()
|
||||
{
|
||||
UnregisterEditorUpdate();
|
||||
}
|
||||
|
||||
public void RegisterEditorUpdate()
|
||||
{
|
||||
var type = PrefabUtility.GetPrefabAssetType(this.gameObject);
|
||||
var status = PrefabUtility.GetPrefabInstanceStatus(this.gameObject);
|
||||
|
||||
// Prefab in Project window
|
||||
if (type is PrefabAssetType.Regular or PrefabAssetType.Variant && status == PrefabInstanceStatus.NotAPrefab)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (!editorUpdateRegistered)
|
||||
{
|
||||
EditorApplication.update += onEditorUpdate;
|
||||
editorUpdateRegistered = true;
|
||||
}
|
||||
}
|
||||
|
||||
public void UnregisterEditorUpdate()
|
||||
{
|
||||
if (editorUpdateRegistered)
|
||||
{
|
||||
editorUpdateRegistered = false;
|
||||
EditorApplication.update -= onEditorUpdate;
|
||||
}
|
||||
ResetState();
|
||||
}
|
||||
|
||||
void onEditorUpdate()
|
||||
{
|
||||
if (EditorApplication.isPlayingOrWillChangePlaymode)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (this == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
var rend = this.GetComponent<ParticleSystemRenderer>();
|
||||
if (rend.sharedMaterial != null && rend.sharedMaterial.IsKeywordEnabled("_CFXR_LIGHTING_WPOS_OFFSET"))
|
||||
{
|
||||
if (materialPropertyBlock == null)
|
||||
{
|
||||
materialPropertyBlock = new MaterialPropertyBlock();
|
||||
}
|
||||
|
||||
rend.GetPropertyBlock(materialPropertyBlock);
|
||||
materialPropertyBlock.SetVector(_GameObjectWorldPosition, this.transform.position);
|
||||
rend.SetPropertyBlock(materialPropertyBlock);
|
||||
}
|
||||
|
||||
// Need to track unwrapped time when playing back from Editor
|
||||
// because the parentParticle.time will be reset at each loop
|
||||
float delta = parentParticle.time - particleTime;
|
||||
|
||||
if (delta < 0 && parentParticle.isPlaying)
|
||||
{
|
||||
delta = parentParticle.main.duration + delta;
|
||||
if (delta > 0.1 || delta < 0)
|
||||
{
|
||||
// try to detect when "Restart" is pressed
|
||||
ResetState();
|
||||
#if !DISABLE_LIGHTS || !DISABLE_CAMERA_SHAKE
|
||||
particleTimeUnwrapped = 0;
|
||||
#endif
|
||||
delta = 0;
|
||||
}
|
||||
}
|
||||
#if !DISABLE_LIGHTS || !DISABLE_CAMERA_SHAKE
|
||||
particleTimeUnwrapped += delta;
|
||||
#endif
|
||||
|
||||
if (particleTime != parentParticle.time)
|
||||
{
|
||||
#if !DISABLE_CAMERA_SHAKE
|
||||
if (cameraShake != null && cameraShake.enabled && parentParticle.time < particleTime && parentParticle.time < 0.05f)
|
||||
{
|
||||
cameraShake.StartShake();
|
||||
}
|
||||
#endif
|
||||
#if !DISABLE_LIGHTS || !DISABLE_CAMERA_SHAKE
|
||||
Animate(particleTimeUnwrapped);
|
||||
|
||||
#if !DISABLE_LIGHTS
|
||||
if (!parentParticle.isEmitting)
|
||||
{
|
||||
FadeOut(particleTimeUnwrapped);
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
|
||||
if (particleWasStopped != parentParticle.isStopped)
|
||||
{
|
||||
if (parentParticle.isStopped)
|
||||
{
|
||||
ResetState();
|
||||
}
|
||||
#if !DISABLE_LIGHTS || !DISABLE_CAMERA_SHAKE
|
||||
particleTimeUnwrapped = 0;
|
||||
#endif
|
||||
}
|
||||
|
||||
particleWasStopped = parentParticle.isStopped;
|
||||
particleTime = parentParticle.time;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
#if UNITY_EDITOR
|
||||
[CustomEditor(typeof(CFXR_Effect))]
|
||||
[CanEditMultipleObjects]
|
||||
public class CFXR_Effect_Editor : Editor
|
||||
{
|
||||
bool? lightEditorPreview;
|
||||
bool? shakeEditorPreview;
|
||||
|
||||
GUIStyle _PaddedRoundedRect;
|
||||
GUIStyle PaddedRoundedRect
|
||||
{
|
||||
get
|
||||
{
|
||||
if (_PaddedRoundedRect == null)
|
||||
{
|
||||
_PaddedRoundedRect = new GUIStyle(EditorStyles.helpBox);
|
||||
_PaddedRoundedRect.padding = new RectOffset(4, 4, 4, 4);
|
||||
}
|
||||
return _PaddedRoundedRect;
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnInspectorGUI()
|
||||
{
|
||||
GlobalOptionsGUI();
|
||||
|
||||
#if DISABLE_CAMERA_SHAKE
|
||||
EditorGUILayout.HelpBox("Camera Shake has been globally disabled in the code.\nThe properties remain to avoid data loss but the shaking won't be applied for any effect.", MessageType.Info);
|
||||
#endif
|
||||
|
||||
base.OnInspectorGUI();
|
||||
}
|
||||
|
||||
void GlobalOptionsGUI()
|
||||
{
|
||||
EditorGUILayout.BeginVertical(PaddedRoundedRect);
|
||||
{
|
||||
GUILayout.Label("Editor Preview:", EditorStyles.boldLabel);
|
||||
|
||||
if (lightEditorPreview == null)
|
||||
{
|
||||
lightEditorPreview = EditorPrefs.GetBool("CFXR Light EditorPreview", true);
|
||||
}
|
||||
bool lightPreview = EditorGUILayout.Toggle("Light Animations", lightEditorPreview.Value);
|
||||
if (lightPreview != lightEditorPreview.Value)
|
||||
{
|
||||
lightEditorPreview = lightPreview;
|
||||
EditorPrefs.SetBool("CFXR Light EditorPreview", lightPreview);
|
||||
CFXR_Effect.AnimatedLight.editorPreview = lightPreview;
|
||||
}
|
||||
|
||||
#if !DISABLE_CAMERA_SHAKE
|
||||
if (shakeEditorPreview == null)
|
||||
{
|
||||
shakeEditorPreview = EditorPrefs.GetBool("CFXR CameraShake EditorPreview", true);
|
||||
}
|
||||
bool shakePreview = EditorGUILayout.Toggle("Camera Shake", shakeEditorPreview.Value);
|
||||
if (shakePreview != shakeEditorPreview.Value)
|
||||
{
|
||||
shakeEditorPreview = shakePreview;
|
||||
EditorPrefs.SetBool("CFXR CameraShake EditorPreview", shakePreview);
|
||||
CFXR_Effect.CameraShake.editorPreview = shakePreview;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
EditorGUILayout.EndVertical();
|
||||
}
|
||||
|
||||
void OnEnable()
|
||||
{
|
||||
if (this.targets == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
foreach (var t in this.targets)
|
||||
{
|
||||
var cfxr_effect = t as CFXR_Effect;
|
||||
if (cfxr_effect != null)
|
||||
{
|
||||
if (isPrefabSource(cfxr_effect.gameObject))
|
||||
{
|
||||
return;
|
||||
}
|
||||
cfxr_effect.RegisterEditorUpdate();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void OnDisable()
|
||||
{
|
||||
if (this.targets == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
foreach (var t in this.targets)
|
||||
{
|
||||
// Can be null if GameObject has been destroyed
|
||||
var cfxr_effect = t as CFXR_Effect;
|
||||
if (cfxr_effect != null)
|
||||
{
|
||||
if (isPrefabSource(cfxr_effect.gameObject))
|
||||
{
|
||||
return;
|
||||
}
|
||||
cfxr_effect.UnregisterEditorUpdate();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static bool isPrefabSource(GameObject gameObject)
|
||||
{
|
||||
var assetType = PrefabUtility.GetPrefabAssetType(gameObject);
|
||||
var prefabType = PrefabUtility.GetPrefabInstanceStatus(gameObject);
|
||||
return ((assetType == PrefabAssetType.Regular || assetType == PrefabAssetType.Variant) && prefabType == PrefabInstanceStatus.NotAPrefab);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
;
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 9205bc1bbacc90040a998067b5643d16
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,195 @@
|
||||
using System;
|
||||
using UnityEngine;
|
||||
#if UNITY_EDITOR
|
||||
using UnityEditor;
|
||||
#endif
|
||||
|
||||
namespace CartoonFX
|
||||
{
|
||||
[RequireComponent(typeof(ParticleSystem))]
|
||||
public class CFXR_EmissionBySurface : MonoBehaviour
|
||||
{
|
||||
public bool active = true;
|
||||
public float particlesPerUnit = 10;
|
||||
[Tooltip("This is to avoid slowdowns in the Editor if the value gets too high")] public float maxEmissionRate = 5000;
|
||||
[HideInInspector] public float density = 0;
|
||||
|
||||
bool attachedToEditor;
|
||||
ParticleSystem ps;
|
||||
|
||||
#if UNITY_EDITOR
|
||||
void OnValidate()
|
||||
{
|
||||
this.hideFlags = HideFlags.DontSaveInBuild;
|
||||
CalculateAndUpdateEmission();
|
||||
}
|
||||
|
||||
internal void AttachToEditor()
|
||||
{
|
||||
if (attachedToEditor) return;
|
||||
|
||||
EditorApplication.update += OnEditorUpdate;
|
||||
attachedToEditor = true;
|
||||
}
|
||||
|
||||
internal void DetachFromEditor()
|
||||
{
|
||||
if (!attachedToEditor) return;
|
||||
|
||||
EditorApplication.update -= OnEditorUpdate;
|
||||
attachedToEditor = false;
|
||||
}
|
||||
|
||||
void OnEditorUpdate()
|
||||
{
|
||||
CalculateAndUpdateEmission();
|
||||
|
||||
if (!System.Array.Exists(Selection.gameObjects, item => item == this.gameObject))
|
||||
{
|
||||
DetachFromEditor();
|
||||
}
|
||||
}
|
||||
|
||||
void CalculateAndUpdateEmission()
|
||||
{
|
||||
if (!active) return;
|
||||
if (this == null) return;
|
||||
if (ps == null) ps = this.GetComponent<ParticleSystem>();
|
||||
density = CalculateShapeDensity(ps.shape, ps.main.scalingMode == ParticleSystemScalingMode.Shape, this.transform);
|
||||
if (density == 0) return;
|
||||
float emissionOverTime = density * particlesPerUnit;
|
||||
ParticleSystem.EmissionModule emission = ps.emission;
|
||||
if (Math.Abs(emission.rateOverTime.constant - emissionOverTime) > 0.1f)
|
||||
{
|
||||
emission.rateOverTime = Mathf.Min(maxEmissionRate, emissionOverTime);
|
||||
}
|
||||
}
|
||||
|
||||
float CalculateShapeDensity(ParticleSystem.ShapeModule shapeModule, bool isShapeScaling, Transform transform)
|
||||
{
|
||||
float arcPercentage = Mathf.Max(0.01f, shapeModule.arc / 360f);
|
||||
float thicknessPercentage = Mathf.Max(0.01f, 1.0f - shapeModule.radiusThickness);
|
||||
|
||||
float scaleX = shapeModule.scale.x;
|
||||
float scaleY = shapeModule.scale.y;
|
||||
float scaleZ = shapeModule.scale.z;
|
||||
if (isShapeScaling)
|
||||
{
|
||||
Vector3 localScale = Quaternion.Euler(shapeModule.rotation) * transform.localScale;
|
||||
scaleX = scaleX * localScale.x;
|
||||
scaleY = scaleY * localScale.y;
|
||||
scaleZ = scaleZ * localScale.z;
|
||||
}
|
||||
scaleX = Mathf.Abs(scaleX);
|
||||
scaleY = Mathf.Abs(scaleY);
|
||||
scaleZ = Mathf.Abs(scaleZ);
|
||||
|
||||
switch (shapeModule.shapeType)
|
||||
{
|
||||
case ParticleSystemShapeType.Hemisphere:
|
||||
case ParticleSystemShapeType.Sphere:
|
||||
{
|
||||
float rX = shapeModule.radius * scaleX;
|
||||
float rY = shapeModule.radius * scaleY;
|
||||
float rZ = shapeModule.radius * scaleZ;
|
||||
float rmX = rX * thicknessPercentage;
|
||||
float rmY = rY * thicknessPercentage;
|
||||
float rmZ = rZ * thicknessPercentage;
|
||||
float volume = (rX * rY * rZ - rmX * rmY * rmZ) * Mathf.PI;
|
||||
if (shapeModule.shapeType == ParticleSystemShapeType.Hemisphere)
|
||||
{
|
||||
volume /= 2.0f;
|
||||
}
|
||||
return volume * arcPercentage;
|
||||
}
|
||||
case ParticleSystemShapeType.Cone:
|
||||
{
|
||||
float innerDisk = shapeModule.radius * scaleX * thicknessPercentage * shapeModule.radius * scaleY * thicknessPercentage * Mathf.PI;
|
||||
float outerDisk = shapeModule.radius *scaleX * shapeModule.radius * scaleY * Mathf.PI;
|
||||
return outerDisk - innerDisk;
|
||||
}
|
||||
case ParticleSystemShapeType.ConeVolume:
|
||||
{
|
||||
// cylinder volume, changing the angle doesn't actually extend the area from where the particles are emitted
|
||||
float innerCylinder = shapeModule.radius * scaleX * thicknessPercentage * shapeModule.radius * scaleY * thicknessPercentage * Mathf.PI * shapeModule.length * scaleZ;
|
||||
float outerCylinder = shapeModule.radius * scaleX * shapeModule.radius * scaleY * Mathf.PI * shapeModule.length * scaleZ;
|
||||
return outerCylinder - innerCylinder;
|
||||
}
|
||||
case ParticleSystemShapeType.BoxEdge:
|
||||
case ParticleSystemShapeType.BoxShell:
|
||||
case ParticleSystemShapeType.Box:
|
||||
{
|
||||
return scaleX * scaleY * scaleZ;
|
||||
}
|
||||
case ParticleSystemShapeType.Circle:
|
||||
{
|
||||
float radiusX = shapeModule.radius * scaleX;
|
||||
float radiusY = shapeModule.radius * scaleY;
|
||||
|
||||
float radiusMinX = radiusX * thicknessPercentage;
|
||||
float radiusMinY = radiusY * thicknessPercentage;
|
||||
float area = (radiusX * radiusY - radiusMinX * radiusMinY) * Mathf.PI;
|
||||
return area * arcPercentage;
|
||||
}
|
||||
case ParticleSystemShapeType.SingleSidedEdge:
|
||||
{
|
||||
return shapeModule.radius * scaleX;
|
||||
}
|
||||
case ParticleSystemShapeType.Donut:
|
||||
{
|
||||
float outerDonutVolume = 2 * Mathf.PI * Mathf.PI * shapeModule.donutRadius * shapeModule.donutRadius * shapeModule.radius * arcPercentage;
|
||||
float innerDonutVolume = 2 * Mathf.PI * Mathf.PI * shapeModule.donutRadius * thicknessPercentage * thicknessPercentage * shapeModule.donutRadius * shapeModule.radius * arcPercentage;
|
||||
return (outerDonutVolume - innerDonutVolume) * scaleX * scaleY * scaleZ;
|
||||
}
|
||||
case ParticleSystemShapeType.Rectangle:
|
||||
{
|
||||
return scaleX * scaleY;
|
||||
}
|
||||
case ParticleSystemShapeType.Mesh:
|
||||
case ParticleSystemShapeType.SkinnedMeshRenderer:
|
||||
case ParticleSystemShapeType.MeshRenderer:
|
||||
{
|
||||
Debug.LogWarning( string.Format("[{0}] Calculating volume for a mesh is unsupported.", nameof(CFXR_EmissionBySurface)));
|
||||
this.active = false;
|
||||
return 0;
|
||||
}
|
||||
case ParticleSystemShapeType.Sprite:
|
||||
case ParticleSystemShapeType.SpriteRenderer:
|
||||
{
|
||||
Debug.LogWarning( string.Format("[{0}] Calculating volume for a sprite is unsupported.", nameof(CFXR_EmissionBySurface)));
|
||||
this.active = false;
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
#if UNITY_EDITOR
|
||||
[CustomEditor(typeof(CFXR_EmissionBySurface))]
|
||||
class CFXR_EmissionBySurface_Editor : Editor
|
||||
{
|
||||
CFXR_EmissionBySurface Target { get { return target as CFXR_EmissionBySurface; } }
|
||||
|
||||
public override void OnInspectorGUI()
|
||||
{
|
||||
base.OnInspectorGUI();
|
||||
GUILayout.Space(10);
|
||||
EditorGUILayout.HelpBox("This Editor script will adapt the particle emission based on its shape density, so that you can resize it to fit a specific situation and the overall number of particles won't change.\n\nYou can scale the object to change the emission area, and you can open the 'Shape' module in the Particle System to visualize the emission area.", MessageType.Info);
|
||||
EditorGUILayout.HelpBox("Calculated Density: " + Target.density, MessageType.None);
|
||||
}
|
||||
|
||||
void OnEnable()
|
||||
{
|
||||
Target.AttachToEditor();
|
||||
}
|
||||
|
||||
void OnDisable()
|
||||
{
|
||||
Target.DetachFromEditor();
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 403cb51292a8b3c4c870cccfc0e68659
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,419 @@
|
||||
//--------------------------------------------------------------------------------------------------------------------------------
|
||||
// Cartoon FX
|
||||
// (c) 2012-2025 Jean Moreno
|
||||
//--------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using Object = UnityEngine.Object;
|
||||
#if UNITY_EDITOR
|
||||
using UnityEditor;
|
||||
#endif
|
||||
|
||||
namespace CartoonFX
|
||||
{
|
||||
[RequireComponent(typeof(ParticleSystem))]
|
||||
public class CFXR_ParticleText : MonoBehaviour
|
||||
{
|
||||
[Header("Dynamic")]
|
||||
[Tooltip("Allow changing the text at runtime with the 'UpdateText' method. If disabled, this script will be excluded from the build.")]
|
||||
public bool isDynamic;
|
||||
|
||||
[Header("Text")]
|
||||
[SerializeField] string text;
|
||||
[SerializeField] float size = 1f;
|
||||
[SerializeField] float letterSpacing = 0.44f;
|
||||
|
||||
[Header("Colors")]
|
||||
[SerializeField] Color backgroundColor = new Color(0, 0, 0, 1);
|
||||
[SerializeField] Color color1 = new Color(1, 1, 1, 1);
|
||||
[SerializeField] Color color2 = new Color(0, 0, 1, 1);
|
||||
|
||||
[Header("Delay")]
|
||||
[SerializeField] float delay = 0.05f;
|
||||
[SerializeField] bool cumulativeDelay = false;
|
||||
[Range(0f, 2f)] [SerializeField] float compensateLifetime = 0;
|
||||
|
||||
[Header("Misc")]
|
||||
[SerializeField] float lifetimeMultiplier = 1f;
|
||||
[Range(-90f, 90f)] [SerializeField] float rotation = -5f;
|
||||
[SerializeField] float sortingFudgeOffset = 0.1f;
|
||||
#pragma warning disable 0649
|
||||
[SerializeField] CFXR_ParticleTextFontAsset font;
|
||||
#pragma warning restore 0649
|
||||
|
||||
#if UNITY_EDITOR
|
||||
[HideInInspector] [SerializeField] bool autoUpdateEditor = true;
|
||||
|
||||
void OnValidate()
|
||||
{
|
||||
if (text == null || font == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
// parse text to only allow valid characters
|
||||
List<char> allowed = new List<char>(font.CharSequence.ToCharArray());
|
||||
allowed.Add(' ');
|
||||
|
||||
char[] chars;
|
||||
switch (font.letterCase)
|
||||
{
|
||||
case CFXR_ParticleTextFontAsset.LetterCase.Lower: chars = text.ToLowerInvariant().ToCharArray(); break;
|
||||
case CFXR_ParticleTextFontAsset.LetterCase.Upper: chars = text.ToUpperInvariant().ToCharArray(); break;
|
||||
default:
|
||||
case CFXR_ParticleTextFontAsset.LetterCase.Both: chars = text.ToCharArray(); break;
|
||||
}
|
||||
|
||||
string newText = "";
|
||||
foreach (var c in chars)
|
||||
{
|
||||
if (allowed.Contains(c))
|
||||
{
|
||||
newText += c;
|
||||
}
|
||||
}
|
||||
|
||||
text = newText;
|
||||
|
||||
// prevent negative or 0 size
|
||||
size = Mathf.Max(0.001f, size);
|
||||
|
||||
// delay so that we are allowed to destroy GameObjects
|
||||
if (autoUpdateEditor && !EditorApplication.isPlayingOrWillChangePlaymode)
|
||||
{
|
||||
EditorApplication.delayCall += () => { UpdateText(null); };
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
void Awake()
|
||||
{
|
||||
if (!isDynamic)
|
||||
{
|
||||
Destroy(this);
|
||||
return;
|
||||
}
|
||||
|
||||
InitializeFirstParticle();
|
||||
}
|
||||
|
||||
float baseLifetime;
|
||||
float baseScaleX;
|
||||
float baseScaleY;
|
||||
float baseScaleZ;
|
||||
Vector3 basePivot;
|
||||
|
||||
void InitializeFirstParticle()
|
||||
{
|
||||
if (isDynamic && this.transform.childCount == 0)
|
||||
{
|
||||
throw new System.Exception("[CFXR_ParticleText] A disabled GameObject with a ParticleSystem component is required as the first child when 'isDyanmic' is enabled, so that its settings can be used as a base for the generated characters.");
|
||||
}
|
||||
|
||||
var ps = isDynamic ? this.transform.GetChild(0).GetComponent<ParticleSystem>() : this.GetComponent<ParticleSystem>();
|
||||
var main = ps.main;
|
||||
baseLifetime = main.startLifetime.constant;
|
||||
baseScaleX = main.startSizeXMultiplier;
|
||||
baseScaleY = main.startSizeYMultiplier;
|
||||
baseScaleZ = main.startSizeZMultiplier;
|
||||
basePivot = ps.GetComponent<ParticleSystemRenderer>().pivot;
|
||||
if (isDynamic)
|
||||
{
|
||||
basePivot.x = 0; // make sure to not offset the text horizontally
|
||||
ps.gameObject.SetActive(false); // ensure first child is inactive
|
||||
ps.gameObject.name = "MODEL";
|
||||
}
|
||||
}
|
||||
|
||||
public void UpdateText(
|
||||
string newText = null,
|
||||
float? newSize = null,
|
||||
Color? newColor1 = null, Color? newColor2 = null, Color? newBackgroundColor = null,
|
||||
float? newLifetimeMultiplier = null
|
||||
)
|
||||
{
|
||||
#if UNITY_EDITOR
|
||||
// Only allow updating text for GameObjects that aren't prefabs, since we are possibly destroying/adding GameObjects
|
||||
if (this == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
var prefabInstanceStatus = PrefabUtility.GetPrefabInstanceStatus(this);
|
||||
var prefabAssetType = PrefabUtility.GetPrefabAssetType(this);
|
||||
if (!(prefabInstanceStatus == PrefabInstanceStatus.NotAPrefab && prefabAssetType == PrefabAssetType.NotAPrefab))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (!Application.isPlaying)
|
||||
{
|
||||
InitializeFirstParticle();
|
||||
}
|
||||
#endif
|
||||
|
||||
if (Application.isPlaying && !isDynamic)
|
||||
{
|
||||
throw new System.Exception("[CFXR_ParticleText] You cannot update the text at runtime if it's not marked as dynamic.");
|
||||
}
|
||||
|
||||
if (newText != null)
|
||||
{
|
||||
switch (font.letterCase)
|
||||
{
|
||||
case CFXR_ParticleTextFontAsset.LetterCase.Lower:
|
||||
newText = newText.ToLowerInvariant();
|
||||
break;
|
||||
case CFXR_ParticleTextFontAsset.LetterCase.Upper:
|
||||
newText = newText.ToUpperInvariant();
|
||||
break;
|
||||
}
|
||||
|
||||
// Verify that new text doesn't contain invalid characters
|
||||
foreach (char c in newText)
|
||||
{
|
||||
if (char.IsWhiteSpace(c)) continue;
|
||||
if (font.CharSequence.IndexOf(c) < 0)
|
||||
{
|
||||
throw new System.Exception("[CFXR_ParticleText] Invalid character supplied for the dynamic text: '" + c + "'\nThe allowed characters from the selected font are: " + font.CharSequence);
|
||||
}
|
||||
}
|
||||
|
||||
this.text = newText;
|
||||
}
|
||||
|
||||
if (newSize != null) this.size = newSize.Value;
|
||||
if (newColor1 != null) this.color1 = newColor1.Value;
|
||||
if (newColor2 != null) this.color2 = newColor2.Value;
|
||||
if (newBackgroundColor != null) this.backgroundColor = newBackgroundColor.Value;
|
||||
if (newLifetimeMultiplier != null) this.lifetimeMultiplier = newLifetimeMultiplier.Value;
|
||||
|
||||
if (text == null || font == null || !font.IsValid())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (this.transform.childCount == 0)
|
||||
{
|
||||
throw new System.Exception("[CFXR_ParticleText] A disabled GameObject with a ParticleSystem component is required as the first child when 'isDyanmic' is enabled, so that its settings can be used as a base for the generated characters.");
|
||||
}
|
||||
|
||||
// process text and calculate total width offset
|
||||
float totalWidth = 0f;
|
||||
int charCount = 0;
|
||||
for (int i = 0; i < text.Length; i++)
|
||||
{
|
||||
if (char.IsWhiteSpace(text[i]))
|
||||
{
|
||||
if (i > 0)
|
||||
{
|
||||
totalWidth += letterSpacing * size;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
charCount++;
|
||||
|
||||
if (i > 0)
|
||||
{
|
||||
int index = font.CharSequence.IndexOf(text[i]);
|
||||
var sprite = font.CharSprites[index];
|
||||
float charWidth = sprite.rect.width + font.CharKerningOffsets[index].post + font.CharKerningOffsets[index].pre;
|
||||
totalWidth += (charWidth * 0.01f + letterSpacing) * size;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#if UNITY_EDITOR
|
||||
// delete all children in editor, to make sure we refresh the particle systems based on the first one
|
||||
if (!Application.isPlaying)
|
||||
{
|
||||
int length = this.transform.childCount;
|
||||
int overflow = 0;
|
||||
while (this.transform.childCount > 1)
|
||||
{
|
||||
Object.DestroyImmediate(this.transform.GetChild(this.transform.childCount - 1).gameObject);
|
||||
overflow++;
|
||||
if (overflow > 1000)
|
||||
{
|
||||
// just in case...
|
||||
Debug.LogError("Overflow!");
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
if (charCount > 0)
|
||||
{
|
||||
// calculate needed instances
|
||||
int childCount = this.transform.childCount - (isDynamic ? 1 : 0); // first one is the particle source and always deactivated
|
||||
if (childCount < charCount)
|
||||
{
|
||||
// instantiate new letter GameObjects if needed
|
||||
GameObject model = isDynamic ? this.transform.GetChild(0).gameObject : null;
|
||||
for (int i = childCount; i < charCount; i++)
|
||||
{
|
||||
var newLetter = isDynamic ? Instantiate(model, this.transform) : new GameObject();
|
||||
if (!isDynamic)
|
||||
{
|
||||
newLetter.transform.SetParent(this.transform);
|
||||
newLetter.AddComponent<ParticleSystem>();
|
||||
}
|
||||
|
||||
newLetter.transform.localPosition = Vector3.zero;
|
||||
newLetter.transform.localRotation = Quaternion.identity;
|
||||
}
|
||||
}
|
||||
|
||||
// update each letter
|
||||
float offset = totalWidth / 2f;
|
||||
totalWidth = 0f;
|
||||
int currentChild = isDynamic ? 0 : -1;
|
||||
|
||||
// when not dynamic, we use CopySerialized to propagate the settings to the instances
|
||||
var sourceParticle = isDynamic ? null : this.GetComponent<ParticleSystem>();
|
||||
var sourceParticleRenderer = this.GetComponent<ParticleSystemRenderer>();
|
||||
|
||||
for (int i = 0; i < text.Length; i++)
|
||||
{
|
||||
var letter = text[i];
|
||||
if (char.IsWhiteSpace(letter))
|
||||
{
|
||||
totalWidth += letterSpacing * size;
|
||||
}
|
||||
else
|
||||
{
|
||||
currentChild++;
|
||||
int index = font.CharSequence.IndexOf(text[i]);
|
||||
var sprite = font.CharSprites[index];
|
||||
|
||||
// calculate char particle size ratio
|
||||
var ratio = size * sprite.rect.width / 50f;
|
||||
|
||||
// calculate char position
|
||||
totalWidth += font.CharKerningOffsets[index].pre * 0.01f * size;
|
||||
var position = (totalWidth - offset) / ratio;
|
||||
float charWidth = sprite.rect.width + font.CharKerningOffsets[index].post;
|
||||
totalWidth += (charWidth * 0.01f + letterSpacing) * size;
|
||||
|
||||
// update particle system for this letter
|
||||
var letterObj = this.transform.GetChild(currentChild).gameObject;
|
||||
letterObj.name = letter.ToString();
|
||||
var ps = letterObj.GetComponent<ParticleSystem>();
|
||||
#if UNITY_EDITOR
|
||||
if (!isDynamic)
|
||||
{
|
||||
EditorUtility.CopySerialized(sourceParticle, ps);
|
||||
ps.gameObject.SetActive(true);
|
||||
}
|
||||
#endif
|
||||
|
||||
var mainModule = ps.main;
|
||||
mainModule.startSizeXMultiplier = baseScaleX * ratio;
|
||||
mainModule.startSizeYMultiplier = baseScaleY * ratio;
|
||||
mainModule.startSizeZMultiplier = baseScaleZ * ratio;
|
||||
|
||||
ps.textureSheetAnimation.SetSprite(0, sprite);
|
||||
|
||||
mainModule.startRotation = Mathf.Deg2Rad * rotation;
|
||||
mainModule.startColor = backgroundColor;
|
||||
|
||||
var customData = ps.customData;
|
||||
customData.enabled = true;
|
||||
customData.SetColor(ParticleSystemCustomData.Custom1, color1);
|
||||
customData.SetColor(ParticleSystemCustomData.Custom2, color2);
|
||||
|
||||
if (cumulativeDelay)
|
||||
{
|
||||
mainModule.startDelay = delay * i;
|
||||
mainModule.startLifetime = Mathf.LerpUnclamped(baseLifetime, baseLifetime + (delay * (text.Length - i)), compensateLifetime / lifetimeMultiplier);
|
||||
}
|
||||
else
|
||||
{
|
||||
mainModule.startDelay = delay;
|
||||
}
|
||||
|
||||
mainModule.startLifetime = mainModule.startLifetime.constant * lifetimeMultiplier;
|
||||
|
||||
// particle system renderer parameters
|
||||
var particleRenderer = ps.GetComponent<ParticleSystemRenderer>();
|
||||
#if UNITY_EDITOR
|
||||
if (!isDynamic)
|
||||
{
|
||||
EditorUtility.CopySerialized(sourceParticleRenderer, particleRenderer);
|
||||
}
|
||||
#endif
|
||||
|
||||
particleRenderer.enabled = true;
|
||||
particleRenderer.pivot = new Vector3(basePivot.x + position, basePivot.y, basePivot.z);
|
||||
particleRenderer.sortingFudge += i * sortingFudgeOffset;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// set active state for needed letters only
|
||||
for (int i = 1, l = this.transform.childCount; i < l; i++)
|
||||
{
|
||||
this.transform.GetChild(i).gameObject.SetActive(i <= charCount);
|
||||
}
|
||||
|
||||
#if UNITY_EDITOR
|
||||
// automatically play the effect in Editor
|
||||
if (!Application.isPlaying)
|
||||
{
|
||||
this.GetComponent<ParticleSystem>().Clear(true);
|
||||
this.GetComponent<ParticleSystem>().Play(true);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
#if UNITY_EDITOR
|
||||
[CustomEditor(typeof(CFXR_ParticleText))]
|
||||
public class ParticleTextEditor : Editor
|
||||
{
|
||||
CFXR_ParticleText CastTarget
|
||||
{
|
||||
get { return (CFXR_ParticleText) this.target; }
|
||||
}
|
||||
|
||||
GUIContent GUIContent_AutoUpdateToggle = new GUIContent("Auto-update", "Automatically regenerate the text when a property is changed.");
|
||||
GUIContent GUIContent_UpdateTextButton = new GUIContent(" Update Text ", "Regenerate the text and create new letter GameObjects if needed.");
|
||||
|
||||
public override void OnInspectorGUI()
|
||||
{
|
||||
var prefab = PrefabUtility.GetPrefabInstanceStatus(target);
|
||||
if (prefab != PrefabInstanceStatus.NotAPrefab)
|
||||
{
|
||||
EditorGUILayout.HelpBox("Cartoon FX Particle Text doesn't work on Prefab Instances, as it needs to destroy/create children GameObjects.\nYou can right-click on the object, and select \"Unpack Prefab\" to make it an independent Game Object.",
|
||||
MessageType.Warning);
|
||||
return;
|
||||
}
|
||||
|
||||
base.OnInspectorGUI();
|
||||
|
||||
serializedObject.Update();
|
||||
SerializedProperty autoUpdateBool = serializedObject.FindProperty("autoUpdateEditor");
|
||||
|
||||
GUILayout.Space(8);
|
||||
GUILayout.BeginHorizontal();
|
||||
{
|
||||
GUILayout.FlexibleSpace();
|
||||
autoUpdateBool.boolValue = GUILayout.Toggle(autoUpdateBool.boolValue, GUIContent_AutoUpdateToggle, GUILayout.Height(30));
|
||||
if (GUILayout.Button(GUIContent_UpdateTextButton, GUILayout.Height(30)))
|
||||
{
|
||||
CastTarget.UpdateText(null);
|
||||
}
|
||||
}
|
||||
GUILayout.EndHorizontal();
|
||||
|
||||
if (GUI.changed)
|
||||
{
|
||||
serializedObject.ApplyModifiedProperties();
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 03c8102322ad0d04fa6ae3f17887e967
|
||||
timeCreated: 1535104615
|
||||
licenseType: Store
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,128 @@
|
||||
//--------------------------------------------------------------------------------------------------------------------------------
|
||||
// Cartoon FX
|
||||
// (c) 2012-2025 Jean Moreno
|
||||
//--------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
#if UNITY_EDITOR
|
||||
using UnityEditor;
|
||||
#endif
|
||||
|
||||
namespace CartoonFX
|
||||
{
|
||||
public class CFXR_ParticleTextFontAsset : ScriptableObject
|
||||
{
|
||||
public enum LetterCase
|
||||
{
|
||||
Both,
|
||||
Upper,
|
||||
Lower
|
||||
}
|
||||
|
||||
public string CharSequence = "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!?-.#@$ ";
|
||||
public LetterCase letterCase = LetterCase.Upper;
|
||||
public Sprite[] CharSprites;
|
||||
public Kerning[] CharKerningOffsets;
|
||||
|
||||
[System.Serializable]
|
||||
public class Kerning
|
||||
{
|
||||
public string name = "A";
|
||||
public float pre = 0f;
|
||||
public float post = 0f;
|
||||
}
|
||||
|
||||
void OnValidate()
|
||||
{
|
||||
this.hideFlags = HideFlags.None;
|
||||
|
||||
if (CharKerningOffsets == null || CharKerningOffsets.Length != CharSequence.Length)
|
||||
{
|
||||
CharKerningOffsets = new Kerning[CharSequence.Length];
|
||||
for (int i = 0; i < CharKerningOffsets.Length; i++)
|
||||
{
|
||||
CharKerningOffsets[i] = new Kerning() { name = CharSequence[i].ToString() };
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public bool IsValid()
|
||||
{
|
||||
bool valid = !string.IsNullOrEmpty(CharSequence) && CharSprites != null && CharSprites.Length == CharSequence.Length && CharKerningOffsets != null && CharKerningOffsets.Length == CharSprites.Length;
|
||||
|
||||
if (!valid)
|
||||
{
|
||||
Debug.LogError(string.Format("Invalid ParticleTextFontAsset: '{0}'\n", this.name), this);
|
||||
}
|
||||
|
||||
return valid;
|
||||
}
|
||||
|
||||
#if UNITY_EDITOR
|
||||
// [MenuItem("Tools/Create font asset")]
|
||||
static void CreateFontAsset()
|
||||
{
|
||||
var instance = CreateInstance<CFXR_ParticleTextFontAsset>();
|
||||
AssetDatabase.CreateAsset(instance, "Assets/Font.asset");
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
#if UNITY_EDITOR
|
||||
[CustomEditor(typeof(CFXR_ParticleTextFontAsset))]
|
||||
public class ParticleTextFontAssetEditor : Editor
|
||||
{
|
||||
public override void OnInspectorGUI()
|
||||
{
|
||||
base.OnInspectorGUI();
|
||||
|
||||
GUILayout.BeginHorizontal();
|
||||
if (GUILayout.Button("Export Kerning"))
|
||||
{
|
||||
var ptfa = this.target as CFXR_ParticleTextFontAsset;
|
||||
var path = EditorUtility.SaveFilePanel("Export Kerning Settings", Application.dataPath, ptfa.name + " kerning", ".txt");
|
||||
if (!string.IsNullOrEmpty(path))
|
||||
{
|
||||
string output = "";
|
||||
foreach (var k in ptfa.CharKerningOffsets)
|
||||
{
|
||||
output += k.name + "\t" + k.pre + "\t" + k.post + "\n";
|
||||
}
|
||||
System.IO.File.WriteAllText(path, output);
|
||||
}
|
||||
}
|
||||
|
||||
if (GUILayout.Button("Import Kerning"))
|
||||
{
|
||||
var path = EditorUtility.OpenFilePanel("Import Kerning Settings", Application.dataPath, "txt");
|
||||
if (!string.IsNullOrEmpty(path))
|
||||
{
|
||||
var text = System.IO.File.ReadAllText(path);
|
||||
var split = text.Split(new string[] { "\n" }, System.StringSplitOptions.RemoveEmptyEntries);
|
||||
var ptfa = this.target as CFXR_ParticleTextFontAsset;
|
||||
Undo.RecordObject(ptfa, "Import Kerning Settings");
|
||||
List<CFXR_ParticleTextFontAsset.Kerning> kerningList = new List<CFXR_ParticleTextFontAsset.Kerning>(ptfa.CharKerningOffsets);
|
||||
for (int i = 0; i < split.Length; i++)
|
||||
{
|
||||
var data = split[i].Split('\t');
|
||||
|
||||
foreach (var cko in kerningList)
|
||||
{
|
||||
if (cko.name == data[0])
|
||||
{
|
||||
cko.pre = float.Parse(data[1]);
|
||||
cko.post = float.Parse(data[2]);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
ptfa.CharKerningOffsets = kerningList.ToArray();
|
||||
}
|
||||
}
|
||||
GUILayout.EndHorizontal();
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
fileFormatVersion: 2
|
||||
guid: ffbf5f8b3f8ff3e49bbbf5495becc6b3
|
||||
timeCreated: 1535104615
|
||||
licenseType: Store
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: e1c685d607534374fb2c655f005e9aef
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,181 @@
|
||||
//--------------------------------------------------------------------------------------------------------------------------------
|
||||
// Cartoon FX
|
||||
// (c) 2012-2020 Jean Moreno
|
||||
//--------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
Shader "Cartoon FX/Remaster/Particle Screen Distortion"
|
||||
{
|
||||
Properties
|
||||
{
|
||||
[Toggle(_ALPHATEST_ON)] _UseAlphaClip ("Alpha Clipping (Cutout)", Float) = 0
|
||||
//# IF_KEYWORD _ALPHATEST_ON
|
||||
_Cutoff ("Cutoff Threshold", Range(0.001,1)) = 0.1
|
||||
//# END_IF
|
||||
|
||||
//# --------------------------------------------------------
|
||||
|
||||
[Toggle(_FADING_ON)] _UseSP ("Soft Particles", Float) = 0
|
||||
//# IF_KEYWORD _FADING_ON
|
||||
_SoftParticlesFadeDistanceNear ("Near Fade", Float) = 0
|
||||
_SoftParticlesFadeDistanceFar ("Far Fade", Float) = 1
|
||||
//# END_IF
|
||||
|
||||
//#
|
||||
|
||||
[Toggle(_CFXR_EDGE_FADING)] _UseEF ("Edge Fade", Float) = 0
|
||||
//# IF_KEYWORD _CFXR_EDGE_FADING
|
||||
_EdgeFadePow ("Edge Fade Power", Float) = 1
|
||||
//# END_IF
|
||||
|
||||
//# ========================================================
|
||||
//# Texture
|
||||
//#
|
||||
[NoScaleOffset] _ScreenDistortionTex ("Distortion Texture", 2D) = "bump" {}
|
||||
_ScreenDistortionScale ("Distortion Scale", Range(-0.5, 0.5)) = 0.1
|
||||
|
||||
//# ========================================================
|
||||
//# Debug
|
||||
//#
|
||||
|
||||
[Toggle(_DEBUG_VISUALIZE_DISTORTION)] _DebugVisualize ("Visualize Distortion Particles", Float) = 0
|
||||
}
|
||||
|
||||
Category
|
||||
{
|
||||
Tags
|
||||
{
|
||||
"Queue"="Transparent"
|
||||
"IgnoreProjector"="True"
|
||||
"RenderType"="Transparent"
|
||||
"PreviewType"="Plane"
|
||||
}
|
||||
|
||||
Blend SrcAlpha OneMinusSrcAlpha, One One
|
||||
ZWrite Off
|
||||
Cull Off
|
||||
|
||||
/*** URP ***/
|
||||
//====================================================================================================================================
|
||||
// Universal Rendering Pipeline
|
||||
|
||||
Subshader
|
||||
{
|
||||
Pass
|
||||
{
|
||||
Name "BASE_URP"
|
||||
Tags { "LightMode"="UniversalForward" }
|
||||
|
||||
CGPROGRAM
|
||||
|
||||
#pragma vertex vertex_program
|
||||
#pragma fragment fragment_program
|
||||
|
||||
#pragma target 2.0
|
||||
|
||||
// #pragma multi_compile_instancing
|
||||
// #pragma instancing_options procedural:ParticleInstancingSetup
|
||||
|
||||
#pragma multi_compile_fog
|
||||
//#pragma multi_compile_fwdbase
|
||||
//#pragma multi_compile SHADOWS_SCREEN
|
||||
|
||||
// Using the same keywords as Unity's Standard Particle shader to minimize project-wide keyword usage
|
||||
#pragma shader_feature_local _ _FADING_ON
|
||||
#pragma shader_feature_local_fragment _ _ALPHATEST_ON
|
||||
#pragma shader_feature_local _ _DEBUG_VISUALIZE_DISTORTION
|
||||
|
||||
#define CFXR_URP
|
||||
#define CFXR_SCREEN_DISTORTION_SHADER
|
||||
#include "CFXR_PASSES.cginc"
|
||||
|
||||
ENDCG
|
||||
}
|
||||
|
||||
// Same as above with 'Universal2D' instead and DISABLE_SOFT_PARTICLES keyword
|
||||
Pass
|
||||
{
|
||||
Name "BASE_URP"
|
||||
Tags { "LightMode"="Universal2D" }
|
||||
|
||||
CGPROGRAM
|
||||
|
||||
#pragma vertex vertex_program
|
||||
#pragma fragment fragment_program
|
||||
|
||||
#pragma target 2.0
|
||||
|
||||
// #pragma multi_compile_instancing
|
||||
// #pragma instancing_options procedural:ParticleInstancingSetup
|
||||
|
||||
#pragma multi_compile_fog
|
||||
//#pragma multi_compile_fwdbase
|
||||
//#pragma multi_compile SHADOWS_SCREEN
|
||||
|
||||
// Using the same keywords as Unity's Standard Particle shader to minimize project-wide keyword usage
|
||||
#pragma shader_feature_local _ _FADING_ON
|
||||
#pragma shader_feature_local_fragment _ _ALPHATEST_ON
|
||||
#pragma shader_feature_local _ _DEBUG_VISUALIZE_DISTORTION
|
||||
|
||||
#define _CameraOpaqueTexture _CameraSortingLayerTexture
|
||||
#define CFXR_URP
|
||||
#define DISABLE_SOFT_PARTICLES
|
||||
#define CFXR_SCREEN_DISTORTION_SHADER
|
||||
#include "CFXR_PASSES.cginc"
|
||||
|
||||
ENDCG
|
||||
}
|
||||
}
|
||||
/*** END URP ***/
|
||||
|
||||
/*** BIRP ***/
|
||||
//====================================================================================================================================
|
||||
// Built-in Rendering Pipeline
|
||||
|
||||
SubShader
|
||||
{
|
||||
GrabPass
|
||||
{
|
||||
Tags { "LightMode" = "Always" }
|
||||
"_GrabTexture"
|
||||
}
|
||||
|
||||
Pass
|
||||
{
|
||||
Name "BASE"
|
||||
Tags { "LightMode"="ForwardBase" }
|
||||
|
||||
CGPROGRAM
|
||||
|
||||
#pragma vertex vertex_program
|
||||
#pragma fragment fragment_program
|
||||
|
||||
//vertInstancingSetup writes to global, not allowed with DXC
|
||||
// #pragma never_use_dxc
|
||||
// #pragma target 2.5
|
||||
// #pragma multi_compile_instancing
|
||||
// #pragma instancing_options procedural:vertInstancingSetup
|
||||
|
||||
#pragma multi_compile_particles
|
||||
#pragma multi_compile_fog
|
||||
//#pragma multi_compile_fwdbase
|
||||
//#pragma multi_compile SHADOWS_SCREEN
|
||||
|
||||
// Using the same keywords as Unity's Standard Particle shader to minimize project-wide keyword usage
|
||||
#pragma shader_feature_local _ _FADING_ON
|
||||
#pragma shader_feature_local_fragment _ _ALPHATEST_ON
|
||||
#pragma shader_feature_local _ _DEBUG_VISUALIZE_DISTORTION
|
||||
|
||||
#include "UnityStandardParticleInstancing.cginc"
|
||||
|
||||
#define CFXR_SCREEN_DISTORTION_SHADER
|
||||
#include "CFXR_PASSES.cginc"
|
||||
|
||||
ENDCG
|
||||
}
|
||||
}
|
||||
/*** END BIRP ***/
|
||||
}
|
||||
|
||||
CustomEditor "CartoonFX.MaterialInspector"
|
||||
}
|
||||
|
||||
@@ -0,0 +1,48 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 304630dc6079b47419e5333f284382fd
|
||||
ScriptedImporter:
|
||||
internalIDToNameTable: []
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
script: {fileID: 11500000, guid: fe56ec25963759b49955809beeb4324b, type: 3}
|
||||
detectedRenderPipeline: Built-In Render Pipeline
|
||||
strippedLinesCount: 70
|
||||
shaderSourceCode: "//--------------------------------------------------------------------------------------------------------------------------------\r\n//
|
||||
Cartoon FX\r\n// (c) 2012-2020 Jean Moreno\r\n//--------------------------------------------------------------------------------------------------------------------------------\r\n\r\nShader
|
||||
\"Cartoon FX/Remaster/Particle Screen Distortion NEW\"\r\n{\r\n\tProperties\r\n\t{
|
||||
\r\n\t\t[Toggle(_ALPHATEST_ON)] _UseAlphaClip (\"Alpha Clipping (Cutout)\", Float)
|
||||
= 0\r\n\t//# IF_KEYWORD _ALPHATEST_ON\r\n\t\t_Cutoff (\"Cutoff Threshold\", Range(0.001,1))
|
||||
= 0.1\r\n\t//# END_IF\r\n\t\r\n\t//# --------------------------------------------------------\r\n\t\r\n\t\t[Toggle(_FADING_ON)]
|
||||
_UseSP (\"Soft Particles\", Float) = 0\r\n\t//# IF_KEYWORD _FADING_ON\r\n\t\t_SoftParticlesFadeDistanceNear
|
||||
(\"Near Fade\", Float) = 0\r\n\t\t_SoftParticlesFadeDistanceFar (\"Far Fade\",
|
||||
Float) = 1\r\n\t//# END_IF\r\n\r\n\t//# \r\n\r\n\t\t[Toggle(_CFXR_EDGE_FADING)]
|
||||
_UseEF (\"Edge Fade\", Float) = 0\r\n\t//# IF_KEYWORD _CFXR_EDGE_FADING\r\n\t\t_EdgeFadePow
|
||||
(\"Edge Fade Power\", Float) = 1\r\n\t//# END_IF\r\n\r\n\t//# ========================================================\r\n\t//#
|
||||
Texture\r\n\t//#\r\n\t\t[NoScaleOffset] _ScreenDistortionTex (\"Distortion Texture\",
|
||||
2D) = \"bump\" {}\r\n\t\t_ScreenDistortionScale (\"Distortion Scale\", Range(-0.5,
|
||||
0.5)) = 0.1\r\n\t\t\r\n\t//# ========================================================\r\n\t//#
|
||||
Debug\r\n\t//# \r\n\t\t\r\n\t\t[Toggle(_DEBUG_VISUALIZE_DISTORTION)] _DebugVisualize
|
||||
(\"Visualize Distortion Particles\", Float) = 0 \r\n\t}\r\n\t\r\n\tCategory\r\n\t{\r\n\t\tTags\r\n\t\t{\r\n\t\t\t\"Queue\"=\"Transparent\"\r\n\t\t\t\"IgnoreProjector\"=\"True\"\r\n\t\t\t\"RenderType\"=\"Transparent\"\r\n\t\t\t\"PreviewType\"=\"Plane\"\r\n\t\t}\r\n\r\n\t\tBlend
|
||||
SrcAlpha OneMinusSrcAlpha, One One\r\n\t\tZWrite Off\r\n\t\tCull Off\r\n\r\n\r\n\t\t//====================================================================================================================================\r\n\t\t//
|
||||
Built-in Rendering Pipeline\r\n\r\n\t\tSubShader\r\n\t\t{\r\n\t\t\tGrabPass\r\n\t\t\t{\r\n\t\t\t\tTags
|
||||
{ \"LightMode\" = \"Always\" }\r\n\t\t\t\t\"_GrabTexture\"\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tPass\r\n\t\t\t{\r\n\t\t\t\tName
|
||||
\"BASE\"\r\n\t\t\t\tTags { \"LightMode\"=\"ForwardBase\" }\r\n\r\n\t\t\t\tCGPROGRAM\r\n\r\n\t\t\t\t#pragma
|
||||
vertex vertex_program\r\n\t\t\t\t#pragma fragment fragment_program\r\n\r\n\t\t\t\t//vertInstancingSetup
|
||||
writes to global, not allowed with DXC\r\n\t\t\t\t// #pragma never_use_dxc\r\n\t\t\t\t//
|
||||
#pragma target 2.5\r\n\t\t\t\t// #pragma multi_compile_instancing\r\n\t\t\t\t//
|
||||
#pragma instancing_options procedural:vertInstancingSetup\r\n\r\n\t\t\t\t#pragma
|
||||
multi_compile_particles\r\n\t\t\t\t#pragma multi_compile_fog\r\n\t\t\t\t//#pragma
|
||||
multi_compile_fwdbase\r\n\t\t\t\t//#pragma multi_compile SHADOWS_SCREEN\r\n\t\t\t\t\r\n\t\t\t\t//
|
||||
Using the same keywords as Unity's Standard Particle shader to minimize project-wide
|
||||
keyword usage\r\n\t\t\t\t#pragma shader_feature_local _ _FADING_ON\r\n\t\t\t\t#pragma
|
||||
shader_feature_local _ _ALPHATEST_ON\r\n\t\t\t\t#pragma shader_feature_local
|
||||
_ _DEBUG_VISUALIZE_DISTORTION\r\n\r\n\t\t\t\t#include \"UnityStandardParticleInstancing.cginc\"\r\n\r\n\t\t\t\t#define
|
||||
CFXR_SCREEN_DISTORTION_SHADER\r\n\t\t\t\t#include \"CFXR_PASSES.cginc\"\r\n\r\n\t\t\t\tENDCG\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\tCustomEditor
|
||||
\"CartoonFX.MaterialInspector\"\r\n}\r\n\r\n"
|
||||
shaderName: Cartoon FX/Remaster/Particle Screen Distortion NEW
|
||||
shaderErrors: []
|
||||
variantCount: 64
|
||||
variantCountUsed: 2
|
||||
@@ -0,0 +1,275 @@
|
||||
//--------------------------------------------------------------------------------------------------------------------------------
|
||||
// Cartoon FX
|
||||
// (c) 2012-2020 Jean Moreno
|
||||
//--------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
Shader "Cartoon FX/Remaster/Particle Procedural Glow"
|
||||
{
|
||||
Properties
|
||||
{
|
||||
//# Blending
|
||||
//#
|
||||
|
||||
[Enum(UnityEngine.Rendering.BlendMode)] _SrcBlend ("Blend Source", Float) = 5
|
||||
[Enum(UnityEngine.Rendering.BlendMode)] _DstBlend ("Blend Destination", Float) = 10
|
||||
|
||||
//# --------------------------------------------------------
|
||||
|
||||
[Toggle(_CFXR_DISSOLVE)] _UseDissolve ("Enable Dissolve", Float) = 0
|
||||
//# IF_KEYWORD _CFXR_DISSOLVE
|
||||
[NoScaleOffset] _DissolveTex ("Dissolve Texture", 2D) = "gray" {}
|
||||
_DissolveSmooth ("Dissolve Smoothing", Range(0.0001,0.5)) = 0.1
|
||||
[ToggleNoKeyword] _InvertDissolveTex ("Invert Dissolve Texture", Float) = 0
|
||||
//# END_IF
|
||||
|
||||
//# --------------------------------------------------------
|
||||
|
||||
//# Procedural Circle
|
||||
//#
|
||||
|
||||
[KeywordEnum(P0, P2, P4, P8)] _CFXR_GLOW_POW ("Apply Power of", Float) = 0
|
||||
_GlowMin ("Circle Min", Float) = 0
|
||||
_GlowMax ("Circle Max", Float) = 1
|
||||
//#
|
||||
_MaxValue ("Max Value", Float) = 10
|
||||
|
||||
//# --------------------------------------------------------
|
||||
|
||||
_HdrMultiply ("HDR Multiplier", Float) = 2
|
||||
|
||||
//# --------------------------------------------------------
|
||||
|
||||
[Toggle(_FADING_ON)] _UseSP ("Soft Particles", Float) = 0
|
||||
//# IF_KEYWORD _FADING_ON
|
||||
_SoftParticlesFadeDistanceNear ("Near Fade", Float) = 0
|
||||
_SoftParticlesFadeDistanceFar ("Far Fade", Float) = 1
|
||||
//# END_IF
|
||||
|
||||
//# ========================================================
|
||||
//# Shadows
|
||||
//#
|
||||
|
||||
[KeywordEnum(Off,On,CustomTexture)] _CFXR_DITHERED_SHADOWS ("Dithered Shadows", Float) = 0
|
||||
//# IF_KEYWORD _CFXR_DITHERED_SHADOWS_ON || _CFXR_DITHERED_SHADOWS_CUSTOMTEXTURE
|
||||
_ShadowStrength ("Shadows Strength Max", Range(0,1)) = 1.0
|
||||
//# IF_KEYWORD _CFXR_DITHERED_SHADOWS_CUSTOMTEXTURE
|
||||
_DitherCustom ("Dithering 3D Texture", 3D) = "black" {}
|
||||
//# END_IF
|
||||
//# END_IF
|
||||
}
|
||||
|
||||
Category
|
||||
{
|
||||
Tags
|
||||
{
|
||||
"Queue"="Transparent"
|
||||
"IgnoreProjector"="True"
|
||||
"RenderType"="Transparent"
|
||||
"PreviewType"="Plane"
|
||||
}
|
||||
Blend [_SrcBlend] [_DstBlend], One One
|
||||
Cull Off
|
||||
ZWrite Off
|
||||
|
||||
/*** URP ***/
|
||||
//====================================================================================================================================
|
||||
// Universal Rendering Pipeline
|
||||
|
||||
SubShader
|
||||
{
|
||||
Pass
|
||||
{
|
||||
Name "BASE"
|
||||
Tags { "LightMode"="UniversalForward" }
|
||||
|
||||
CGPROGRAM
|
||||
|
||||
#pragma vertex vertex_program
|
||||
#pragma fragment fragment_program
|
||||
|
||||
#pragma target 2.0
|
||||
|
||||
// #pragma multi_compile_instancing
|
||||
// #pragma instancing_options procedural:ParticleInstancingSetup
|
||||
#pragma multi_compile_fog
|
||||
|
||||
#pragma shader_feature_local _ _CFXR_GLOW_POW_P2 _CFXR_GLOW_POW_P4 _CFXR_GLOW_POW_P8
|
||||
#pragma shader_feature_local _ _CFXR_DISSOLVE
|
||||
|
||||
#pragma shader_feature_local _FADING_ON
|
||||
#pragma shader_feature_local_fragment _ _ALPHATEST_ON
|
||||
#pragma shader_feature_local_fragment _ _ALPHABLEND_ON _ALPHAPREMULTIPLY_ON _ALPHAMODULATE_ON _CFXR_ADDITIVE
|
||||
|
||||
#define CFXR_URP
|
||||
#define CFXR_GLOW_SHADER
|
||||
#include "CFXR_PASSES.cginc"
|
||||
|
||||
ENDCG
|
||||
}
|
||||
|
||||
// Same as above with 'Universal2D' instead and DISABLE_SOFT_PARTICLES keyword
|
||||
Pass
|
||||
{
|
||||
Name "BASE"
|
||||
Tags { "LightMode"="Universal2D" }
|
||||
|
||||
CGPROGRAM
|
||||
|
||||
#pragma vertex vertex_program
|
||||
#pragma fragment fragment_program
|
||||
|
||||
#pragma target 2.0
|
||||
|
||||
// #pragma multi_compile_instancing
|
||||
// #pragma instancing_options procedural:ParticleInstancingSetup
|
||||
#pragma multi_compile_fog
|
||||
|
||||
#pragma shader_feature_local _ _CFXR_GLOW_POW_P2 _CFXR_GLOW_POW_P4 _CFXR_GLOW_POW_P8
|
||||
#pragma shader_feature_local _ _CFXR_DISSOLVE
|
||||
|
||||
#pragma shader_feature_local _FADING_ON
|
||||
#pragma shader_feature_local_fragment _ _ALPHATEST_ON
|
||||
#pragma shader_feature_local_fragment _ _ALPHABLEND_ON _ALPHAPREMULTIPLY_ON _ALPHAMODULATE_ON _CFXR_ADDITIVE
|
||||
|
||||
#define CFXR_URP
|
||||
#define DISABLE_SOFT_PARTICLES
|
||||
#define CFXR_GLOW_SHADER
|
||||
#include "CFXR_PASSES.cginc"
|
||||
|
||||
ENDCG
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
Pass
|
||||
{
|
||||
Name "ShadowCaster"
|
||||
Tags { "LightMode" = "ShadowCaster" }
|
||||
|
||||
BlendOp Add
|
||||
Blend One Zero
|
||||
ZWrite On
|
||||
Cull Off
|
||||
|
||||
CGPROGRAM
|
||||
|
||||
#pragma vertex vertex_program
|
||||
#pragma fragment fragment_program
|
||||
|
||||
#pragma shader_feature_local _ _CFXR_GLOW_POW_P2 _CFXR_GLOW_POW_P4 _CFXR_GLOW_POW_P8
|
||||
#pragma shader_feature_local _ _CFXR_DISSOLVE
|
||||
|
||||
#pragma shader_feature_local _FADING_ON
|
||||
#pragma shader_feature_local_fragment _ _ALPHATEST_ON
|
||||
#pragma shader_feature_local_fragment _ _ALPHABLEND_ON _ALPHAPREMULTIPLY_ON _ALPHAMODULATE_ON _CFXR_ADDITIVE
|
||||
|
||||
#pragma multi_compile_shadowcaster
|
||||
#pragma shader_feature_local _ _CFXR_DITHERED_SHADOWS_ON _CFXR_DITHERED_SHADOWS_CUSTOMTEXTURE
|
||||
|
||||
#if (_CFXR_DITHERED_SHADOWS_ON || _CFXR_DITHERED_SHADOWS_CUSTOMTEXTURE) && !defined(SHADER_API_GLES)
|
||||
#pragma target 3.0 //needed for VPOS
|
||||
#endif
|
||||
|
||||
#define CFXR_URP
|
||||
#define PASS_SHADOW_CASTER
|
||||
#define CFXR_GLOW_SHADER
|
||||
#include "CFXR_PASSES.cginc"
|
||||
|
||||
ENDCG
|
||||
}
|
||||
}
|
||||
|
||||
/*** END URP ***/
|
||||
|
||||
/*** BIRP ***/
|
||||
//====================================================================================================================================
|
||||
// Built-in Rendering Pipeline
|
||||
|
||||
SubShader
|
||||
{
|
||||
Pass
|
||||
{
|
||||
Name "BASE"
|
||||
Tags { "LightMode"="ForwardBase" }
|
||||
|
||||
CGPROGRAM
|
||||
|
||||
#pragma vertex vertex_program
|
||||
#pragma fragment fragment_program
|
||||
|
||||
//vertInstancingSetup writes to global, not allowed with DXC
|
||||
// #pragma never_use_dxc
|
||||
// #pragma target 2.5
|
||||
// #pragma multi_compile_instancing
|
||||
// #pragma instancing_options procedural:vertInstancingSetup
|
||||
|
||||
#pragma multi_compile_particles
|
||||
#pragma multi_compile_fog
|
||||
|
||||
#pragma shader_feature_local _ _CFXR_GLOW_POW_P2 _CFXR_GLOW_POW_P4 _CFXR_GLOW_POW_P8
|
||||
#pragma shader_feature_local _ _CFXR_DISSOLVE
|
||||
|
||||
#pragma shader_feature_local _FADING_ON
|
||||
#pragma shader_feature_local_fragment _ _ALPHATEST_ON
|
||||
#pragma shader_feature_local_fragment _ _ALPHABLEND_ON _ALPHAPREMULTIPLY_ON _ALPHAMODULATE_ON _CFXR_ADDITIVE
|
||||
|
||||
#include "UnityStandardParticleInstancing.cginc"
|
||||
|
||||
#define CFXR_GLOW_SHADER
|
||||
#include "CFXR_PASSES.cginc"
|
||||
|
||||
ENDCG
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
Pass
|
||||
{
|
||||
Name "ShadowCaster"
|
||||
Tags { "LightMode" = "ShadowCaster" }
|
||||
|
||||
BlendOp Add
|
||||
Blend One Zero
|
||||
ZWrite On
|
||||
Cull Off
|
||||
|
||||
CGPROGRAM
|
||||
|
||||
#pragma vertex vertex_program
|
||||
#pragma fragment fragment_program
|
||||
|
||||
//vertInstancingSetup writes to global, not allowed with DXC
|
||||
// #pragma never_use_dxc
|
||||
// #pragma target 2.5
|
||||
// #pragma multi_compile_instancing
|
||||
// #pragma instancing_options procedural:vertInstancingSetup
|
||||
|
||||
#pragma shader_feature_local _ _CFXR_GLOW_POW_P2 _CFXR_GLOW_POW_P4 _CFXR_GLOW_POW_P8
|
||||
#pragma shader_feature_local _ _CFXR_DISSOLVE
|
||||
|
||||
#pragma shader_feature_local _FADING_ON
|
||||
#pragma shader_feature_local_fragment _ _ALPHATEST_ON
|
||||
#pragma shader_feature_local_fragment _ _ALPHABLEND_ON _ALPHAPREMULTIPLY_ON _ALPHAMODULATE_ON _CFXR_ADDITIVE
|
||||
|
||||
#pragma multi_compile_shadowcaster
|
||||
#pragma shader_feature_local _ _CFXR_DITHERED_SHADOWS_ON _CFXR_DITHERED_SHADOWS_CUSTOMTEXTURE
|
||||
|
||||
#if (_CFXR_DITHERED_SHADOWS_ON || _CFXR_DITHERED_SHADOWS_CUSTOMTEXTURE) && !defined(SHADER_API_GLES)
|
||||
#pragma target 3.0 //needed for VPOS
|
||||
#endif
|
||||
|
||||
#include "UnityStandardParticleInstancing.cginc"
|
||||
|
||||
#define PASS_SHADOW_CASTER
|
||||
#define CFXR_GLOW_SHADER
|
||||
#include "CFXR_PASSES.cginc"
|
||||
|
||||
ENDCG
|
||||
}
|
||||
}
|
||||
/*** END BIRP ***/
|
||||
}
|
||||
|
||||
CustomEditor "CartoonFX.MaterialInspector"
|
||||
}
|
||||
|
||||
@@ -0,0 +1,70 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 67dfcda17071f4a41be79c4049965e67
|
||||
ScriptedImporter:
|
||||
internalIDToNameTable: []
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
script: {fileID: 11500000, guid: fe56ec25963759b49955809beeb4324b, type: 3}
|
||||
detectedRenderPipeline: Built-In Render Pipeline
|
||||
strippedLinesCount: 108
|
||||
shaderSourceCode: "//--------------------------------------------------------------------------------------------------------------------------------\r\n//
|
||||
Cartoon FX\r\n// (c) 2012-2020 Jean Moreno\r\n//--------------------------------------------------------------------------------------------------------------------------------\r\n\r\nShader
|
||||
\"Cartoon FX/Remaster/Particle Procedural Glow NEW\"\r\n{\r\n\tProperties\r\n\t{\r\n\t//#
|
||||
Blending\r\n\t//#\r\n\r\n\t\t[Enum(UnityEngine.Rendering.BlendMode)] _SrcBlend
|
||||
(\"Blend Source\", Float) = 5\r\n\t\t[Enum(UnityEngine.Rendering.BlendMode)]
|
||||
_DstBlend (\"Blend Destination\", Float) = 10\r\n\t\r\n\t//# --------------------------------------------------------\r\n\r\n\t\t[Toggle(_CFXR_DISSOLVE)]
|
||||
_UseDissolve (\"Enable Dissolve\", Float) = 0\r\n\t//# IF_KEYWORD _CFXR_DISSOLVE\r\n\t\t[NoScaleOffset]
|
||||
_DissolveTex (\"Dissolve Texture\", 2D) = \"gray\" {}\r\n\t\t_DissolveSmooth
|
||||
(\"Dissolve Smoothing\", Range(0.0001,0.5)) = 0.1\r\n\t\t[ToggleNoKeyword] _InvertDissolveTex
|
||||
(\"Invert Dissolve Texture\", Float) = 0\r\n\t//# END_IF\r\n\r\n\t//# --------------------------------------------------------\r\n\r\n\t//#
|
||||
Procedural Circle\r\n\t//#\r\n\r\n\t\t[KeywordEnum(P0, P2, P4, P8)] _CFXR_GLOW_POW
|
||||
(\"Apply Power of\", Float) = 0\r\n\t\t_GlowMin (\"Circle Min\", Float) = 0\r\n\t\t_GlowMax
|
||||
(\"Circle Max\", Float) = 1\r\n\t//#\r\n\t\t_MaxValue (\"Max Value\", Float)
|
||||
= 10\r\n\r\n\t//# --------------------------------------------------------\r\n\r\n\t\t[Toggle(_CFXR_HDR_BOOST)]
|
||||
_HdrBoost (\"Enable HDR Multiplier\", Float) = 0\r\n\t//# IF_KEYWORD _CFXR_HDR_BOOST\r\n\t\t_HdrMultiply
|
||||
(\"HDR Multiplier\", Float) = 2\r\n\t//# END_IF\r\n\r\n\t//# --------------------------------------------------------\r\n\t\r\n\t\t[Toggle(_FADING_ON)]
|
||||
_UseSP (\"Soft Particles\", Float) = 0\r\n\t//# IF_KEYWORD _FADING_ON\r\n\t\t_SoftParticlesFadeDistanceNear
|
||||
(\"Near Fade\", Float) = 0\r\n\t\t_SoftParticlesFadeDistanceFar (\"Far Fade\",
|
||||
Float) = 1\r\n\t//# END_IF\r\n\r\n\t//# ========================================================\r\n\t//#
|
||||
Shadows\r\n\t//#\r\n\r\n\t\t[KeywordEnum(Off,On,CustomTexture)] _CFXR_DITHERED_SHADOWS
|
||||
(\"Dithered Shadows\", Float) = 0\r\n\t//# IF_KEYWORD _CFXR_DITHERED_SHADOWS_ON
|
||||
|| _CFXR_DITHERED_SHADOWS_CUSTOMTEXTURE\r\n\t\t_ShadowStrength\t\t(\"Shadows
|
||||
Strength Max\", Range(0,1)) = 1.0\r\n\t\t//#\tIF_KEYWORD _CFXR_DITHERED_SHADOWS_CUSTOMTEXTURE\r\n\t\t_DitherCustom\t\t(\"Dithering
|
||||
3D Texture\", 3D) = \"black\" {}\r\n\t\t//#\tEND_IF\r\n\t//# END_IF\r\n\t}\r\n\t\r\n\tCategory\r\n\t{\r\n\t\tTags\r\n\t\t{\r\n\t\t\t\"Queue\"=\"Transparent\"\r\n\t\t\t\"IgnoreProjector\"=\"True\"\r\n\t\t\t\"RenderType\"=\"Transparent\"\r\n\t\t\t\"PreviewType\"=\"Plane\"\r\n\t\t}\r\n\t\tBlend
|
||||
[_SrcBlend] [_DstBlend], One One\r\n\t\tCull Off\r\n\t\tZWrite Off\r\n\r\n\r\n\t\t//====================================================================================================================================\r\n\t\t//
|
||||
Built-in Rendering Pipeline\r\n\r\n\t\tSubShader\r\n\t\t{\r\n\t\t\tPass\r\n\t\t\t{\r\n\t\t\t\tName
|
||||
\"BASE\"\r\n\t\t\t\tTags { \"LightMode\"=\"ForwardBase\" }\r\n\r\n\t\t\t\tCGPROGRAM\r\n\r\n\t\t\t\t#pragma
|
||||
vertex vertex_program\r\n\t\t\t\t#pragma fragment fragment_program\r\n\t\t\t\t\r\n\t\t\t\t//vertInstancingSetup
|
||||
writes to global, not allowed with DXC\r\n\t\t\t\t// #pragma never_use_dxc\r\n\t\t\t\t//
|
||||
#pragma target 2.5\r\n\t\t\t\t// #pragma multi_compile_instancing\r\n\t\t\t\t//
|
||||
#pragma instancing_options procedural:vertInstancingSetup\r\n\r\n\t\t\t\t#pragma
|
||||
multi_compile_particles\r\n\t\t\t\t#pragma multi_compile_fog\r\n\t\t\t\t\r\n\t\t\t\t#pragma
|
||||
shader_feature_local _ _CFXR_GLOW_POW_P2 _CFXR_GLOW_POW_P4 _CFXR_GLOW_POW_P8\r\n\t\t\t\t#pragma
|
||||
shader_feature_local _ _CFXR_HDR_BOOST\r\n\t\t\t\t#pragma shader_feature_local
|
||||
_ _CFXR_DISSOLVE\r\n\r\n\t\t\t\t#pragma shader_feature_local _FADING_ON\r\n\t\t\t\t#pragma
|
||||
shader_feature_local _ _ALPHATEST_ON\r\n\t\t\t\t#pragma shader_feature_local
|
||||
_ _ALPHABLEND_ON _ALPHAPREMULTIPLY_ON _ALPHAMODULATE_ON _CFXR_ADDITIVE\r\n\r\n\t\t\t\t#include
|
||||
\"UnityStandardParticleInstancing.cginc\"\r\n\r\n\t\t\t\t#define CFXR_GLOW_SHADER\r\n\t\t\t\t#include
|
||||
\"CFXR_PASSES.cginc\"\r\n\r\n\t\t\t\tENDCG\r\n\t\t\t}\r\n\r\n\t\t\t//--------------------------------------------------------------------------------------------------------------------------------\r\n\r\n\t\t\tPass\r\n\t\t\t{\r\n\t\t\t\tName
|
||||
\"ShadowCaster\"\r\n\t\t\t\tTags { \"LightMode\" = \"ShadowCaster\" }\r\n\r\n\t\t\t\tBlendOp
|
||||
Add\r\n\t\t\t\tBlend One Zero\r\n\t\t\t\tZWrite On\r\n\t\t\t\tCull Off\r\n\t\t\t\r\n\t\t\t\tCGPROGRAM\r\n\r\n\t\t\t\t#pragma
|
||||
vertex vertex_program\r\n\t\t\t\t#pragma fragment fragment_program\r\n\r\n\t\t\t\t//vertInstancingSetup
|
||||
writes to global, not allowed with DXC\r\n\t\t\t\t// #pragma never_use_dxc\r\n\t\t\t\t//
|
||||
#pragma target 2.5\r\n\t\t\t\t// #pragma multi_compile_instancing\r\n\t\t\t\t//
|
||||
#pragma instancing_options procedural:vertInstancingSetup\r\n\r\n\t\t\t\t#pragma
|
||||
shader_feature_local _ _CFXR_GLOW_POW_P2 _CFXR_GLOW_POW_P4 _CFXR_GLOW_POW_P8\r\n\t\t\t\t#pragma
|
||||
shader_feature_local _ _CFXR_DISSOLVE\r\n\r\n\t\t\t\t#pragma shader_feature_local
|
||||
_FADING_ON\r\n\t\t\t\t#pragma shader_feature_local _ _ALPHATEST_ON _ALPHABLEND_ON
|
||||
_ALPHAPREMULTIPLY_ON _ALPHAMODULATE_ON\r\n\r\n\t\t\t\t#pragma multi_compile_shadowcaster\r\n\t\t\t\t#pragma
|
||||
shader_feature_local _ _CFXR_DITHERED_SHADOWS_ON _CFXR_DITHERED_SHADOWS_CUSTOMTEXTURE\r\n\r\n\t\t\t#if
|
||||
(_CFXR_DITHERED_SHADOWS_ON || _CFXR_DITHERED_SHADOWS_CUSTOMTEXTURE) && !defined(SHADER_API_GLES)\r\n\t\t\t\t#pragma
|
||||
target 3.0\t\t//needed for VPOS\r\n\t\t\t#endif\r\n\r\n\t\t\t\t#include \"UnityStandardParticleInstancing.cginc\"\r\n\r\n\t\t\t\t#define
|
||||
PASS_SHADOW_CASTER\r\n\t\t\t\t#define CFXR_GLOW_SHADER\r\n\t\t\t\t#include \"CFXR_PASSES.cginc\"\r\n\r\n\t\t\t\tENDCG\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\tCustomEditor
|
||||
\"CartoonFX.MaterialInspector\"\r\n}\r\n\r\n"
|
||||
shaderName: Cartoon FX/Remaster/Particle Procedural Glow NEW
|
||||
shaderErrors: []
|
||||
variantCount: 3040
|
||||
variantCountUsed: 4
|
||||
@@ -0,0 +1,269 @@
|
||||
//--------------------------------------------------------------------------------------------------------------------------------
|
||||
// Cartoon FX
|
||||
// (c) 2012-2020 Jean Moreno
|
||||
//--------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
Shader "Cartoon FX/Remaster/Particle Procedural Ring"
|
||||
{
|
||||
Properties
|
||||
{
|
||||
//# Blending
|
||||
//#
|
||||
[Enum(UnityEngine.Rendering.BlendMode)] _SrcBlend ("Blend Source", Float) = 5
|
||||
[Enum(UnityEngine.Rendering.BlendMode)] _DstBlend ("Blend Destination", Float) = 10
|
||||
|
||||
//# --------------------------------------------------------
|
||||
|
||||
[Toggle(_CFXR_DISSOLVE)] _UseDissolve ("Enable Dissolve", Float) = 0
|
||||
//# IF_KEYWORD _CFXR_DISSOLVE
|
||||
[NoScaleOffset] _DissolveTex ("Dissolve Texture", 2D) = "gray" {}
|
||||
_DissolveSmooth ("Dissolve Smoothing", Range(0.0001,0.5)) = 0.1
|
||||
[ToggleNoKeyword] _InvertDissolveTex ("Invert Dissolve Texture", Float) = 0
|
||||
//# END_IF
|
||||
|
||||
//# --------------------------------------------------------
|
||||
|
||||
//# Textures
|
||||
//#
|
||||
|
||||
_MainTex ("Texture", 2D) = "white" {}
|
||||
[Toggle] _SingleChannel ("Single Channel Texture", Float) = 0
|
||||
|
||||
//# --------------------------------------------------------
|
||||
|
||||
//# Ring
|
||||
//#
|
||||
|
||||
[Toggle(_CFXR_RADIAL_UV)] _UseRadialUV ("Enable Radial UVs", Float) = 0
|
||||
_RingTopOffset ("Ring Offset", float) = 0.05
|
||||
[Toggle(_CFXR_WORLD_SPACE_RING)] _WorldSpaceRing ("World Space", Float) = 0
|
||||
|
||||
//# --------------------------------------------------------
|
||||
|
||||
_HdrMultiply ("HDR Multiplier", Float) = 2
|
||||
|
||||
//# --------------------------------------------------------
|
||||
|
||||
[Toggle(_FADING_ON)] _UseSP ("Soft Particles", Float) = 0
|
||||
//# IF_KEYWORD _FADING_ON
|
||||
_SoftParticlesFadeDistanceNear ("Near Fade", Float) = 0
|
||||
_SoftParticlesFadeDistanceFar ("Far Fade", Float) = 1
|
||||
//# END_IF
|
||||
|
||||
//# ========================================================
|
||||
//# Shadows
|
||||
//#
|
||||
|
||||
[KeywordEnum(Off,On,CustomTexture)] _CFXR_DITHERED_SHADOWS ("Dithered Shadows", Float) = 0
|
||||
//# IF_KEYWORD _CFXR_DITHERED_SHADOWS_ON || _CFXR_DITHERED_SHADOWS_CUSTOMTEXTURE
|
||||
_ShadowStrength ("Shadows Strength Max", Range(0,1)) = 1.0
|
||||
//# IF_KEYWORD _CFXR_DITHERED_SHADOWS_CUSTOMTEXTURE
|
||||
_DitherCustom ("Dithering 3D Texture", 3D) = "black" {}
|
||||
//# END_IF
|
||||
//# END_IF
|
||||
}
|
||||
|
||||
Category
|
||||
{
|
||||
Tags
|
||||
{
|
||||
"Queue"="Transparent"
|
||||
"IgnoreProjector"="True"
|
||||
"RenderType"="Transparent"
|
||||
}
|
||||
Blend [_SrcBlend] [_DstBlend]
|
||||
Cull Off
|
||||
ZWrite Off
|
||||
|
||||
/*** URP ***/
|
||||
//====================================================================================================================================
|
||||
// Universal Rendering Pipeline
|
||||
|
||||
SubShader
|
||||
{
|
||||
Pass
|
||||
{
|
||||
Name "BASE"
|
||||
Tags { "LightMode"="UniversalForward" }
|
||||
|
||||
CGPROGRAM
|
||||
|
||||
#pragma vertex vertex_program
|
||||
#pragma fragment fragment_program
|
||||
|
||||
#pragma target 2.0
|
||||
|
||||
// #pragma multi_compile_instancing
|
||||
#pragma multi_compile_fog
|
||||
|
||||
#pragma shader_feature_local _ _CFXR_RADIAL_UV
|
||||
#pragma shader_feature_local _ _CFXR_WORLD_SPACE_RING
|
||||
#pragma shader_feature_local _ _CFXR_DISSOLVE
|
||||
|
||||
// Using the same keywords as Unity's Standard Particle shader to minimize project-wide keyword usage
|
||||
#pragma shader_feature_local _ _FADING_ON
|
||||
#pragma shader_feature_local _ _ALPHATEST_ON
|
||||
#pragma shader_feature_local_fragment _ _ALPHABLEND_ON _ALPHAPREMULTIPLY_ON _ALPHAMODULATE_ON _CFXR_ADDITIVE
|
||||
|
||||
#define CFXR_URP
|
||||
#define CFXR_PROCEDURAL_RING_SHADER
|
||||
#include "CFXR_PASSES.cginc"
|
||||
|
||||
ENDCG
|
||||
}
|
||||
|
||||
// Same as above with 'Universal2D' instead and DISABLE_SOFT_PARTICLES keyword
|
||||
Pass
|
||||
{
|
||||
Name "BASE"
|
||||
Tags { "LightMode"="Universal2D" }
|
||||
|
||||
CGPROGRAM
|
||||
|
||||
#pragma vertex vertex_program
|
||||
#pragma fragment fragment_program
|
||||
|
||||
#pragma target 2.0
|
||||
|
||||
// #pragma multi_compile_instancing
|
||||
#pragma multi_compile_fog
|
||||
|
||||
#pragma shader_feature_local _ _CFXR_RADIAL_UV
|
||||
#pragma shader_feature_local _ _CFXR_WORLD_SPACE_RING
|
||||
#pragma shader_feature_local _ _CFXR_DISSOLVE
|
||||
|
||||
// Using the same keywords as Unity's Standard Particle shader to minimize project-wide keyword usage
|
||||
#pragma shader_feature_local _ _FADING_ON
|
||||
#pragma shader_feature_local _ _ALPHATEST_ON
|
||||
#pragma shader_feature_local_fragment _ _ALPHABLEND_ON _ALPHAPREMULTIPLY_ON _ALPHAMODULATE_ON _CFXR_ADDITIVE
|
||||
|
||||
#define CFXR_URP
|
||||
#define DISABLE_SOFT_PARTICLES
|
||||
#define CFXR_PROCEDURAL_RING_SHADER
|
||||
#include "CFXR_PASSES.cginc"
|
||||
|
||||
ENDCG
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
Pass
|
||||
{
|
||||
Name "ShadowCaster"
|
||||
Tags { "LightMode" = "ShadowCaster" }
|
||||
|
||||
BlendOp Add
|
||||
Blend One Zero
|
||||
ZWrite On
|
||||
Cull Off
|
||||
|
||||
CGPROGRAM
|
||||
|
||||
#pragma vertex vertex_program
|
||||
#pragma fragment fragment_program
|
||||
|
||||
#pragma shader_feature_local _ _CFXR_RADIAL_UV
|
||||
#pragma shader_feature_local _ _CFXR_WORLD_SPACE_RING
|
||||
#pragma shader_feature_local _ _CFXR_DISSOLVE
|
||||
|
||||
#pragma shader_feature_local _ _ALPHATEST_ON
|
||||
#pragma shader_feature_local_fragment _ _ALPHABLEND_ON _ALPHAPREMULTIPLY_ON _ALPHAMODULATE_ON _CFXR_ADDITIVE
|
||||
|
||||
#pragma multi_compile_shadowcaster
|
||||
#pragma shader_feature_local _ _CFXR_DITHERED_SHADOWS_ON _CFXR_DITHERED_SHADOWS_CUSTOMTEXTURE
|
||||
|
||||
#if (_CFXR_DITHERED_SHADOWS_ON || _CFXR_DITHERED_SHADOWS_CUSTOMTEXTURE) && !defined(SHADER_API_GLES)
|
||||
#pragma target 3.0 //needed for VPOS
|
||||
#endif
|
||||
|
||||
#define CFXR_URP
|
||||
#define PASS_SHADOW_CASTER
|
||||
#define CFXR_PROCEDURAL_RING_SHADER
|
||||
#include "CFXR_PASSES.cginc"
|
||||
|
||||
ENDCG
|
||||
}
|
||||
}
|
||||
/*** END URP ***/
|
||||
|
||||
/*** BIRP ***/
|
||||
//====================================================================================================================================
|
||||
// Built-in Rendering Pipeline
|
||||
|
||||
SubShader
|
||||
{
|
||||
Pass
|
||||
{
|
||||
Name "BASE"
|
||||
Tags { "LightMode"="ForwardBase" }
|
||||
|
||||
CGPROGRAM
|
||||
|
||||
#pragma vertex vertex_program
|
||||
#pragma fragment fragment_program
|
||||
|
||||
#pragma target 2.0
|
||||
|
||||
#pragma multi_compile_particles
|
||||
// #pragma multi_compile_instancing
|
||||
#pragma multi_compile_fog
|
||||
|
||||
#pragma shader_feature_local _ _CFXR_RADIAL_UV
|
||||
#pragma shader_feature_local _ _CFXR_WORLD_SPACE_RING
|
||||
#pragma shader_feature_local _ _CFXR_DISSOLVE
|
||||
|
||||
// Using the same keywords as Unity's Standard Particle shader to minimize project-wide keyword usage
|
||||
#pragma shader_feature_local _ _FADING_ON
|
||||
#pragma shader_feature_local _ _ALPHATEST_ON
|
||||
#pragma shader_feature_local_fragment _ _ALPHABLEND_ON _ALPHAPREMULTIPLY_ON _ALPHAMODULATE_ON _CFXR_ADDITIVE
|
||||
|
||||
#define CFXR_PROCEDURAL_RING_SHADER
|
||||
#include "CFXR_PASSES.cginc"
|
||||
|
||||
ENDCG
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
Pass
|
||||
{
|
||||
Name "ShadowCaster"
|
||||
Tags { "LightMode" = "ShadowCaster" }
|
||||
|
||||
BlendOp Add
|
||||
Blend One Zero
|
||||
ZWrite On
|
||||
Cull Off
|
||||
|
||||
CGPROGRAM
|
||||
|
||||
#pragma vertex vertex_program
|
||||
#pragma fragment fragment_program
|
||||
|
||||
#pragma shader_feature_local _ _CFXR_RADIAL_UV
|
||||
#pragma shader_feature_local _ _CFXR_WORLD_SPACE_RING
|
||||
#pragma shader_feature_local _ _CFXR_DISSOLVE
|
||||
|
||||
#pragma shader_feature_local _ _ALPHATEST_ON
|
||||
#pragma shader_feature_local_fragment _ _ALPHABLEND_ON _ALPHAPREMULTIPLY_ON _ALPHAMODULATE_ON _CFXR_ADDITIVE
|
||||
|
||||
#pragma multi_compile_shadowcaster
|
||||
#pragma shader_feature_local _ _CFXR_DITHERED_SHADOWS_ON _CFXR_DITHERED_SHADOWS_CUSTOMTEXTURE
|
||||
|
||||
#if (_CFXR_DITHERED_SHADOWS_ON || _CFXR_DITHERED_SHADOWS_CUSTOMTEXTURE) && !defined(SHADER_API_GLES)
|
||||
#pragma target 3.0 //needed for VPOS
|
||||
#endif
|
||||
|
||||
#define PASS_SHADOW_CASTER
|
||||
#define CFXR_PROCEDURAL_RING_SHADER
|
||||
#include "CFXR_PASSES.cginc"
|
||||
|
||||
ENDCG
|
||||
}
|
||||
}
|
||||
/*** END BIRP ***/
|
||||
}
|
||||
|
||||
CustomEditor "CartoonFX.MaterialInspector"
|
||||
}
|
||||
|
||||
@@ -0,0 +1,69 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 1581eccce46ba384596a1dce7936ab19
|
||||
ScriptedImporter:
|
||||
internalIDToNameTable: []
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
script: {fileID: 11500000, guid: fe56ec25963759b49955809beeb4324b, type: 3}
|
||||
detectedRenderPipeline: Built-In Render Pipeline
|
||||
strippedLinesCount: 113
|
||||
shaderSourceCode: "//--------------------------------------------------------------------------------------------------------------------------------\r\n//
|
||||
Cartoon FX\r\n// (c) 2012-2020 Jean Moreno\r\n//--------------------------------------------------------------------------------------------------------------------------------\r\n\r\nShader
|
||||
\"Cartoon FX/Remaster/Particle Procedural Ring NEW\"\r\n{\r\n\tProperties\r\n\t{\r\n\t//#
|
||||
Blending\r\n\t//#\r\n\t\t[Enum(UnityEngine.Rendering.BlendMode)] _SrcBlend (\"Blend
|
||||
Source\", Float) = 5\r\n\t\t[Enum(UnityEngine.Rendering.BlendMode)] _DstBlend
|
||||
(\"Blend Destination\", Float) = 10\r\n\t\r\n\t//# --------------------------------------------------------\r\n\r\n\t\t[Toggle(_CFXR_DISSOLVE)]
|
||||
_UseDissolve (\"Enable Dissolve\", Float) = 0\r\n\t//# IF_KEYWORD _CFXR_DISSOLVE\r\n\t\t[NoScaleOffset]
|
||||
_DissolveTex (\"Dissolve Texture\", 2D) = \"gray\" {}\r\n\t\t_DissolveSmooth
|
||||
(\"Dissolve Smoothing\", Range(0.0001,0.5)) = 0.1\r\n\t\t[ToggleNoKeyword] _InvertDissolveTex
|
||||
(\"Invert Dissolve Texture\", Float) = 0\r\n\t//# END_IF\r\n\r\n\t//# --------------------------------------------------------\r\n\r\n\t//#
|
||||
Textures\r\n\t//#\r\n\r\n\t\t_MainTex (\"Texture\", 2D) = \"white\" {}\r\n\t\t[Toggle(_CFXR_SINGLE_CHANNEL)]
|
||||
_SingleChannel (\"Single Channel Texture\", Float) = 0\r\n\r\n\t//# --------------------------------------------------------\r\n\r\n\t//#
|
||||
Ring\r\n\t//#\r\n\r\n\t\t[Toggle(_CFXR_RADIAL_UV)] _UseRadialUV (\"Enable Radial
|
||||
UVs\", Float) = 0\r\n\t\t_RingTopOffset (\"Ring Offset\", float) = 0.05\r\n\t\t[Toggle(_CFXR_WORLD_SPACE_RING)]
|
||||
_WorldSpaceRing (\"World Space\", Float) = 0\r\n\r\n\t//# --------------------------------------------------------\r\n\r\n\t\t[Toggle(_CFXR_HDR_BOOST)]
|
||||
_HdrBoost (\"Enable HDR Multiplier\", Float) = 0\r\n\t//# IF_KEYWORD _CFXR_HDR_BOOST\r\n\t\t_HdrMultiply
|
||||
(\"HDR Multiplier\", Float) = 2\r\n\t//# END_IF\r\n\r\n\t//# --------------------------------------------------------\r\n\t\r\n\t\t[Toggle(_FADING_ON)]
|
||||
_UseSP (\"Soft Particles\", Float) = 0\r\n\t//# IF_KEYWORD _FADING_ON\r\n\t\t_SoftParticlesFadeDistanceNear
|
||||
(\"Near Fade\", Float) = 0\r\n\t\t_SoftParticlesFadeDistanceFar (\"Far Fade\",
|
||||
Float) = 1\r\n\t//# END_IF\r\n\r\n\t//# ========================================================\r\n\t//#
|
||||
Shadows\r\n\t//#\r\n\r\n\t\t[KeywordEnum(Off,On,CustomTexture)] _CFXR_DITHERED_SHADOWS
|
||||
(\"Dithered Shadows\", Float) = 0\r\n\t//# IF_KEYWORD _CFXR_DITHERED_SHADOWS_ON
|
||||
|| _CFXR_DITHERED_SHADOWS_CUSTOMTEXTURE\r\n\t\t_ShadowStrength\t\t(\"Shadows
|
||||
Strength Max\", Range(0,1)) = 1.0\r\n\t\t//#\tIF_KEYWORD _CFXR_DITHERED_SHADOWS_CUSTOMTEXTURE\r\n\t\t_DitherCustom\t\t(\"Dithering
|
||||
3D Texture\", 3D) = \"black\" {}\r\n\t\t//#\tEND_IF\r\n\t//# END_IF\r\n\t}\r\n\t\r\n\tCategory\r\n\t{\r\n\t\tTags\r\n\t\t{\r\n\t\t\t\"Queue\"=\"Transparent\"\r\n\t\t\t\"IgnoreProjector\"=\"True\"\r\n\t\t\t\"RenderType\"=\"Transparent\"\r\n\t\t}\r\n\t\tBlend
|
||||
[_SrcBlend] [_DstBlend]\r\n\t\tCull Off\r\n\t\tZWrite Off\r\n\r\n\r\n\t\t//====================================================================================================================================\r\n\t\t//
|
||||
Built-in Rendering Pipeline\r\n\r\n\t\tSubShader\r\n\t\t{\r\n\t\t\tPass\r\n\t\t\t{\r\n\t\t\t\tName
|
||||
\"BASE\"\r\n\t\t\t\tTags { \"LightMode\"=\"ForwardBase\" }\r\n\r\n\t\t\t\tCGPROGRAM\r\n\r\n\t\t\t\t#pragma
|
||||
vertex vertex_program\r\n\t\t\t\t#pragma fragment fragment_program\r\n\t\t\t\t\r\n\t\t\t\t#pragma
|
||||
target 2.0\r\n\t\t\t\t\r\n\t\t\t\t#pragma multi_compile_particles\r\n\t\t\t\t//
|
||||
#pragma multi_compile_instancing\r\n\t\t\t\t#pragma multi_compile_fog\r\n\t\t\t\t\r\n\t\t\t\t#pragma
|
||||
shader_feature_local _ _CFXR_SINGLE_CHANNEL\r\n\t\t\t\t#pragma shader_feature_local
|
||||
_ _CFXR_RADIAL_UV\r\n\t\t\t\t#pragma shader_feature_local _ _CFXR_WORLD_SPACE_RING\r\n\t\t\t\t#pragma
|
||||
shader_feature_local _ _CFXR_DISSOLVE\r\n\t\t\t\t#pragma shader_feature_local
|
||||
_ _CFXR_HDR_BOOST\r\n\r\n\t\t\t\t// Using the same keywords as Unity's Standard
|
||||
Particle shader to minimize project-wide keyword usage\r\n\t\t\t\t#pragma shader_feature_local
|
||||
_ _FADING_ON\r\n\t\t\t\t#pragma shader_feature_local _ _ALPHATEST_ON\r\n\t\t\t\t#pragma
|
||||
shader_feature_local _ _ALPHABLEND_ON _ALPHAPREMULTIPLY_ON _ALPHAMODULATE_ON
|
||||
_CFXR_ADDITIVE\r\n\r\n\t\t\t\t#define CFXR_PROCEDURAL_RING_SHADER\r\n\t\t\t\t#include
|
||||
\"CFXR_PASSES.cginc\"\r\n\r\n\t\t\t\tENDCG\r\n\t\t\t}\r\n\r\n\t\t\t//--------------------------------------------------------------------------------------------------------------------------------\r\n\r\n\t\t\tPass\r\n\t\t\t{\r\n\t\t\t\tName
|
||||
\"ShadowCaster\"\r\n\t\t\t\tTags { \"LightMode\" = \"ShadowCaster\" }\r\n\r\n\t\t\t\tBlendOp
|
||||
Add\r\n\t\t\t\tBlend One Zero\r\n\t\t\t\tZWrite On\r\n\t\t\t\tCull Off\r\n\t\t\t\r\n\t\t\t\tCGPROGRAM\r\n\r\n\t\t\t\t#pragma
|
||||
vertex vertex_program\r\n\t\t\t\t#pragma fragment fragment_program\r\n\r\n\t\t\t\t#pragma
|
||||
shader_feature_local _ _CFXR_SINGLE_CHANNEL\r\n\t\t\t\t#pragma shader_feature_local
|
||||
_ _CFXR_RADIAL_UV\r\n\t\t\t\t#pragma shader_feature_local _ _CFXR_WORLD_SPACE_RING\r\n\t\t\t\t#pragma
|
||||
shader_feature_local _ _CFXR_DISSOLVE\r\n\r\n\t\t\t\t#pragma shader_feature_local
|
||||
_ _ALPHATEST_ON\r\n\t\t\t\t#pragma shader_feature_local _ _ALPHABLEND_ON _ALPHAPREMULTIPLY_ON
|
||||
_ALPHAMODULATE_ON _CFXR_ADDITIVE\r\n\r\n\t\t\t\t#pragma multi_compile_shadowcaster\r\n\t\t\t\t#pragma
|
||||
shader_feature_local _ _CFXR_DITHERED_SHADOWS_ON _CFXR_DITHERED_SHADOWS_CUSTOMTEXTURE\r\n\r\n\t\t\t#if
|
||||
(_CFXR_DITHERED_SHADOWS_ON || _CFXR_DITHERED_SHADOWS_CUSTOMTEXTURE) && !defined(SHADER_API_GLES)\r\n\t\t\t\t#pragma
|
||||
target 3.0\t\t//needed for VPOS\r\n\t\t\t#endif\r\n\r\n\t\t\t\t#define PASS_SHADOW_CASTER\r\n\t\t\t\t#define
|
||||
CFXR_PROCEDURAL_RING_SHADER\r\n\t\t\t\t#include \"CFXR_PASSES.cginc\"\r\n\r\n\t\t\t\tENDCG\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\tCustomEditor
|
||||
\"CartoonFX.MaterialInspector\"\r\n}\r\n\r\n"
|
||||
shaderName: Cartoon FX/Remaster/Particle Procedural Ring NEW
|
||||
shaderErrors: []
|
||||
variantCount: 6080
|
||||
variantCountUsed: 4
|
||||
@@ -0,0 +1,422 @@
|
||||
//--------------------------------------------------------------------------------------------------------------------------------
|
||||
// Cartoon FX
|
||||
// (c) 2012-2020 Jean Moreno
|
||||
//--------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
Shader "Cartoon FX/Remaster/Particle Ubershader"
|
||||
{
|
||||
Properties
|
||||
{
|
||||
//# Blending
|
||||
//#
|
||||
[Enum(UnityEngine.Rendering.BlendMode)] _SrcBlend ("Blend Source", Float) = 5
|
||||
[Enum(UnityEngine.Rendering.BlendMode)] _DstBlend ("Blend Destination", Float) = 10
|
||||
[KeywordEnumNoPrefix(Alpha Blending, _ALPHABLEND_ON, Alpha Blending Premultiplied, _ALPHAPREMULTIPLY_ON, Multiplicative, _ALPHAMODULATE_ON, Additive, _CFXR_ADDITIVE)] _BlendingType ("Blending Type", Float) = 0
|
||||
|
||||
//#
|
||||
[ToggleNoKeyword] _ZWrite ("Depth Write", Float) = 0
|
||||
[Toggle(_ALPHATEST_ON)] _UseAlphaClip ("Alpha Clipping (Cutout)", Float) = 0
|
||||
//# IF_KEYWORD _ALPHATEST_ON
|
||||
_Cutoff ("Cutoff Threshold", Range(0.001,1)) = 0.1
|
||||
//# END_IF
|
||||
|
||||
//# --------------------------------------------------------
|
||||
|
||||
[Toggle(_FADING_ON)] _UseSP ("Soft Particles", Float) = 0
|
||||
//# IF_KEYWORD _FADING_ON
|
||||
_SoftParticlesFadeDistanceNear ("Near Fade", Float) = 0
|
||||
_SoftParticlesFadeDistanceFar ("Far Fade", Float) = 1
|
||||
//# END_IF
|
||||
|
||||
//#
|
||||
|
||||
[Toggle(_CFXR_EDGE_FADING)] _UseEF ("Edge Fade", Float) = 0
|
||||
//# IF_KEYWORD _CFXR_EDGE_FADING
|
||||
_EdgeFadePow ("Edge Fade Power", Float) = 1
|
||||
//# END_IF
|
||||
|
||||
//#
|
||||
|
||||
//# ========================================================
|
||||
|
||||
//# Effects
|
||||
//#
|
||||
|
||||
[Toggle(_CFXR_DISSOLVE)] _UseDissolve ("Enable Dissolve", Float) = 0
|
||||
//# IF_KEYWORD _CFXR_DISSOLVE
|
||||
_DissolveTex ("Dissolve Texture", 2D) = "gray" {}
|
||||
_DissolveSmooth ("Dissolve Smoothing", Range(0.0001,0.5)) = 0.1
|
||||
[ToggleNoKeyword] _InvertDissolveTex ("Invert Dissolve Texture", Float) = 0
|
||||
[ToggleNoKeyword] _DoubleDissolve ("Double Dissolve", Float) = 0
|
||||
[Toggle] _UseDissolveOffsetUV ("Dissolve offset along X", Float) = 0
|
||||
//# IF_PROPERTY _UseDissolveOffsetUV > 0
|
||||
_DissolveScroll ("UV Scrolling", Vector) = (0,0,0,0)
|
||||
//# END_IF
|
||||
//# END_IF
|
||||
|
||||
//# --------------------------------------------------------
|
||||
|
||||
[Toggle(_CFXR_UV_DISTORTION)] _UseUVDistortion ("Enable UV Distortion", Float) = 0
|
||||
//# IF_KEYWORD _CFXR_UV_DISTORTION
|
||||
|
||||
[NoScaleOffset] _DistortTex ("Distortion Texture", 2D) = "gray" {}
|
||||
_DistortScrolling ("Scroll (XY) Tile (ZW)", Vector) = (0,0,1,1)
|
||||
[Toggle] _UseUV2Distortion ("Use UV2", Float) = 0
|
||||
_Distort ("Distortion Strength", Range(0,2.0)) = 0.1
|
||||
[ToggleNoKeyword] _FadeAlongU ("Fade along Y", Float) = 0
|
||||
[Toggle] _UVDistortionAdd ("Add to base UV", Float) = 0
|
||||
//# END_IF
|
||||
|
||||
//# ========================================================
|
||||
|
||||
//# Colors
|
||||
//#
|
||||
|
||||
[NoScaleOffset] _MainTex ("Texture", 2D) = "white" {}
|
||||
[Toggle] _SingleChannel ("Single Channel Texture", Float) = 0
|
||||
|
||||
//# --------------------------------------------------------
|
||||
|
||||
[KeywordEnum(Off,1x,2x)] _CFXR_OVERLAYTEX ("Enable Overlay Texture", Float) = 0
|
||||
//# IF_KEYWORD _CFXR_OVERLAYTEX_1X || _CFXR_OVERLAYTEX_2X
|
||||
[Enum(RGBA,0,RGB,1,A,2)] _CFXR_OVERLAYBLEND ("Overlay Blend Channels", Float) = 0
|
||||
[NoScaleOffset] _OverlayTex ("Overlay Texture", 2D) = "white" {}
|
||||
_OverlayTex_Scroll ("Overlay Scrolling / Scale", Vector) = (0.1,0.1,1,1)
|
||||
//# END_IF
|
||||
|
||||
//# --------------------------------------------------------
|
||||
|
||||
[Toggle(_FLIPBOOK_BLENDING)] _UseFB ("Flipbook Blending", Float) = 0
|
||||
|
||||
//# --------------------------------------------------------
|
||||
|
||||
[Toggle(_CFXR_SECONDCOLOR_LERP)] _UseSecondColor ("Secondary Vertex Color (TEXCOORD2)", Float) = 0
|
||||
//# IF_KEYWORD _CFXR_SECONDCOLOR_LERP
|
||||
[NoScaleOffset] _SecondColorTex ("Second Color Map", 2D) = "black" {}
|
||||
_SecondColorSmooth ("Second Color Smoothing", Range(0.0001,0.5)) = 0.2
|
||||
//# END_IF
|
||||
|
||||
//# --------------------------------------------------------
|
||||
|
||||
[Toggle(_CFXR_FONT_COLORS)] _UseFontColor ("Use Font Colors", Float) = 0
|
||||
|
||||
// //# --------------------------------------------------------
|
||||
//
|
||||
// [Toggle(_CFXR_GRADIENTMAP)] _UseGradientMap ("Gradient Map", Float) = 0
|
||||
// //# IF_KEYWORD _CFXR_GRADIENTMAP
|
||||
// [NoScaleOffset] _GradientMap ("Gradient Map", 2D) = "black" {}
|
||||
// //# END_IF
|
||||
|
||||
//# --------------------------------------------------------
|
||||
|
||||
_HdrMultiply ("HDR Multiplier", Float) = 1
|
||||
|
||||
//# --------------------------------------------------------
|
||||
|
||||
//# Lighting
|
||||
//#
|
||||
|
||||
[KeywordEnumNoPrefix(Off, _, Direct, _CFXR_LIGHTING_DIRECT, Indirect, _CFXR_LIGHTING_INDIRECT, Both, _CFXR_LIGHTING_ALL)] _UseLighting ("Mode", Float) = 0
|
||||
//# IF_KEYWORD _CFXR_LIGHTING_DIRECT || _CFXR_LIGHTING_ALL
|
||||
_DirectLightingRamp ("Direct Lighting Ramp", Range(0,1)) = 1.0
|
||||
//# END_IF
|
||||
//#
|
||||
//# IF_KEYWORD _CFXR_LIGHTING_DIRECT || _CFXR_LIGHTING_INDIRECT || _CFXR_LIGHTING_ALL
|
||||
[Toggle(_NORMALMAP)] _UseNormalMap ("Enable Normal Map", Float) = 0
|
||||
//# IF_KEYWORD _NORMALMAP
|
||||
[NoScaleOffset] _BumpMap ("Normal Map", 2D) = "bump" {}
|
||||
_BumpScale ("Normal Scale", Range(-1, 1)) = 1.0
|
||||
//# END_IF
|
||||
//#
|
||||
[Toggle(_EMISSION)] _UseEmission ("Enable Emission (TEXCOORD2)", Float) = 0
|
||||
//#
|
||||
[Toggle(_CFXR_LIGHTING_WPOS_OFFSET)] _UseLightingWorldPosOffset ("Enable World Pos. Offset", Float) = 0
|
||||
//# IF_KEYWORD _CFXR_LIGHTING_WPOS_OFFSET
|
||||
_LightingWorldPosStrength ("Offset Strength", Range(0,1)) = 0.2
|
||||
//# END_IF
|
||||
//#
|
||||
[Toggle(_CFXR_LIGHTING_BACK)] _UseBackLighting ("Enable Backlighting", Float) = 0
|
||||
//# IF_KEYWORD _CFXR_LIGHTING_BACK
|
||||
_DirLightScreenAtten ("Dir. Light Screen Attenuation", Range(0, 5)) = 1.0
|
||||
_BacklightTransmittance ("Backlight Transmittance", Range(0, 2)) = 1.0
|
||||
//# END_IF
|
||||
//#
|
||||
//# IF_KEYWORD _CFXR_LIGHTING_INDIRECT || _CFXR_LIGHTING_ALL
|
||||
_IndirectLightingMix ("Indirect Lighting Mix", Range(0,1)) = 0.5
|
||||
//# END_IF
|
||||
_ShadowColor ("Shadow Color", Color) = (0,0,0,1)
|
||||
//#
|
||||
//# END_IF
|
||||
|
||||
//# ========================================================
|
||||
//# Shadows
|
||||
//#
|
||||
|
||||
[KeywordEnum(Off,On,CustomTexture)] _CFXR_DITHERED_SHADOWS ("Dithered Shadows", Float) = 0
|
||||
//# IF_KEYWORD _CFXR_DITHERED_SHADOWS_ON || _CFXR_DITHERED_SHADOWS_CUSTOMTEXTURE
|
||||
_ShadowStrength ("Shadows Strength Max", Range(0,1)) = 1.0
|
||||
//# IF_KEYWORD _CFXR_DITHERED_SHADOWS_CUSTOMTEXTURE
|
||||
_DitherCustom ("Dithering 3D Texture", 3D) = "black" {}
|
||||
//# END_IF
|
||||
//# END_IF
|
||||
|
||||
// _ReceivedShadowsStrength ("Received Shadows Strength", Range(0,1)) = 0.5
|
||||
}
|
||||
|
||||
Category
|
||||
{
|
||||
Tags
|
||||
{
|
||||
"Queue"="Transparent"
|
||||
"IgnoreProjector"="True"
|
||||
"RenderType"="Transparent"
|
||||
"PreviewType"="Plane"
|
||||
}
|
||||
|
||||
Blend [_SrcBlend] [_DstBlend], One One
|
||||
ZWrite [_ZWrite]
|
||||
Cull Off
|
||||
|
||||
/*** URP ***/
|
||||
//====================================================================================================================================
|
||||
// Universal Rendering Pipeline
|
||||
|
||||
Subshader
|
||||
{
|
||||
Pass
|
||||
{
|
||||
Name "BASE_URP"
|
||||
Tags { "LightMode"="UniversalForward" }
|
||||
|
||||
CGPROGRAM
|
||||
|
||||
#pragma vertex vertex_program
|
||||
#pragma fragment fragment_program
|
||||
|
||||
#pragma target 2.0
|
||||
|
||||
// #pragma multi_compile_instancing
|
||||
// #pragma instancing_options procedural:ParticleInstancingSetup
|
||||
|
||||
#pragma multi_compile_fog
|
||||
//#pragma multi_compile_fwdbase
|
||||
//#pragma multi_compile SHADOWS_SCREEN
|
||||
|
||||
#pragma shader_feature_local _ _CFXR_DISSOLVE
|
||||
#pragma shader_feature_local_fragment _ _CFXR_UV_DISTORTION
|
||||
// #pragma shader_feature_local _ _CFXR_GRADIENTMAP
|
||||
#pragma shader_feature_local _ _CFXR_SECONDCOLOR_LERP _CFXR_FONT_COLORS
|
||||
#pragma shader_feature_local_fragment _ _CFXR_OVERLAYTEX_1X _CFXR_OVERLAYTEX_2X
|
||||
#pragma shader_feature_local _ _CFXR_EDGE_FADING
|
||||
#pragma shader_feature_local _ _CFXR_LIGHTING_DIRECT _CFXR_LIGHTING_INDIRECT _CFXR_LIGHTING_ALL
|
||||
#pragma shader_feature_local _ _CFXR_LIGHTING_WPOS_OFFSET
|
||||
#pragma shader_feature_local _ _CFXR_LIGHTING_BACK
|
||||
|
||||
// Using the same keywords as Unity's Standard Particle shader to minimize project-wide keyword usage
|
||||
#pragma shader_feature_local _ _NORMALMAP
|
||||
#pragma shader_feature_local _ _EMISSION
|
||||
#pragma shader_feature_local_fragment _ _FLIPBOOK_BLENDING
|
||||
#pragma shader_feature_local _ _FADING_ON
|
||||
#pragma shader_feature_local_fragment _ _ALPHATEST_ON
|
||||
#pragma shader_feature_local_fragment _ _ALPHABLEND_ON _ALPHAPREMULTIPLY_ON _ALPHAMODULATE_ON _CFXR_ADDITIVE
|
||||
|
||||
#define CFXR_URP
|
||||
#define CFXR_UBERSHADER
|
||||
#include "CFXR_PASSES.cginc"
|
||||
|
||||
ENDCG
|
||||
}
|
||||
|
||||
// Same as above with 'Universal2D' instead and DISABLE_SOFT_PARTICLES keyword
|
||||
Pass
|
||||
{
|
||||
Name "BASE_URP"
|
||||
Tags { "LightMode"="Universal2D" }
|
||||
|
||||
CGPROGRAM
|
||||
|
||||
#pragma vertex vertex_program
|
||||
#pragma fragment fragment_program
|
||||
|
||||
#pragma target 2.0
|
||||
|
||||
// #pragma multi_compile_instancing
|
||||
// #pragma instancing_options procedural:ParticleInstancingSetup
|
||||
|
||||
#pragma multi_compile_fog
|
||||
//#pragma multi_compile_fwdbase
|
||||
//#pragma multi_compile SHADOWS_SCREEN
|
||||
|
||||
#pragma shader_feature_local _ _CFXR_DISSOLVE
|
||||
#pragma shader_feature_local_fragment _ _CFXR_UV_DISTORTION
|
||||
// #pragma shader_feature_local _ _CFXR_GRADIENTMAP
|
||||
#pragma shader_feature_local _ _CFXR_SECONDCOLOR_LERP _CFXR_FONT_COLORS
|
||||
#pragma shader_feature_local_fragment _ _CFXR_OVERLAYTEX_1X _CFXR_OVERLAYTEX_2X
|
||||
#pragma shader_feature_local _ _CFXR_EDGE_FADING
|
||||
#pragma shader_feature_local _ _CFXR_LIGHTING_DIRECT _CFXR_LIGHTING_INDIRECT _CFXR_LIGHTING_ALL
|
||||
#pragma shader_feature_local _ _CFXR_LIGHTING_WPOS_OFFSET
|
||||
#pragma shader_feature_local _ _CFXR_LIGHTING_BACK
|
||||
|
||||
// Using the same keywords as Unity's Standard Particle shader to minimize project-wide keyword usage
|
||||
#pragma shader_feature_local _ _NORMALMAP
|
||||
#pragma shader_feature_local _ _EMISSION
|
||||
#pragma shader_feature_local_fragment _ _FLIPBOOK_BLENDING
|
||||
#pragma shader_feature_local _ _FADING_ON
|
||||
#pragma shader_feature_local_fragment _ _ALPHATEST_ON
|
||||
#pragma shader_feature_local_fragment _ _ALPHABLEND_ON _ALPHAPREMULTIPLY_ON _ALPHAMODULATE_ON _CFXR_ADDITIVE
|
||||
|
||||
#define CFXR_UPR
|
||||
#define DISABLE_SOFT_PARTICLES
|
||||
#define CFXR_UBERSHADER
|
||||
#include "CFXR_PASSES.cginc"
|
||||
|
||||
ENDCG
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
Pass
|
||||
{
|
||||
Name "ShadowCaster"
|
||||
Tags { "LightMode" = "ShadowCaster" }
|
||||
|
||||
BlendOp Add
|
||||
Blend One Zero
|
||||
ZWrite On
|
||||
Cull Off
|
||||
|
||||
CGPROGRAM
|
||||
|
||||
#pragma vertex vertex_program
|
||||
#pragma fragment fragment_program
|
||||
|
||||
#pragma shader_feature_local _ _CFXR_DISSOLVE
|
||||
#pragma shader_feature_local_fragment _ _CFXR_UV_DISTORTION
|
||||
#pragma shader_feature_local_fragment _ _CFXR_OVERLAYTEX_1X _CFXR_OVERLAYTEX_2X
|
||||
#pragma shader_feature_local_fragment _ _FLIPBOOK_BLENDING
|
||||
|
||||
#pragma shader_feature_local_fragment _ _ALPHATEST_ON
|
||||
#pragma shader_feature_local_fragment _ _ALPHABLEND_ON _ALPHAPREMULTIPLY_ON _ALPHAMODULATE_ON _CFXR_ADDITIVE
|
||||
|
||||
#pragma multi_compile_shadowcaster
|
||||
#pragma shader_feature_local _ _CFXR_DITHERED_SHADOWS_ON _CFXR_DITHERED_SHADOWS_CUSTOMTEXTURE
|
||||
|
||||
#if (_CFXR_DITHERED_SHADOWS_ON || _CFXR_DITHERED_SHADOWS_CUSTOMTEXTURE) && !defined(SHADER_API_GLES)
|
||||
#pragma target 3.0 //needed for VPOS
|
||||
#endif
|
||||
|
||||
#define CFXR_UPR
|
||||
#define PASS_SHADOW_CASTER
|
||||
#define CFXR_UBERSHADER
|
||||
#include "CFXR_PASSES.cginc"
|
||||
|
||||
ENDCG
|
||||
}
|
||||
}
|
||||
/*** END URP ***/
|
||||
|
||||
/*** BIRP ***/
|
||||
//====================================================================================================================================
|
||||
// Built-in Rendering Pipeline
|
||||
|
||||
SubShader
|
||||
{
|
||||
Pass
|
||||
{
|
||||
Name "BASE"
|
||||
Tags { "LightMode"="ForwardBase" }
|
||||
|
||||
CGPROGRAM
|
||||
|
||||
#pragma vertex vertex_program
|
||||
#pragma fragment fragment_program
|
||||
|
||||
//vertInstancingSetup writes to global, not allowed with DXC
|
||||
// #pragma never_use_dxc
|
||||
// #pragma target 2.5
|
||||
// #pragma multi_compile_instancing
|
||||
// #pragma instancing_options procedural:vertInstancingSetup
|
||||
|
||||
#pragma multi_compile_particles
|
||||
#pragma multi_compile_fog
|
||||
//#pragma multi_compile_fwdbase
|
||||
//#pragma multi_compile SHADOWS_SCREEN
|
||||
|
||||
#pragma shader_feature_local _ _CFXR_DISSOLVE
|
||||
#pragma shader_feature_local_fragment _ _CFXR_UV_DISTORTION
|
||||
// #pragma shader_feature_local _ _CFXR_GRADIENTMAP
|
||||
#pragma shader_feature_local _ _CFXR_SECONDCOLOR_LERP _CFXR_FONT_COLORS
|
||||
#pragma shader_feature_local_fragment _ _CFXR_OVERLAYTEX_1X _CFXR_OVERLAYTEX_2X
|
||||
#pragma shader_feature_local _ _CFXR_EDGE_FADING
|
||||
#pragma shader_feature_local _ _CFXR_LIGHTING_DIRECT _CFXR_LIGHTING_INDIRECT _CFXR_LIGHTING_ALL
|
||||
#pragma shader_feature_local _ _CFXR_LIGHTING_WPOS_OFFSET
|
||||
#pragma shader_feature_local _ _CFXR_LIGHTING_BACK
|
||||
|
||||
// Using the same keywords as Unity's Standard Particle shader to minimize project-wide keyword usage
|
||||
#pragma shader_feature_local _ _NORMALMAP
|
||||
#pragma shader_feature_local _ _EMISSION
|
||||
#pragma shader_feature_local_fragment _ _FLIPBOOK_BLENDING
|
||||
#pragma shader_feature_local _ _FADING_ON
|
||||
#pragma shader_feature_local_fragment _ _ALPHATEST_ON
|
||||
#pragma shader_feature_local_fragment _ _ALPHABLEND_ON _ALPHAPREMULTIPLY_ON _ALPHAMODULATE_ON _CFXR_ADDITIVE
|
||||
|
||||
#include "UnityStandardParticleInstancing.cginc"
|
||||
#define CFXR_UBERSHADER
|
||||
#include "CFXR_PASSES.cginc"
|
||||
|
||||
ENDCG
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
Pass
|
||||
{
|
||||
Name "ShadowCaster"
|
||||
Tags { "LightMode" = "ShadowCaster" }
|
||||
|
||||
BlendOp Add
|
||||
Blend One Zero
|
||||
ZWrite On
|
||||
Cull Off
|
||||
|
||||
CGPROGRAM
|
||||
|
||||
#pragma vertex vertex_program
|
||||
#pragma fragment fragment_program
|
||||
|
||||
//vertInstancingSetup writes to global, not allowed with DXC
|
||||
// #pragma never_use_dxc
|
||||
// #pragma target 2.5
|
||||
// #pragma multi_compile_instancing
|
||||
// #pragma instancing_options procedural:vertInstancingSetup
|
||||
|
||||
#pragma shader_feature_local _ _CFXR_DISSOLVE
|
||||
#pragma shader_feature_local_fragment _ _CFXR_UV_DISTORTION
|
||||
#pragma shader_feature_local_fragment _ _CFXR_OVERLAYTEX_1X _CFXR_OVERLAYTEX_2X
|
||||
#pragma shader_feature_local_fragment _ _FLIPBOOK_BLENDING
|
||||
|
||||
#pragma shader_feature_local_fragment _ _ALPHATEST_ON
|
||||
#pragma shader_feature_local_fragment _ _ALPHABLEND_ON _ALPHAPREMULTIPLY_ON _ALPHAMODULATE_ON _CFXR_ADDITIVE
|
||||
|
||||
#pragma multi_compile_shadowcaster
|
||||
#pragma shader_feature_local _ _CFXR_DITHERED_SHADOWS_ON _CFXR_DITHERED_SHADOWS_CUSTOMTEXTURE
|
||||
|
||||
#if (_CFXR_DITHERED_SHADOWS_ON || _CFXR_DITHERED_SHADOWS_CUSTOMTEXTURE) && !defined(SHADER_API_GLES)
|
||||
#pragma target 3.0 //needed for VPOS
|
||||
#endif
|
||||
|
||||
#include "UnityStandardParticleInstancing.cginc"
|
||||
|
||||
#define PASS_SHADOW_CASTER
|
||||
#define CFXR_UBERSHADER
|
||||
#include "CFXR_PASSES.cginc"
|
||||
|
||||
ENDCG
|
||||
}
|
||||
}
|
||||
/*** END BIRP ***/
|
||||
}
|
||||
|
||||
CustomEditor "CartoonFX.MaterialInspector"
|
||||
}
|
||||
|
||||
@@ -0,0 +1,206 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 1a29b4d27eb8b04479ef89c00dea533d
|
||||
ScriptedImporter:
|
||||
internalIDToNameTable: []
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
script: {fileID: 11500000, guid: fe56ec25963759b49955809beeb4324b, type: 3}
|
||||
detectedRenderPipeline: Built-In Render Pipeline
|
||||
strippedLinesCount: 0
|
||||
shaderSourceCode: "//--------------------------------------------------------------------------------------------------------------------------------\r\n//
|
||||
Cartoon FX\r\n// (c) 2012-2020 Jean Moreno\r\n//--------------------------------------------------------------------------------------------------------------------------------\r\n\r\nShader
|
||||
\"Cartoon FX/Remaster/Particle Ubershader\"\r\n{\r\n\tProperties\r\n\t{\r\n\t//#
|
||||
Blending\r\n\t//#\r\n\t\t[Enum(UnityEngine.Rendering.BlendMode)] _SrcBlend (\"Blend
|
||||
Source\", Float) = 5\r\n\t\t[Enum(UnityEngine.Rendering.BlendMode)] _DstBlend
|
||||
(\"Blend Destination\", Float) = 10\r\n\t\t[KeywordEnumNoPrefix(Alpha Blending,
|
||||
_ALPHABLEND_ON, Alpha Blending Premultiplied, _ALPHAPREMULTIPLY_ON, Multiplicative,
|
||||
_ALPHAMODULATE_ON, Additive, _CFXR_ADDITIVE)] _BlendingType (\"Blending Type\",
|
||||
Float) = 0\r\n\r\n\t//# \r\n\t\t[ToggleNoKeyword] _ZWrite (\"Depth Write\", Float)
|
||||
= 0\r\n\t\t[Toggle(_ALPHATEST_ON)] _UseAlphaClip (\"Alpha Clipping (Cutout)\",
|
||||
Float) = 0\r\n\t//# IF_KEYWORD _ALPHATEST_ON\r\n\t\t_Cutoff (\"Cutoff Threshold\",
|
||||
Range(0.001,1)) = 0.1\r\n\t//# END_IF\r\n\t\r\n\t//# --------------------------------------------------------\r\n\t\r\n\t\t[Toggle(_FADING_ON)]
|
||||
_UseSP (\"Soft Particles\", Float) = 0\r\n\t//# IF_KEYWORD _FADING_ON\r\n\t\t_SoftParticlesFadeDistanceNear
|
||||
(\"Near Fade\", Float) = 0\r\n\t\t_SoftParticlesFadeDistanceFar (\"Far Fade\",
|
||||
Float) = 1\r\n\t//# END_IF\r\n\r\n\t//# \r\n\r\n\t\t[Toggle(_CFXR_EDGE_FADING)]
|
||||
_UseEF (\"Edge Fade\", Float) = 0\r\n\t//# IF_KEYWORD _CFXR_EDGE_FADING\r\n\t\t_EdgeFadePow
|
||||
(\"Edge Fade Power\", Float) = 1\r\n\t//# END_IF\r\n\r\n\t//# \r\n\r\n\t//# ========================================================\r\n\r\n\t//#
|
||||
Effects\r\n\t//#\r\n\r\n\t\t[Toggle(_CFXR_DISSOLVE)] _UseDissolve (\"Enable Dissolve\",
|
||||
Float) = 0\r\n\t//# IF_KEYWORD _CFXR_DISSOLVE\r\n\t\t_DissolveTex (\"Dissolve
|
||||
Texture\", 2D) = \"gray\" {}\r\n\t\t_DissolveSmooth (\"Dissolve Smoothing\",
|
||||
Range(0.0001,0.5)) = 0.1\r\n\t\t[ToggleNoKeyword] _InvertDissolveTex (\"Invert
|
||||
Dissolve Texture\", Float) = 0\r\n\t\t[ToggleNoKeyword] _DoubleDissolve (\"Double
|
||||
Dissolve\", Float) = 0\r\n\t\t[Toggle(_CFXR_DISSOLVE_ALONG_UV_X)] _UseDissolveOffsetUV
|
||||
(\"Dissolve offset along X\", Float) = 0\r\n\t//# IF_KEYWORD _CFXR_DISSOLVE_ALONG_UV_X\r\n\t\t_DissolveScroll
|
||||
(\"UV Scrolling\", Vector) = (0,0,0,0)\r\n\t//# END_IF\r\n\t//# END_IF\r\n\r\n\t//#
|
||||
--------------------------------------------------------\r\n\r\n\t\t[Toggle(_CFXR_UV_DISTORTION)]
|
||||
_UseUVDistortion (\"Enable UV Distortion\", Float) = 0\r\n\t//# IF_KEYWORD _CFXR_UV_DISTORTION\r\n\t\t\r\n\t\t[NoScaleOffset]
|
||||
_DistortTex (\"Distortion Texture\", 2D) = \"gray\" {}\r\n\t\t_DistortScrolling
|
||||
(\"Scroll (XY) Tile (ZW)\", Vector) = (0,0,1,1)\r\n\t\t[Toggle(_CFXR_UV2_DISTORTION)]
|
||||
_UseUV2Distortion (\"Use UV2\", Float) = 0\r\n\t\t_Distort (\"Distortion Strength\",
|
||||
Range(0,2.0)) = 0.1\r\n\t\t[ToggleNoKeyword] _FadeAlongU (\"Fade along Y\", Float)
|
||||
= 0\r\n\t\t[Toggle(_CFXR_UV_DISTORTION_ADD)] _UVDistortionAdd (\"Add to base
|
||||
UV\", Float) = 0\r\n\t//# END_IF\r\n\r\n\t//# ========================================================\r\n\r\n\t//#
|
||||
Colors\r\n\t//#\r\n\r\n\t\t[NoScaleOffset] _MainTex (\"Texture\", 2D) = \"white\"
|
||||
{}\r\n\t\t[Toggle(_CFXR_SINGLE_CHANNEL)] _SingleChannel (\"Single Channel Texture\",
|
||||
Float) = 0\r\n\r\n\t//# --------------------------------------------------------\r\n\r\n\t\t[KeywordEnum(Off,1x,2x)]
|
||||
_CFXR_OVERLAYTEX (\"Enable Overlay Texture\", Float) = 0\r\n\t//# IF_KEYWORD
|
||||
_CFXR_OVERLAYTEX_1X || _CFXR_OVERLAYTEX_2X\r\n\t\t[KeywordEnum(RGBA,RGB,A)] _CFXR_OVERLAYBLEND
|
||||
(\"Overlay Blend Channels\", Float) = 0\r\n\t\t[NoScaleOffset] _OverlayTex (\"Overlay
|
||||
Texture\", 2D) = \"white\" {}\r\n\t\t_OverlayTex_Scroll (\"Overlay Scrolling
|
||||
/ Scale\", Vector) = (0.1,0.1,1,1)\r\n\t//# END_IF\r\n\r\n\t//# --------------------------------------------------------\r\n\r\n\t\t[Toggle(_FLIPBOOK_BLENDING)]
|
||||
_UseFB (\"Flipbook Blending\", Float) = 0\r\n\r\n\t//# --------------------------------------------------------\r\n\r\n\t\t[Toggle(_CFXR_SECONDCOLOR_LERP)]
|
||||
_UseSecondColor (\"Secondary Vertex Color (TEXCOORD2)\", Float) = 0\r\n\t//#
|
||||
IF_KEYWORD _CFXR_SECONDCOLOR_LERP\r\n\t\t[NoScaleOffset] _SecondColorTex (\"Second
|
||||
Color Map\", 2D) = \"black\" {}\r\n\t\t_SecondColorSmooth (\"Second Color Smoothing\",
|
||||
Range(0.0001,0.5)) = 0.2\r\n\t//# END_IF\r\n\r\n\t//# --------------------------------------------------------\r\n\r\n\t\t[Toggle(_CFXR_FONT_COLORS)]
|
||||
_UseFontColor (\"Use Font Colors\", Float) = 0\r\n\r\n//\t//# --------------------------------------------------------\r\n//\r\n//\t[Toggle(_CFXR_GRADIENTMAP)]
|
||||
_UseGradientMap (\"Gradient Map\", Float) = 0\r\n//\t//# IF_KEYWORD _CFXR_GRADIENTMAP\r\n//\t\t[NoScaleOffset]
|
||||
_GradientMap (\"Gradient Map\", 2D) = \"black\" {}\r\n//\t//# END_IF\r\n\r\n\t//#
|
||||
--------------------------------------------------------\r\n\r\n\t\t[Toggle(_CFXR_HDR_BOOST)]
|
||||
_HdrBoost (\"Enable HDR Multiplier\", Float) = 0\r\n\t//# IF_KEYWORD _CFXR_HDR_BOOST\r\n\t\t
|
||||
_HdrMultiply (\"HDR Multiplier\", Float) = 2\r\n\t//# END_IF\r\n\r\n\t//# --------------------------------------------------------\r\n\t\r\n\t//#
|
||||
Lighting\r\n\t//#\r\n\r\n\t\t[KeywordEnumNoPrefix(Off, _, Direct, _CFXR_LIGHTING_DIRECT,
|
||||
Indirect, _CFXR_LIGHTING_INDIRECT, Both, _CFXR_LIGHTING_ALL)] _UseLighting (\"Mode\",
|
||||
Float) = 0\r\n\t//# IF_KEYWORD _CFXR_LIGHTING_DIRECT || _CFXR_LIGHTING_ALL\r\n\t\t_DirectLightingRamp
|
||||
(\"Direct Lighting Ramp\", Range(0,1)) = 1.0\r\n\t//# END_IF\r\n\t//# \r\n\t//#
|
||||
IF_KEYWORD _CFXR_LIGHTING_DIRECT || _CFXR_LIGHTING_INDIRECT || _CFXR_LIGHTING_ALL\r\n\t\t[Toggle(_NORMALMAP)]
|
||||
_UseNormalMap (\"Enable Normal Map\", Float) = 0\r\n\t//# IF_KEYWORD _NORMALMAP\r\n\t\t[NoScaleOffset]
|
||||
_BumpMap (\"Normal Map\", 2D) = \"bump\" {}\r\n\t\t_BumpScale (\"Normal Scale\",
|
||||
Range(-1, 1)) = 1.0\r\n\t//# END_IF\r\n\t//# \r\n\t\t[Toggle(_EMISSION)] _UseEmission
|
||||
(\"Enable Emission (TEXCOORD2)\", Float) = 0\r\n\t//# \r\n\t\t[Toggle(_CFXR_LIGHTING_WPOS_OFFSET)]
|
||||
_UseLightingWorldPosOffset (\"Enable World Pos. Offset\", Float) = 0\r\n\t//#
|
||||
IF_KEYWORD _CFXR_LIGHTING_WPOS_OFFSET\r\n\t\t_LightingWorldPosStrength (\"Offset
|
||||
Strength\", Range(0,1)) = 0.2\r\n\t//# END_IF\r\n\t//# \r\n\t\t[Toggle(_CFXR_LIGHTING_BACK)]
|
||||
_UseBackLighting (\"Enable Backlighting\", Float) = 0\r\n\t//# IF_KEYWORD _CFXR_LIGHTING_BACK\r\n\t\t_DirLightScreenAtten
|
||||
(\"Dir. Light Screen Attenuation\", Range(0, 5)) = 1.0\r\n\t\t_BacklightTransmittance
|
||||
(\"Backlight Transmittance\", Range(0, 2)) = 1.0\r\n\t//# END_IF\r\n\t//# \r\n\t//#
|
||||
IF_KEYWORD _CFXR_LIGHTING_INDIRECT || _CFXR_LIGHTING_ALL\r\n\t\t_IndirectLightingMix
|
||||
(\"Indirect Lighting Mix\", Range(0,1)) = 0.5\r\n\t//# END_IF\r\n\t\t_ShadowColor
|
||||
(\"Shadow Color\", Color) = (0,0,0,1)\r\n\t//# \r\n\t//# END_IF\r\n\r\n\t//#
|
||||
========================================================\r\n\t//# Shadows\r\n\t//#\r\n\r\n\t\t[KeywordEnum(Off,On,CustomTexture)]
|
||||
_CFXR_DITHERED_SHADOWS (\"Dithered Shadows\", Float) = 0\r\n\t//# IF_KEYWORD
|
||||
_CFXR_DITHERED_SHADOWS_ON || _CFXR_DITHERED_SHADOWS_CUSTOMTEXTURE\r\n\t\t_ShadowStrength\t\t(\"Shadows
|
||||
Strength Max\", Range(0,1)) = 1.0\r\n\t\t//#\tIF_KEYWORD _CFXR_DITHERED_SHADOWS_CUSTOMTEXTURE\r\n\t\t_DitherCustom\t\t(\"Dithering
|
||||
3D Texture\", 3D) = \"black\" {}\r\n\t\t//#\tEND_IF\r\n\t//# END_IF\r\n\r\n//\t\t_ReceivedShadowsStrength
|
||||
(\"Received Shadows Strength\", Range(0,1)) = 0.5\r\n\t}\r\n\t\r\n\tCategory\r\n\t{\r\n\t\tTags\r\n\t\t{\r\n\t\t\t\"Queue\"=\"Transparent\"\r\n\t\t\t\"IgnoreProjector\"=\"True\"\r\n\t\t\t\"RenderType\"=\"Transparent\"\r\n\t\t\t\"PreviewType\"=\"Plane\"\r\n\t\t}\r\n\r\n\t\tBlend
|
||||
[_SrcBlend] [_DstBlend], One One\r\n\t\tZWrite [_ZWrite]\r\n\t\tCull Off\r\n\r\n\t\t//====================================================================================================================================\r\n\t\t//
|
||||
Universal Rendering Pipeline\r\n\r\n\t\tSubshader\r\n\t\t{\r\n\t\t\tPass\r\n\t\t\t{\r\n\t\t\t\tName
|
||||
\"BASE_URP\"\r\n\t\t\t\tTags { \"LightMode\"=\"UniversalForward\" }\r\n\r\n\t\t\t\tCGPROGRAM\r\n\r\n\t\t\t\t#pragma
|
||||
vertex vertex_program\r\n\t\t\t\t#pragma fragment fragment_program\r\n\t\t\t\t\r\n\t\t\t\t#pragma
|
||||
target 2.0\r\n\t\t\t\t\r\n\t\t\t\t// #pragma multi_compile_instancing\r\n\t\t\t\t//
|
||||
#pragma instancing_options procedural:ParticleInstancingSetup\r\n\r\n\t\t\t\t#pragma
|
||||
multi_compile_fog\r\n\t\t\t\t//#pragma multi_compile_fwdbase\r\n\t\t\t\t//#pragma
|
||||
multi_compile SHADOWS_SCREEN\r\n\r\n\t\t\t\t#pragma shader_feature_local _ _CFXR_SINGLE_CHANNEL\r\n\t\t\t\t#pragma
|
||||
shader_feature_local _ _CFXR_DISSOLVE\r\n\t\t\t\t#pragma shader_feature_local
|
||||
_ _CFXR_DISSOLVE_ALONG_UV_X\r\n\t\t\t\t#pragma shader_feature_local _ _CFXR_UV_DISTORTION\r\n\t\t\t\t#pragma
|
||||
shader_feature_local _ _CFXR_UV2_DISTORTION\r\n\t\t\t\t#pragma shader_feature_local
|
||||
_ _CFXR_UV_DISTORTION_ADD\r\n\t\t\t\t// #pragma shader_feature_local _ _CFXR_GRADIENTMAP\r\n\t\t\t\t#pragma
|
||||
shader_feature_local _ _CFXR_SECONDCOLOR_LERP _CFXR_FONT_COLORS\r\n\t\t\t\t#pragma
|
||||
shader_feature_local _ _CFXR_OVERLAYTEX_1X _CFXR_OVERLAYTEX_2X\r\n\t\t\t\t#pragma
|
||||
shader_feature_local _ _CFXR_OVERLAYBLEND_A _CFXR_OVERLAYBLEND_RGB\r\n\t\t\t\t#pragma
|
||||
shader_feature_local _ _CFXR_HDR_BOOST\r\n\t\t\t\t#pragma shader_feature_local
|
||||
_ _CFXR_EDGE_FADING\r\n\t\t\t\t#pragma shader_feature_local _ _CFXR_LIGHTING_DIRECT
|
||||
_CFXR_LIGHTING_INDIRECT _CFXR_LIGHTING_ALL\r\n\t\t\t\t#pragma shader_feature_local
|
||||
_ _CFXR_LIGHTING_WPOS_OFFSET\r\n\t\t\t\t#pragma shader_feature_local _ _CFXR_LIGHTING_BACK\r\n\r\n\t\t\t\t//
|
||||
Using the same keywords as Unity's Standard Particle shader to minimize project-wide
|
||||
keyword usage\r\n\t\t\t\t#pragma shader_feature_local _ _NORMALMAP\r\n\t\t\t\t#pragma
|
||||
shader_feature_local _ _EMISSION\r\n\t\t\t\t#pragma shader_feature_local _ _FLIPBOOK_BLENDING\r\n\t\t\t\t#pragma
|
||||
shader_feature_local _ _FADING_ON\r\n\t\t\t\t#pragma shader_feature_local _ _ALPHATEST_ON\r\n\t\t\t\t#pragma
|
||||
shader_feature_local _ _ALPHABLEND_ON _ALPHAPREMULTIPLY_ON _ALPHAMODULATE_ON
|
||||
_CFXR_ADDITIVE\r\n\r\n\t\t\t\t#define CFXR_URP\r\n\t\t\t\t#define CFXR_UBERSHADER\r\n\t\t\t\t#include
|
||||
\"CFXR_PASSES.cginc\"\r\n\r\n\t\t\t\tENDCG\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// Same
|
||||
as above with 'Universal2D' instead and DISABLE_SOFT_PARTICLES keyword\r\n\t\t\tPass\r\n\t\t\t{\r\n\t\t\t\tName
|
||||
\"BASE_URP\"\r\n\t\t\t\tTags { \"LightMode\"=\"Universal2D\" }\r\n\r\n\t\t\t\tCGPROGRAM\r\n\r\n\t\t\t\t#pragma
|
||||
vertex vertex_program\r\n\t\t\t\t#pragma fragment fragment_program\r\n\t\t\t\t\r\n\t\t\t\t#pragma
|
||||
target 2.0\r\n\t\t\t\t\r\n\t\t\t\t// #pragma multi_compile_instancing\r\n\t\t\t\t//
|
||||
#pragma instancing_options procedural:ParticleInstancingSetup\r\n\r\n\t\t\t\t#pragma
|
||||
multi_compile_fog\r\n\t\t\t\t//#pragma multi_compile_fwdbase\r\n\t\t\t\t//#pragma
|
||||
multi_compile SHADOWS_SCREEN\r\n\r\n\t\t\t\t#pragma shader_feature_local _ _CFXR_SINGLE_CHANNEL\r\n\t\t\t\t#pragma
|
||||
shader_feature_local _ _CFXR_DISSOLVE\r\n\t\t\t\t#pragma shader_feature_local
|
||||
_ _CFXR_DISSOLVE_ALONG_UV_X\r\n\t\t\t\t#pragma shader_feature_local _ _CFXR_UV_DISTORTION\r\n\t\t\t\t#pragma
|
||||
shader_feature_local _ _CFXR_UV2_DISTORTION\r\n\t\t\t\t#pragma shader_feature_local
|
||||
_ _CFXR_UV_DISTORTION_ADD\r\n\t\t\t\t// #pragma shader_feature_local _ _CFXR_GRADIENTMAP\r\n\t\t\t\t#pragma
|
||||
shader_feature_local _ _CFXR_SECONDCOLOR_LERP _CFXR_FONT_COLORS\r\n\t\t\t\t#pragma
|
||||
shader_feature_local _ _CFXR_OVERLAYTEX_1X _CFXR_OVERLAYTEX_2X\r\n\t\t\t\t#pragma
|
||||
shader_feature_local _ _CFXR_OVERLAYBLEND_A _CFXR_OVERLAYBLEND_RGB\r\n\t\t\t\t#pragma
|
||||
shader_feature_local _ _CFXR_HDR_BOOST\r\n\t\t\t\t#pragma shader_feature_local
|
||||
_ _CFXR_EDGE_FADING\r\n\t\t\t\t#pragma shader_feature_local _ _CFXR_LIGHTING_DIRECT
|
||||
_CFXR_LIGHTING_INDIRECT _CFXR_LIGHTING_ALL\r\n\t\t\t\t#pragma shader_feature_local
|
||||
_ _CFXR_LIGHTING_WPOS_OFFSET\r\n\t\t\t\t#pragma shader_feature_local _ _CFXR_LIGHTING_BACK\r\n\r\n\t\t\t\t//
|
||||
Using the same keywords as Unity's Standard Particle shader to minimize project-wide
|
||||
keyword usage\r\n\t\t\t\t#pragma shader_feature_local _ _NORMALMAP\r\n\t\t\t\t#pragma
|
||||
shader_feature_local _ _EMISSION\r\n\t\t\t\t#pragma shader_feature_local _ _FLIPBOOK_BLENDING\r\n\t\t\t\t#pragma
|
||||
shader_feature_local _ _FADING_ON\r\n\t\t\t\t#pragma shader_feature_local _ _ALPHATEST_ON\r\n\t\t\t\t#pragma
|
||||
shader_feature_local _ _ALPHABLEND_ON _ALPHAPREMULTIPLY_ON _ALPHAMODULATE_ON
|
||||
_CFXR_ADDITIVE\r\n\r\n\t\t\t\t#define CFXR_UPR\r\n\t\t\t\t#define DISABLE_SOFT_PARTICLES\r\n\t\t\t\t#define
|
||||
CFXR_UBERSHADER\r\n\t\t\t\t#include \"CFXR_PASSES.cginc\"\r\n\r\n\t\t\t\tENDCG\r\n\t\t\t}\r\n\r\n\t\t\t//--------------------------------------------------------------------------------------------------------------------------------\r\n\r\n\t\t\tPass\r\n\t\t\t{\r\n\t\t\t\tName
|
||||
\"ShadowCaster\"\r\n\t\t\t\tTags { \"LightMode\" = \"ShadowCaster\" }\r\n\r\n\t\t\t\tBlendOp
|
||||
Add\r\n\t\t\t\tBlend One Zero\r\n\t\t\t\tZWrite On\r\n\t\t\t\tCull Off\r\n\r\n\t\t\t\tCGPROGRAM\r\n\r\n\t\t\t\t#pragma
|
||||
vertex vertex_program\r\n\t\t\t\t#pragma fragment fragment_program\r\n\r\n\t\t\t\t#pragma
|
||||
shader_feature_local _ _CFXR_SINGLE_CHANNEL\r\n\t\t\t\t#pragma shader_feature_local
|
||||
_ _CFXR_DISSOLVE\r\n\t\t\t\t#pragma shader_feature_local _ _CFXR_DISSOLVE_ALONG_UV_X\r\n\t\t\t\t#pragma
|
||||
shader_feature_local _ _CFXR_UV_DISTORTION\r\n\t\t\t\t#pragma shader_feature_local
|
||||
_ _CFXR_UV2_DISTORTION\r\n\t\t\t\t#pragma shader_feature_local _ _CFXR_UV_DISTORTION_ADD\r\n\t\t\t\t#pragma
|
||||
shader_feature_local _ _CFXR_OVERLAYTEX_1X _CFXR_OVERLAYTEX_2X\r\n\t\t\t\t#pragma
|
||||
shader_feature_local _ _CFXR_OVERLAYBLEND_A _CFXR_OVERLAYBLEND_RGB\r\n\t\t\t\t#pragma
|
||||
shader_feature_local _ _FLIPBOOK_BLENDING\r\n\r\n\t\t\t\t#pragma shader_feature_local
|
||||
_ _ALPHATEST_ON\r\n\t\t\t\t#pragma shader_feature_local _ _ALPHABLEND_ON _ALPHAPREMULTIPLY_ON
|
||||
_ALPHAMODULATE_ON _CFXR_ADDITIVE\r\n\r\n\t\t\t\t#pragma multi_compile_shadowcaster\r\n\t\t\t\t#pragma
|
||||
shader_feature_local _ _CFXR_DITHERED_SHADOWS_ON _CFXR_DITHERED_SHADOWS_CUSTOMTEXTURE\r\n\r\n\t\t\t#if
|
||||
(_CFXR_DITHERED_SHADOWS_ON || _CFXR_DITHERED_SHADOWS_CUSTOMTEXTURE) && !defined(SHADER_API_GLES)\r\n\t\t\t\t#pragma
|
||||
target 3.0\t\t//needed for VPOS\r\n\t\t\t#endif\r\n\r\n\t\t\t\t#define CFXR_UPR\r\n\t\t\t\t#define
|
||||
PASS_SHADOW_CASTER\r\n\t\t\t\t#define CFXR_UBERSHADER\r\n\t\t\t\t#include \"CFXR_PASSES.cginc\"\r\n\r\n\t\t\t\tENDCG\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t//====================================================================================================================================\r\n\t\t//
|
||||
Built-in Rendering Pipeline\r\n\r\n\t\tSubShader\r\n\t\t{\r\n\t\t\tPass\r\n\t\t\t{\r\n\t\t\t\tName
|
||||
\"BASE\"\r\n\t\t\t\tTags { \"LightMode\"=\"ForwardBase\" }\r\n\r\n\t\t\t\tCGPROGRAM\r\n\r\n\t\t\t\t#pragma
|
||||
vertex vertex_program\r\n\t\t\t\t#pragma fragment fragment_program\r\n\r\n\t\t\t\t//vertInstancingSetup
|
||||
writes to global, not allowed with DXC\r\n\t\t\t\t// #pragma never_use_dxc\r\n\t\t\t\t//
|
||||
#pragma target 2.5\r\n\t\t\t\t// #pragma multi_compile_instancing\r\n\t\t\t\t//
|
||||
#pragma instancing_options procedural:vertInstancingSetup\r\n\r\n\t\t\t\t#pragma
|
||||
multi_compile_particles\r\n\t\t\t\t#pragma multi_compile_fog\r\n\t\t\t\t//#pragma
|
||||
multi_compile_fwdbase\r\n\t\t\t\t//#pragma multi_compile SHADOWS_SCREEN\r\n\r\n\t\t\t\t#pragma
|
||||
shader_feature_local _ _CFXR_SINGLE_CHANNEL\r\n\t\t\t\t#pragma shader_feature_local
|
||||
_ _CFXR_DISSOLVE\r\n\t\t\t\t#pragma shader_feature_local _ _CFXR_DISSOLVE_ALONG_UV_X\r\n\t\t\t\t#pragma
|
||||
shader_feature_local _ _CFXR_UV_DISTORTION\r\n\t\t\t\t#pragma shader_feature_local
|
||||
_ _CFXR_UV2_DISTORTION\r\n\t\t\t\t#pragma shader_feature_local _ _CFXR_UV_DISTORTION_ADD\r\n\t\t\t\t//
|
||||
#pragma shader_feature_local _ _CFXR_GRADIENTMAP\r\n\t\t\t\t#pragma shader_feature_local
|
||||
_ _CFXR_SECONDCOLOR_LERP _CFXR_FONT_COLORS\r\n\t\t\t\t#pragma shader_feature_local
|
||||
_ _CFXR_OVERLAYTEX_1X _CFXR_OVERLAYTEX_2X\r\n\t\t\t\t#pragma shader_feature_local
|
||||
_ _CFXR_OVERLAYBLEND_A _CFXR_OVERLAYBLEND_RGB\r\n\t\t\t\t#pragma shader_feature_local
|
||||
_ _CFXR_HDR_BOOST\r\n\t\t\t\t#pragma shader_feature_local _ _CFXR_EDGE_FADING\r\n\t\t\t\t#pragma
|
||||
shader_feature_local _ _CFXR_LIGHTING_DIRECT _CFXR_LIGHTING_INDIRECT _CFXR_LIGHTING_ALL\r\n\t\t\t\t#pragma
|
||||
shader_feature_local _ _CFXR_LIGHTING_WPOS_OFFSET\r\n\t\t\t\t#pragma shader_feature_local
|
||||
_ _CFXR_LIGHTING_BACK\r\n\r\n\t\t\t\t// Using the same keywords as Unity's Standard
|
||||
Particle shader to minimize project-wide keyword usage\r\n\t\t\t\t#pragma shader_feature_local
|
||||
_ _NORMALMAP\r\n\t\t\t\t#pragma shader_feature_local _ _EMISSION\r\n\t\t\t\t#pragma
|
||||
shader_feature_local _ _FLIPBOOK_BLENDING\r\n\t\t\t\t#pragma shader_feature_local
|
||||
_ _FADING_ON\r\n\t\t\t\t#pragma shader_feature_local _ _ALPHATEST_ON\r\n\t\t\t\t#pragma
|
||||
shader_feature_local _ _ALPHABLEND_ON _ALPHAPREMULTIPLY_ON _ALPHAMODULATE_ON
|
||||
_CFXR_ADDITIVE\r\n\r\n\t\t\t\t#include \"UnityStandardParticleInstancing.cginc\"\r\n\t\t\t\t#define
|
||||
CFXR_UBERSHADER\r\n\t\t\t\t#include \"CFXR_PASSES.cginc\"\r\n\r\n\t\t\t\tENDCG\r\n\t\t\t}\r\n\r\n\t\t\t//--------------------------------------------------------------------------------------------------------------------------------\r\n\r\n\t\t\tPass\r\n\t\t\t{\r\n\t\t\t\tName
|
||||
\"ShadowCaster\"\r\n\t\t\t\tTags { \"LightMode\" = \"ShadowCaster\" }\r\n\r\n\t\t\t\tBlendOp
|
||||
Add\r\n\t\t\t\tBlend One Zero\r\n\t\t\t\tZWrite On\r\n\t\t\t\tCull Off\r\n\r\n\t\t\t\tCGPROGRAM\r\n\r\n\t\t\t\t#pragma
|
||||
vertex vertex_program\r\n\t\t\t\t#pragma fragment fragment_program\r\n\r\n\t\t\t\t//vertInstancingSetup
|
||||
writes to global, not allowed with DXC\r\n\t\t\t\t// #pragma never_use_dxc\r\n\t\t\t\t//
|
||||
#pragma target 2.5\r\n\t\t\t\t// #pragma multi_compile_instancing\r\n\t\t\t\t//
|
||||
#pragma instancing_options procedural:vertInstancingSetup\r\n\r\n\t\t\t\t#pragma
|
||||
shader_feature_local _ _CFXR_SINGLE_CHANNEL\r\n\t\t\t\t#pragma shader_feature_local
|
||||
_ _CFXR_DISSOLVE\r\n\t\t\t\t#pragma shader_feature_local _ _CFXR_DISSOLVE_ALONG_UV_X\r\n\t\t\t\t#pragma
|
||||
shader_feature_local _ _CFXR_UV_DISTORTION\r\n\t\t\t\t#pragma shader_feature_local
|
||||
_ _CFXR_UV2_DISTORTION\r\n\t\t\t\t#pragma shader_feature_local _ _CFXR_UV_DISTORTION_ADD\r\n\t\t\t\t#pragma
|
||||
shader_feature_local _ _CFXR_OVERLAYTEX_1X _CFXR_OVERLAYTEX_2X\r\n\t\t\t\t#pragma
|
||||
shader_feature_local _ _CFXR_OVERLAYBLEND_A _CFXR_OVERLAYBLEND_RGB\r\n\t\t\t\t#pragma
|
||||
shader_feature_local _ _FLIPBOOK_BLENDING\r\n\r\n\t\t\t\t#pragma shader_feature_local
|
||||
_ _ALPHATEST_ON\r\n\t\t\t\t#pragma shader_feature_local _ _ALPHABLEND_ON _ALPHAPREMULTIPLY_ON
|
||||
_ALPHAMODULATE_ON _CFXR_ADDITIVE\r\n\r\n\t\t\t\t#pragma multi_compile_shadowcaster\r\n\t\t\t\t#pragma
|
||||
shader_feature_local _ _CFXR_DITHERED_SHADOWS_ON _CFXR_DITHERED_SHADOWS_CUSTOMTEXTURE\r\n\r\n\t\t\t#if
|
||||
(_CFXR_DITHERED_SHADOWS_ON || _CFXR_DITHERED_SHADOWS_CUSTOMTEXTURE) && !defined(SHADER_API_GLES)\r\n\t\t\t\t#pragma
|
||||
target 3.0\t\t//needed for VPOS\r\n\t\t\t#endif\r\n\r\n\t\t\t\t#include \"UnityStandardParticleInstancing.cginc\"\r\n\r\n\t\t\t\t#define
|
||||
PASS_SHADOW_CASTER\r\n\t\t\t\t#define CFXR_UBERSHADER\r\n\t\t\t\t#include \"CFXR_PASSES.cginc\"\r\n\r\n\t\t\t\tENDCG\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\tCustomEditor
|
||||
\"CartoonFX.MaterialInspector\"\r\n}\r\n\r\n"
|
||||
shaderName: Cartoon FX/Remaster/Particle Ubershader
|
||||
shaderErrors: []
|
||||
variantCount: 283253760
|
||||
variantCountUsed: 8
|
||||
@@ -0,0 +1,366 @@
|
||||
//--------------------------------------------------------------------------------------------------------------------------------
|
||||
// Cartoon FX
|
||||
// (c) 2012-2025 Jean Moreno
|
||||
//--------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
#if defined(UNITY_PARTICLE_INSTANCING_ENABLED)
|
||||
#pragma exclude_renderers gles
|
||||
#endif
|
||||
|
||||
#if defined(GLOBAL_DISABLE_SOFT_PARTICLES) && !defined(DISABLE_SOFT_PARTICLES)
|
||||
#define DISABLE_SOFT_PARTICLES
|
||||
#endif
|
||||
|
||||
#if defined(CFXR_URP)
|
||||
float LinearEyeDepthURP(float depth, float4 zBufferParam)
|
||||
{
|
||||
return 1.0 / (zBufferParam.z * depth + zBufferParam.w);
|
||||
}
|
||||
|
||||
float SoftParticles(float near, float far, float4 projection)
|
||||
{
|
||||
float sceneZ = SAMPLE_DEPTH_TEXTURE_PROJ(_CameraDepthTexture, UNITY_PROJ_COORD(projection)).r;
|
||||
|
||||
if (unity_OrthoParams.w == 1)
|
||||
{
|
||||
// orthographic camera
|
||||
#if defined(UNITY_REVERSED_Z)
|
||||
sceneZ = 1.0f - sceneZ;
|
||||
#endif
|
||||
sceneZ = (sceneZ * _ProjectionParams.z) + _ProjectionParams.y;
|
||||
}
|
||||
else
|
||||
{
|
||||
// perspective camera
|
||||
sceneZ = LinearEyeDepthURP(sceneZ, _ZBufferParams);
|
||||
}
|
||||
|
||||
float fade = saturate (far * ((sceneZ - near) - projection.z));
|
||||
return fade;
|
||||
}
|
||||
#else
|
||||
float SoftParticles(float near, float far, float4 projection)
|
||||
{
|
||||
float sceneZ = (SAMPLE_DEPTH_TEXTURE_PROJ(_CameraDepthTexture, UNITY_PROJ_COORD(projection)));
|
||||
if (unity_OrthoParams.w == 1)
|
||||
{
|
||||
// orthographic camera
|
||||
#if defined(UNITY_REVERSED_Z)
|
||||
sceneZ = 1.0f - sceneZ;
|
||||
#endif
|
||||
sceneZ = (sceneZ * _ProjectionParams.z) + _ProjectionParams.y;
|
||||
}
|
||||
else
|
||||
{
|
||||
// perspective camera
|
||||
sceneZ = LinearEyeDepth(sceneZ);
|
||||
}
|
||||
|
||||
float fade = saturate (far * ((sceneZ - near) - projection.z));
|
||||
return fade;
|
||||
}
|
||||
#endif
|
||||
|
||||
float LinearToGammaSpaceApprox(float value)
|
||||
{
|
||||
return max(1.055h * pow(value, 0.416666667h) - 0.055h, 0.h);
|
||||
}
|
||||
|
||||
// Same as UnityStandardUtils.cginc, but without the SHADER_TARGET limitation
|
||||
half3 UnpackScaleNormal_CFXR(half4 packednormal, half bumpScale)
|
||||
{
|
||||
#if defined(UNITY_NO_DXT5nm)
|
||||
half3 normal = packednormal.xyz * 2 - 1;
|
||||
// #if (SHADER_TARGET >= 30)
|
||||
// SM2.0: instruction count limitation
|
||||
// SM2.0: normal scaler is not supported
|
||||
normal.xy *= bumpScale;
|
||||
// #endif
|
||||
return normal;
|
||||
#else
|
||||
// This do the trick
|
||||
packednormal.x *= packednormal.w;
|
||||
|
||||
half3 normal;
|
||||
normal.xy = (packednormal.xy * 2 - 1);
|
||||
// #if (SHADER_TARGET >= 30)
|
||||
// SM2.0: instruction count limitation
|
||||
// SM2.0: normal scaler is not supported
|
||||
normal.xy *= bumpScale;
|
||||
// #endif
|
||||
normal.z = sqrt(1.0 - saturate(dot(normal.xy, normal.xy)));
|
||||
return normal;
|
||||
#endif
|
||||
}
|
||||
|
||||
//Macros
|
||||
|
||||
// Project Position
|
||||
#if !defined(PASS_SHADOW_CASTER) && !defined(GLOBAL_DISABLE_SOFT_PARTICLES) && !defined(DISABLE_SOFT_PARTICLES) && ( (defined(SOFTPARTICLES_ON) || defined(CFXR_URP) || defined(SOFT_PARTICLES_ORTHOGRAPHIC)) && defined(_FADING_ON) )
|
||||
#define vertProjPos(o, clipPos) \
|
||||
o.projPos = ComputeScreenPos(clipPos); \
|
||||
COMPUTE_EYEDEPTH(o.projPos.z);
|
||||
#else
|
||||
#define vertProjPos(o, clipPos)
|
||||
#endif
|
||||
|
||||
// Soft Particles
|
||||
#if !defined(PASS_SHADOW_CASTER) && !defined(GLOBAL_DISABLE_SOFT_PARTICLES) && !defined(DISABLE_SOFT_PARTICLES) && ((defined(SOFTPARTICLES_ON) || defined(CFXR_URP) || defined(SOFT_PARTICLES_ORTHOGRAPHIC)) && defined(_FADING_ON))
|
||||
#define fragSoftParticlesFade(i, color) \
|
||||
color *= SoftParticles(_SoftParticlesFadeDistanceNear, _SoftParticlesFadeDistanceFar, i.projPos);
|
||||
#else
|
||||
#define fragSoftParticlesFade(i, color)
|
||||
#endif
|
||||
|
||||
// Edge fade (note: particle meshes are already in world space)
|
||||
#if !defined(PASS_SHADOW_CASTER) && defined(_CFXR_EDGE_FADING)
|
||||
#define vertEdgeFade(v, color) \
|
||||
float3 viewDir = UnityWorldSpaceViewDir(v.vertex); \
|
||||
float ndv = abs(dot(normalize(viewDir), v.normal.xyz)); \
|
||||
color *= saturate(pow(ndv, _EdgeFadePow));
|
||||
#else
|
||||
#define vertEdgeFade(v, color)
|
||||
#endif
|
||||
|
||||
// Fog
|
||||
#if _ALPHABLEND_ON
|
||||
#define applyFog(i, color, alpha) UNITY_APPLY_FOG_COLOR(i.fogCoord, color, unity_FogColor);
|
||||
#elif _ALPHAPREMULTIPLY_ON
|
||||
#define applyFog(i, color, alpha) UNITY_APPLY_FOG_COLOR(i.fogCoord, color, alpha * unity_FogColor);
|
||||
#elif _CFXR_ADDITIVE
|
||||
#define applyFog(i, color, alpha) UNITY_APPLY_FOG_COLOR(i.fogCoord, color, half4(0, 0, 0, 0));
|
||||
#elif _ALPHAMODULATE_ON
|
||||
#define applyFog(i, color, alpha) UNITY_APPLY_FOG_COLOR(i.fogCoord, color, half4(1, 1, 1, 1));
|
||||
#else
|
||||
#define applyFog(i, color, alpha) UNITY_APPLY_FOG_COLOR(i.fogCoord, color, unity_FogColor);
|
||||
#endif
|
||||
|
||||
// Vertex program
|
||||
#if defined(PASS_SHADOW_CASTER)
|
||||
void vert(appdata v, v2f_shadowCaster o, out float4 opos)
|
||||
#else
|
||||
v2f vert(appdata v, v2f o)
|
||||
#endif
|
||||
{
|
||||
UNITY_TRANSFER_FOG(o, o.pos);
|
||||
vertProjPos(o, o.pos);
|
||||
vertEdgeFade(v, o.color.a);
|
||||
|
||||
#if defined(PASS_SHADOW_CASTER)
|
||||
TRANSFER_SHADOW_CASTER_NOPOS(o, opos);
|
||||
#else
|
||||
return o;
|
||||
#endif
|
||||
}
|
||||
|
||||
// Fragment program
|
||||
#if defined(PASS_SHADOW_CASTER)
|
||||
float4 frag(v2f_shadowCaster i, UNITY_VPOS_TYPE vpos, half3 particleColor, half particleAlpha, half dissolve, half dissolveTime, half doubleDissolveWidth) : SV_Target
|
||||
#else
|
||||
half4 frag(v2f i, half3 particleColor, half particleAlpha, half dissolve, half dissolveTime, half doubleDissolveWidth) : SV_Target
|
||||
#endif
|
||||
{
|
||||
#if _CFXR_DISSOLVE
|
||||
// Dissolve
|
||||
half time = lerp(-_DissolveSmooth, 1+_DissolveSmooth, dissolveTime);
|
||||
particleAlpha *= smoothstep(dissolve - _DissolveSmooth, dissolve + _DissolveSmooth, time);
|
||||
if (doubleDissolveWidth > 0)
|
||||
{
|
||||
half dissolveSubtract = smoothstep(dissolve - _DissolveSmooth, dissolve + _DissolveSmooth, time - doubleDissolveWidth);
|
||||
particleAlpha = saturate(particleAlpha - dissolveSubtract);
|
||||
}
|
||||
#endif
|
||||
|
||||
//Blending
|
||||
#if _ALPHAPREMULTIPLY_ON
|
||||
particleColor *= particleAlpha;
|
||||
#endif
|
||||
#if _ALPHAMODULATE_ON
|
||||
particleColor.rgb = lerp(float3(1,1,1), particleColor.rgb, particleAlpha);
|
||||
#endif
|
||||
|
||||
#if _ALPHATEST_ON
|
||||
clip(particleAlpha - _Cutoff);
|
||||
#endif
|
||||
|
||||
#if !defined(PASS_SHADOW_CASTER)
|
||||
// Fog & Soft Particles
|
||||
applyFog(i, particleColor, particleAlpha);
|
||||
fragSoftParticlesFade(i, particleAlpha);
|
||||
#endif
|
||||
|
||||
// Prevent alpha from exceeding 1
|
||||
particleAlpha = min(particleAlpha, 1.0);
|
||||
|
||||
#if !defined(PASS_SHADOW_CASTER)
|
||||
return float4(particleColor, particleAlpha);
|
||||
#else
|
||||
|
||||
//--------------------------------------------------------------------------------------------------------------------------------
|
||||
// Shadow Caster Pass
|
||||
|
||||
#if _CFXR_ADDITIVE
|
||||
half alpha = max(particleColor.r, max(particleColor.g, particleColor.b)) * particleAlpha;
|
||||
#else
|
||||
half alpha = particleAlpha;
|
||||
#endif
|
||||
|
||||
#if (_CFXR_DITHERED_SHADOWS_ON || _CFXR_DITHERED_SHADOWS_CUSTOMTEXTURE) && !defined(SHADER_API_GLES)
|
||||
alpha = min(alpha, _ShadowStrength);
|
||||
// Use dither mask for alpha blended shadows, based on pixel position xy
|
||||
// and alpha level. Our dither texture is 4x4x16.
|
||||
#if _CFXR_DITHERED_SHADOWS_CUSTOMTEXTURE
|
||||
half texSize = _DitherCustom_TexelSize.z;
|
||||
alpha = tex3D(_DitherCustom, float3(vpos.xy*(1 / texSize), alpha*(1 - (1 / (texSize*texSize))))).a;
|
||||
#else
|
||||
alpha = tex3D(_DitherMaskLOD, float3(vpos.xy*0.25, alpha*0.9375)).a;
|
||||
#endif
|
||||
#endif
|
||||
clip(alpha - 0.01);
|
||||
SHADOW_CASTER_FRAGMENT(i)
|
||||
#endif
|
||||
}
|
||||
|
||||
// ================================================================================================================================
|
||||
// ParticlesInstancing.hlsl
|
||||
// ================================================================================================================================
|
||||
|
||||
#if defined(CFXR_URP)
|
||||
#if defined(UNITY_PROCEDURAL_INSTANCING_ENABLED) && !defined(SHADER_TARGET_SURFACE_ANALYSIS)
|
||||
#define UNITY_PARTICLE_INSTANCING_ENABLED
|
||||
#endif
|
||||
|
||||
#if defined(UNITY_PARTICLE_INSTANCING_ENABLED)
|
||||
|
||||
#ifndef UNITY_PARTICLE_INSTANCE_DATA
|
||||
#define UNITY_PARTICLE_INSTANCE_DATA DefaultParticleInstanceData
|
||||
#endif
|
||||
|
||||
struct DefaultParticleInstanceData
|
||||
{
|
||||
float3x4 transform;
|
||||
uint color;
|
||||
float animFrame;
|
||||
};
|
||||
|
||||
StructuredBuffer<UNITY_PARTICLE_INSTANCE_DATA> unity_ParticleInstanceData;
|
||||
float4 unity_ParticleUVShiftData;
|
||||
float unity_ParticleUseMeshColors;
|
||||
|
||||
void ParticleInstancingMatrices(out float4x4 objectToWorld, out float4x4 worldToObject)
|
||||
{
|
||||
UNITY_PARTICLE_INSTANCE_DATA data = unity_ParticleInstanceData[unity_InstanceID];
|
||||
|
||||
// transform matrix
|
||||
objectToWorld._11_21_31_41 = float4(data.transform._11_21_31, 0.0f);
|
||||
objectToWorld._12_22_32_42 = float4(data.transform._12_22_32, 0.0f);
|
||||
objectToWorld._13_23_33_43 = float4(data.transform._13_23_33, 0.0f);
|
||||
objectToWorld._14_24_34_44 = float4(data.transform._14_24_34, 1.0f);
|
||||
|
||||
// inverse transform matrix (TODO: replace with a library implementation if/when available)
|
||||
float3x3 worldToObject3x3;
|
||||
worldToObject3x3[0] = objectToWorld[1].yzx * objectToWorld[2].zxy - objectToWorld[1].zxy * objectToWorld[2].yzx;
|
||||
worldToObject3x3[1] = objectToWorld[0].zxy * objectToWorld[2].yzx - objectToWorld[0].yzx * objectToWorld[2].zxy;
|
||||
worldToObject3x3[2] = objectToWorld[0].yzx * objectToWorld[1].zxy - objectToWorld[0].zxy * objectToWorld[1].yzx;
|
||||
|
||||
float det = dot(objectToWorld[0].xyz, worldToObject3x3[0]);
|
||||
|
||||
worldToObject3x3 = transpose(worldToObject3x3);
|
||||
|
||||
worldToObject3x3 *= rcp(det);
|
||||
|
||||
float3 worldToObjectPosition = mul(worldToObject3x3, -objectToWorld._14_24_34);
|
||||
|
||||
worldToObject._11_21_31_41 = float4(worldToObject3x3._11_21_31, 0.0f);
|
||||
worldToObject._12_22_32_42 = float4(worldToObject3x3._12_22_32, 0.0f);
|
||||
worldToObject._13_23_33_43 = float4(worldToObject3x3._13_23_33, 0.0f);
|
||||
worldToObject._14_24_34_44 = float4(worldToObjectPosition, 1.0f);
|
||||
}
|
||||
|
||||
void ParticleInstancingSetup()
|
||||
{
|
||||
ParticleInstancingMatrices(unity_ObjectToWorld, unity_WorldToObject);
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
void ParticleInstancingSetup() {}
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
||||
// ================================================================================================================================
|
||||
// Instancing functions
|
||||
// ================================================================================================================================
|
||||
|
||||
float4 UnpackFromR8G8B8A8(uint rgba)
|
||||
{
|
||||
return float4(rgba & 255, (rgba >> 8) & 255, (rgba >> 16) & 255, (rgba >> 24) & 255) * (1.0 / 255);
|
||||
}
|
||||
|
||||
half4 GetParticleColor(half4 color)
|
||||
{
|
||||
#if defined(UNITY_PARTICLE_INSTANCING_ENABLED)
|
||||
#if !defined(UNITY_PARTICLE_INSTANCE_DATA_NO_COLOR)
|
||||
UNITY_PARTICLE_INSTANCE_DATA data = unity_ParticleInstanceData[unity_InstanceID];
|
||||
color = lerp(half4(1.0, 1.0, 1.0, 1.0), color, unity_ParticleUseMeshColors);
|
||||
color *= UnpackFromR8G8B8A8(data.color);
|
||||
#endif
|
||||
#endif
|
||||
return color;
|
||||
}
|
||||
|
||||
void GetParticleTexcoords(out float2 outputTexcoord, out float2 outputTexcoord2, inout float outputBlend, in float4 inputTexcoords, in float inputBlend)
|
||||
{
|
||||
#if defined(UNITY_PARTICLE_INSTANCING_ENABLED)
|
||||
if (unity_ParticleUVShiftData.x != 0.0)
|
||||
{
|
||||
UNITY_PARTICLE_INSTANCE_DATA data = unity_ParticleInstanceData[unity_InstanceID];
|
||||
|
||||
float numTilesX = unity_ParticleUVShiftData.y;
|
||||
float2 animScale = unity_ParticleUVShiftData.zw;
|
||||
#ifdef UNITY_PARTICLE_INSTANCE_DATA_NO_ANIM_FRAME
|
||||
float sheetIndex = 0.0;
|
||||
#else
|
||||
float sheetIndex = data.animFrame;
|
||||
#endif
|
||||
|
||||
float index0 = floor(sheetIndex);
|
||||
float vIdx0 = floor(index0 / numTilesX);
|
||||
float uIdx0 = floor(index0 - vIdx0 * numTilesX);
|
||||
float2 offset0 = float2(uIdx0 * animScale.x, (1.0 - animScale.y) - vIdx0 * animScale.y); // Copied from built-in as is and it looks like upside-down flip
|
||||
|
||||
outputTexcoord = inputTexcoords.xy * animScale.xy + offset0.xy;
|
||||
|
||||
#ifdef _FLIPBOOKBLENDING_ON
|
||||
float index1 = floor(sheetIndex + 1.0);
|
||||
float vIdx1 = floor(index1 / numTilesX);
|
||||
float uIdx1 = floor(index1 - vIdx1 * numTilesX);
|
||||
float2 offset1 = float2(uIdx1 * animScale.x, (1.0 - animScale.y) - vIdx1 * animScale.y);
|
||||
|
||||
outputTexcoord2.xy = inputTexcoords.xy * animScale.xy + offset1.xy;
|
||||
outputBlend = frac(sheetIndex);
|
||||
#endif
|
||||
}
|
||||
else
|
||||
#endif
|
||||
{
|
||||
outputTexcoord = inputTexcoords.xy;
|
||||
#ifdef _FLIPBOOKBLENDING_ON
|
||||
outputTexcoord2.xy = inputTexcoords.zw;
|
||||
outputBlend = inputBlend;
|
||||
#endif
|
||||
}
|
||||
|
||||
#ifndef _FLIPBOOKBLENDING_ON
|
||||
outputTexcoord2.xy = inputTexcoords.xy;
|
||||
//outputBlend = 0.5;
|
||||
#endif
|
||||
}
|
||||
|
||||
void GetParticleTexcoords(out float2 outputTexcoord, in float2 inputTexcoord)
|
||||
{
|
||||
float2 dummyTexcoord2 = 0.0;
|
||||
float dummyBlend = 0.0;
|
||||
GetParticleTexcoords(outputTexcoord, dummyTexcoord2, dummyBlend, inputTexcoord.xyxy, 0.0);
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user