scripts
This commit is contained in:
@@ -0,0 +1,69 @@
|
||||
using System;
|
||||
using UnityEngine;
|
||||
|
||||
namespace UnityStandardAssets.ImageEffects
|
||||
{
|
||||
// Token: 0x0200007B RID: 123
|
||||
[ExecuteInEditMode]
|
||||
[RequireComponent(typeof(Camera))]
|
||||
[AddComponentMenu("Image Effects/Other/Screen Overlay")]
|
||||
public class ScreenOverlay : PostEffectsBase
|
||||
{
|
||||
// Token: 0x06000176 RID: 374 RVA: 0x0000FF58 File Offset: 0x0000E358
|
||||
public override bool CheckResources()
|
||||
{
|
||||
base.CheckSupport(false);
|
||||
this.overlayMaterial = base.CheckShaderAndCreateMaterial(this.overlayShader, this.overlayMaterial);
|
||||
if (!this.isSupported)
|
||||
{
|
||||
base.ReportAutoDisable();
|
||||
}
|
||||
return this.isSupported;
|
||||
}
|
||||
|
||||
// Token: 0x06000177 RID: 375 RVA: 0x0000FF94 File Offset: 0x0000E394
|
||||
private void OnRenderImage(RenderTexture source, RenderTexture destination)
|
||||
{
|
||||
if (!this.CheckResources())
|
||||
{
|
||||
Graphics.Blit(source, destination);
|
||||
return;
|
||||
}
|
||||
Vector4 vector = new Vector4(1f, 0f, 0f, 1f);
|
||||
this.overlayMaterial.SetVector("_UV_Transform", vector);
|
||||
this.overlayMaterial.SetFloat("_Intensity", this.intensity);
|
||||
this.overlayMaterial.SetTexture("_Overlay", this.texture);
|
||||
Graphics.Blit(source, destination, this.overlayMaterial, (int)this.blendMode);
|
||||
}
|
||||
|
||||
// Token: 0x04000300 RID: 768
|
||||
public ScreenOverlay.OverlayBlendMode blendMode = ScreenOverlay.OverlayBlendMode.Overlay;
|
||||
|
||||
// Token: 0x04000301 RID: 769
|
||||
public float intensity = 1f;
|
||||
|
||||
// Token: 0x04000302 RID: 770
|
||||
public Texture2D texture;
|
||||
|
||||
// Token: 0x04000303 RID: 771
|
||||
public Shader overlayShader;
|
||||
|
||||
// Token: 0x04000304 RID: 772
|
||||
private Material overlayMaterial;
|
||||
|
||||
// Token: 0x0200007C RID: 124
|
||||
public enum OverlayBlendMode
|
||||
{
|
||||
// Token: 0x04000306 RID: 774
|
||||
Additive,
|
||||
// Token: 0x04000307 RID: 775
|
||||
ScreenBlend,
|
||||
// Token: 0x04000308 RID: 776
|
||||
Multiply,
|
||||
// Token: 0x04000309 RID: 777
|
||||
Overlay,
|
||||
// Token: 0x0400030A RID: 778
|
||||
AlphaBlend
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user