从旧版中移植,Prefab未确认
This commit is contained in:
95
Convention/[Art]/FullScreenTransition/FullscreenDissolve.cs
Normal file
95
Convention/[Art]/FullScreenTransition/FullscreenDissolve.cs
Normal file
@@ -0,0 +1,95 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using UnityEngine.Rendering;
|
||||
|
||||
namespace Convention
|
||||
{
|
||||
namespace VFX
|
||||
{
|
||||
#if UNITY_URP
|
||||
public class FullscreenDissolve : FullscreenEffect
|
||||
{
|
||||
[Setting, SerializeField] private List<string> IgnoreCameraTag = new();
|
||||
[Setting, SerializeField, Tooltip("PassMaterial.TransitionAmount")]
|
||||
private string TransitionAmount_Float = "_TransitionAmount";
|
||||
[Content, Setting] private bool DissolveNeeded = false;
|
||||
|
||||
[Setting, Header("Dissolve Setting")] public AnimationCurve DissolveZoomInCurve = AnimationCurve.Linear(0, 0, 1, 1);
|
||||
[Setting] public AnimationCurve DissolveZoomOutCurve = AnimationCurve.Linear(0, 0, 1, 1);
|
||||
[Setting] public float ZommInDuration = 0.5f;
|
||||
[Setting] public float ZommOutDuration = 0.5f;
|
||||
[Setting] public float StayDuration = 0.5f;
|
||||
|
||||
public override void SetEffectWeight([Percentage(0, 1)] float value)
|
||||
{
|
||||
this.PassMaterial.SetFloat(TransitionAmount_Float, value);
|
||||
}
|
||||
private IEnumerator Dissolving(Action midCallback, Action endCallback)
|
||||
{
|
||||
DissolveNeeded = true;
|
||||
float ticks = ZommInDuration;
|
||||
while (ticks > 0)
|
||||
{
|
||||
SetEffectWeight(DissolveZoomInCurve.Evaluate(1.0f - ticks / ZommInDuration));
|
||||
ticks -= Time.deltaTime;
|
||||
yield return null;
|
||||
}
|
||||
SetEffectWeight(1);
|
||||
midCallback();
|
||||
ticks = StayDuration;
|
||||
while (ticks > 0)
|
||||
{
|
||||
ticks -= Time.deltaTime;
|
||||
yield return null;
|
||||
}
|
||||
while (ticks < ZommOutDuration)
|
||||
{
|
||||
SetEffectWeight(DissolveZoomOutCurve.Evaluate(1.0f - ticks / ZommOutDuration));
|
||||
ticks += Time.deltaTime;
|
||||
yield return null;
|
||||
}
|
||||
SetEffectWeight(0);
|
||||
endCallback();
|
||||
DissolveNeeded = false;
|
||||
}
|
||||
|
||||
[Content,OnlyPlayMode]
|
||||
public void StartDissolve()
|
||||
{
|
||||
StopCoroutine("Dissolving");
|
||||
StartCoroutine(Dissolving(() => { }, () => { }));
|
||||
}
|
||||
public void StartDissolve(Action callback, bool isMid)
|
||||
{
|
||||
StopCoroutine("Dissolving");
|
||||
if (isMid)
|
||||
StartCoroutine(Dissolving(callback, () => { }));
|
||||
else
|
||||
StartCoroutine(Dissolving(() => { }, callback));
|
||||
}
|
||||
public void StartDissolve(Action midCallback, Action endCallback)
|
||||
{
|
||||
StopCoroutine("Dissolving");
|
||||
StartCoroutine(Dissolving(midCallback, endCallback));
|
||||
}
|
||||
|
||||
public override void OnBeginCamera(ScriptableRenderContext ctx, Camera cam)
|
||||
{
|
||||
foreach (var tag in IgnoreCameraTag)
|
||||
{
|
||||
if (cam.CompareTag(tag))
|
||||
return;
|
||||
}
|
||||
if (!DissolveNeeded)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
base.OnBeginCamera(ctx, cam);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: a5a3db8f679e3ee40b424f8a997797ed
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,10 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 93afaed801d082a47ac8a7eafd14328f
|
||||
ScriptedImporter:
|
||||
internalIDToNameTable: []
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
script: {fileID: 11500000, guid: 625f186215c104763be7675aa2d941aa, type: 3}
|
8
Convention/[Art]/FullScreenTransition/Template.meta
Normal file
8
Convention/[Art]/FullScreenTransition/Template.meta
Normal file
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: b38eca3ff78647546a350a3c41d16be7
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
48
Convention/[Art]/FullScreenTransition/Template/Template.mat
Normal file
48
Convention/[Art]/FullScreenTransition/Template/Template.mat
Normal file
@@ -0,0 +1,48 @@
|
||||
%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: Template
|
||||
m_Shader: {fileID: -6465566751694194690, guid: 93afaed801d082a47ac8a7eafd14328f, type: 3}
|
||||
m_Parent: {fileID: 0}
|
||||
m_ModifiedSerializedProperties: 0
|
||||
m_ValidKeywords: []
|
||||
m_InvalidKeywords: []
|
||||
m_LightmapFlags: 4
|
||||
m_EnableInstancingVariants: 0
|
||||
m_DoubleSidedGI: 0
|
||||
m_CustomRenderQueue: -1
|
||||
stringTagMap: {}
|
||||
disabledShaderPasses: []
|
||||
m_LockedProperties:
|
||||
m_SavedProperties:
|
||||
serializedVersion: 3
|
||||
m_TexEnvs:
|
||||
- _NoiseTex:
|
||||
m_Texture: {fileID: 2800000, guid: a8ec41410392c4940b63ebe455039d18, type: 3}
|
||||
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:
|
||||
- _GridScale: 4.9
|
||||
- _TransitionAmount: 0
|
||||
m_Colors:
|
||||
- _TransitionColor: {r: 44.72705, g: 43.99656, b: 24.684265, a: 1}
|
||||
m_BuildTextureStacks: []
|
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 852e8e3e607856b4b8ca035fe91f3377
|
||||
NativeFormatImporter:
|
||||
externalObjects: {}
|
||||
mainObjectFileID: 0
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
Binary file not shown.
After Width: | Height: | Size: 3.1 KiB |
@@ -0,0 +1,140 @@
|
||||
fileFormatVersion: 2
|
||||
guid: a8ec41410392c4940b63ebe455039d18
|
||||
TextureImporter:
|
||||
internalIDToNameTable: []
|
||||
externalObjects: {}
|
||||
serializedVersion: 13
|
||||
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
|
||||
flipGreenChannel: 0
|
||||
isReadable: 0
|
||||
streamingMipmaps: 0
|
||||
streamingMipmapsPriority: 0
|
||||
vTOnly: 0
|
||||
ignoreMipmapLimit: 0
|
||||
grayScaleToAlpha: 0
|
||||
generateCubemap: 6
|
||||
cubemapConvolution: 0
|
||||
seamlessCubemap: 0
|
||||
textureFormat: 1
|
||||
maxTextureSize: 2048
|
||||
textureSettings:
|
||||
serializedVersion: 2
|
||||
filterMode: 1
|
||||
aniso: 1
|
||||
mipBias: 0
|
||||
wrapU: 0
|
||||
wrapV: 0
|
||||
wrapW: 0
|
||||
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
|
||||
flipbookRows: 1
|
||||
flipbookColumns: 1
|
||||
maxTextureSizeSet: 0
|
||||
compressionQualitySet: 0
|
||||
textureFormatSet: 0
|
||||
ignorePngGamma: 0
|
||||
applyGammaDecoding: 0
|
||||
swizzle: 50462976
|
||||
cookieLightType: 0
|
||||
platformSettings:
|
||||
- serializedVersion: 3
|
||||
buildTarget: DefaultTexturePlatform
|
||||
maxTextureSize: 2048
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: -1
|
||||
textureCompression: 1
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
ignorePlatformSupport: 0
|
||||
androidETC2FallbackOverride: 0
|
||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||
- serializedVersion: 3
|
||||
buildTarget: Standalone
|
||||
maxTextureSize: 2048
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: -1
|
||||
textureCompression: 1
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
ignorePlatformSupport: 0
|
||||
androidETC2FallbackOverride: 0
|
||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||
- serializedVersion: 3
|
||||
buildTarget: WebGL
|
||||
maxTextureSize: 2048
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: -1
|
||||
textureCompression: 1
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
ignorePlatformSupport: 0
|
||||
androidETC2FallbackOverride: 0
|
||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||
- serializedVersion: 3
|
||||
buildTarget: Android
|
||||
maxTextureSize: 2048
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: -1
|
||||
textureCompression: 1
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
ignorePlatformSupport: 0
|
||||
androidETC2FallbackOverride: 0
|
||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||
spriteSheet:
|
||||
serializedVersion: 2
|
||||
sprites: []
|
||||
outline: []
|
||||
physicsShape: []
|
||||
bones: []
|
||||
spriteID:
|
||||
internalID: 0
|
||||
vertices: []
|
||||
indices:
|
||||
edges: []
|
||||
weights: []
|
||||
secondaryTextures: []
|
||||
nameFileIdTable: {}
|
||||
mipmapLimitGroupName:
|
||||
pSDRemoveMatte: 0
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
Reference in New Issue
Block a user