Insanely huge initial commit

This commit is contained in:
2026-02-21 17:04:05 -08:00
parent 9cdd36191a
commit 613d75914a
22525 changed files with 4035207 additions and 0 deletions

View File

@@ -0,0 +1,10 @@
fileFormatVersion: 2
guid: d936fc412fb074c00afaa1f16f621d11
folderAsset: yes
timeCreated: 1445532901
licenseType: Store
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,100 @@
using System;
using UnityEngine;
using System.Collections;
namespace Com.LuisPedroFonseca.ProCamera2D
{
[ExecuteInEditMode]
public class ProCamera2DLetterbox : MonoBehaviour
{
[Range(0, .5f)] public float Amount = 0f;
public Color Color;
Material _material;
private int TopPropertyID;
private int BottomPropertyID;
private int ColorPropertyID;
private float _previousAmount = float.MaxValue;
Material material
{
get
{
if (_material != null) return _material;
_material = new Material(Shader.Find("Hidden/ProCamera2D/Letterbox")) {hideFlags = HideFlags.HideAndDontSave};
return _material;
}
}
private void OnEnable()
{
_previousAmount = float.MaxValue;
if(TopPropertyID == 0)
TopPropertyID = Shader.PropertyToID("_Top");
if(BottomPropertyID == 0)
BottomPropertyID = Shader.PropertyToID("_Bottom");
if(ColorPropertyID == 0)
ColorPropertyID = Shader.PropertyToID("_Color");
}
void OnRenderImage(RenderTexture sourceTexture, RenderTexture destTexture)
{
if (Mathf.Approximately(Amount, 0f) || material == null)
{
Graphics.Blit(sourceTexture, destTexture);
return;
}
if (Math.Abs(Amount - _previousAmount) > 0.0001f)
{
Amount = Mathf.Clamp01(Amount);
material.SetFloat(TopPropertyID, 1 - Amount);
material.SetFloat(BottomPropertyID, Amount);
material.SetColor(ColorPropertyID, Color);
}
Graphics.Blit(sourceTexture, destTexture, material);
_previousAmount = Amount;
}
void OnDisable()
{
if (_material)
{
DestroyImmediate(_material);
}
}
public void TweenTo(float targetAmount, float duration)
{
StopAllCoroutines();
StartCoroutine(TweenToRoutine(targetAmount, duration));
}
IEnumerator TweenToRoutine(float targetAmount, float duration)
{
var initialAmount = Amount;
var t = 0f;
while (t <= 1.0f)
{
t += (ProCamera2D.Instance.IgnoreTimeScale ? Time.unscaledDeltaTime : Time.deltaTime) / duration;
Amount = Utils.EaseFromTo(initialAmount, targetAmount, t, EaseType.EaseOut);
yield return null;
}
Amount = targetAmount;
yield return null;
}
}
}

View File

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

View File

@@ -0,0 +1,9 @@
fileFormatVersion: 2
guid: c0bbfbb0cfe67457db027809e1cdeeb9
folderAsset: yes
timeCreated: 1445955187
licenseType: Store
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,41 @@
Shader "Hidden/ProCamera2D/Letterbox"
{
Properties
{
_MainTex("Base (RGB)", 2D) = "white" {}
_Top("Top Bar", Range(0.0,1.0)) = 1.0
_Bottom("Bottom Bar", Range(0.0,1.0)) = 1.0
_Color("Base(RGB)", Color) = (1,1,1,1)
}
SubShader
{
ZTest Always Cull Off ZWrite Off Fog{ Mode Off }
Pass
{
CGPROGRAM
#pragma vertex vert_img
#pragma fragment frag
#include "UnityCG.cginc"
uniform sampler2D _MainTex;
uniform float4 _Color;
uniform float _Top;
uniform float _Bottom;
fixed4 frag(v2f_img i) : COLOR
{
fixed4 screen = tex2D(_MainTex, i.uv);
if (i.uv.y < _Bottom || i.uv.y > _Top)
{
screen.xyz = _Color;
}
return screen;
}
ENDCG
}
}
FallBack "Diffuse"
}

View File

@@ -0,0 +1,9 @@
fileFormatVersion: 2
guid: 793e285a2632244d6bfaf202e00b88cd
timeCreated: 1445526368
licenseType: Store
ShaderImporter:
defaultTextures: []
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,9 @@
fileFormatVersion: 2
guid: d36db5ec1e3ae40c080d1d1536d8f767
folderAsset: yes
timeCreated: 1440931959
licenseType: Store
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,13 @@
using UnityEngine;
namespace Com.LuisPedroFonseca.ProCamera2D
{
[HelpURLAttribute("http://www.procamera2d.com/user-guide/extension-parallax/")]
/// <summary>
/// Add this class to an object if you want its position on the scene view to match the same relative position to the main parallax layer during runtime.
/// </summary>
public class ProCamera2DParallaxObject : MonoBehaviour
{
}
}

View File

@@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: 8d1877ba63b794fb7b73c35629719a64
timeCreated: 1440759673
licenseType: Store
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,9 @@
fileFormatVersion: 2
guid: 54e42ba4d5f494e38a4ff0690a9b5692
folderAsset: yes
timeCreated: 1440931970
licenseType: Store
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,158 @@
using UnityEngine;
namespace Com.LuisPedroFonseca.ProCamera2D
{
[HelpURLAttribute("http://www.procamera2d.com/user-guide/extension-pixel-perfect/")]
[ExecuteInEditMode]
public class ProCamera2DPixelPerfectSprite : BasePC2D, IPostMover
{
public bool IsAMovingObject;
public bool IsAChildSprite;
public Vector2 LocalPosition;
[Range(-8, 32)]
public int SpriteScale = 0;
Sprite _sprite;
ProCamera2DPixelPerfect _pixelPerfectPlugin;
[SerializeField]
Vector3 _initialScale = Vector3.one;
int _prevSpriteScale;
override protected void Awake()
{
base.Awake();
if (ProCamera2D == null)
{
enabled = false;
return;
}
GetPixelPerfectPlugin();
GetSprite();
ProCamera2D.AddPostMover(this);
}
void Start()
{
SetAsPixelPerfect();
}
#region IPostMover implementation
public void PostMove(float deltaTime)
{
if(enabled)
Step();
}
public int PMOrder { get { return _pmOrder; } set { _pmOrder = value; } }
int _pmOrder = 2000;
#endregion
#if UNITY_EDITOR
void LateUpdate()
{
if(enabled && !Application.isPlaying && !IsAMovingObject)
SetAsPixelPerfect();
if(!Application.isPlaying)
Step();
}
#endif
void Step()
{
if (_pixelPerfectPlugin == null || !_pixelPerfectPlugin.enabled)
return;
if (IsAMovingObject)
SetAsPixelPerfect();
_prevSpriteScale = SpriteScale;
}
void GetPixelPerfectPlugin()
{
_pixelPerfectPlugin = ProCamera2D.GetComponent<ProCamera2DPixelPerfect>();
#if UNITY_EDITOR
if(_pixelPerfectPlugin == null)
Debug.LogWarning("PixelPerfect extension not present. Please add it to the ProCamera2D core.");
#endif
}
void GetSprite()
{
var spriteRenderer = GetComponent<SpriteRenderer>();
if (spriteRenderer != null)
_sprite = spriteRenderer.sprite;
}
public void SetAsPixelPerfect()
{
#if UNITY_EDITOR
if (Vector3H == null)
base.Awake();
if (_sprite == null)
GetSprite();
if (_pixelPerfectPlugin == null)
GetPixelPerfectPlugin();
if (Vector3H == null || _sprite == null || _pixelPerfectPlugin == null)
return;
#endif
// Reset position
if (IsAChildSprite)
_transform.localPosition = VectorHVD(
Utils.AlignToGrid(LocalPosition.x, _pixelPerfectPlugin.PixelStep),
Utils.AlignToGrid(LocalPosition.y, _pixelPerfectPlugin.PixelStep),
Vector3D(_transform.localPosition));
// Position
_transform.position = VectorHVD(
Utils.AlignToGrid(Vector3H(_transform.position), _pixelPerfectPlugin.PixelStep),
Utils.AlignToGrid(Vector3V(_transform.position), _pixelPerfectPlugin.PixelStep),
Vector3D(_transform.position));
// Scale
if (SpriteScale == 0)
{
//The user was at 0 scale the last update, so save the current scale
if (_prevSpriteScale == 0)
_initialScale = _transform.localScale;
//The user just changed the scale to 0, so restore the original scale
else
_transform.localScale = _initialScale;
}
else
{
var adjustedSpriteScale = SpriteScale < 0 ? 1f / (float)SpriteScale * -1f : SpriteScale;
var scale = _sprite.pixelsPerUnit * adjustedSpriteScale * (1 / _pixelPerfectPlugin.PixelsPerUnit);
_transform.localScale = new Vector3(
Mathf.Sign(_transform.localScale.x) * scale,
Mathf.Sign(_transform.localScale.y) * scale,
_transform.localScale.z);
}
}
protected override void OnDestroy()
{
base.OnDestroy();
if(ProCamera2D != null)
ProCamera2D.RemovePostMover(this);
}
}
}

View File

@@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: 4695037a2aece46e6bbdf2cbb78dc2da
timeCreated: 1455023231
licenseType: Store
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,10 @@
fileFormatVersion: 2
guid: 446e477a03be643d599936de19c546d4
folderAsset: yes
timeCreated: 1456042443
licenseType: Store
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,20 @@
using UnityEngine;
namespace Com.LuisPedroFonseca.ProCamera2D
{
/// <summary>
/// Basic blit class used by the ProCamera2DTransitionFX extension
/// </summary>
[ExecuteInEditMode]
public class BasicBlit : MonoBehaviour
{
public Material CurrentMaterial;
void OnRenderImage(RenderTexture src, RenderTexture dst)
{
if (CurrentMaterial != null)
Graphics.Blit(src, dst, CurrentMaterial);
}
}
}

View File

@@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: 6725ec8ba7ec346269e03a744226f7a8
timeCreated: 1465202954
licenseType: Store
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,245 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!21 &2100000
Material:
serializedVersion: 6
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_Name: ProCamera2DTransitionsFXMaterial
m_Shader: {fileID: 4800000, guid: 8792cf492ecb54aa989bb9be033e5c62, type: 3}
m_ShaderKeywords:
m_LightmapFlags: 5
m_CustomRenderQueue: 2000
stringTagMap: {}
m_SavedProperties:
serializedVersion: 2
m_TexEnvs:
data:
first:
name: _MainTex
second:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
data:
first:
name: _BumpMap
second:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
data:
first:
name: _DetailNormalMap
second:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
data:
first:
name: _ParallaxMap
second:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
data:
first:
name: _OcclusionMap
second:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
data:
first:
name: _EmissionMap
second:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
data:
first:
name: _DetailMask
second:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
data:
first:
name: _DetailAlbedoMap
second:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
data:
first:
name: _MetallicGlossMap
second:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
data:
first:
name: _TransitionTex
second:
m_Texture: {fileID: 2800000, guid: 52c0eae9fffb947308dc66fa436b1a1a, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Floats:
data:
first:
name: _value
second: 0.84
data:
first:
name: _SrcBlend
second: 1
data:
first:
name: _DstBlend
second: 0
data:
first:
name: _Cutoff
second: 0.5
data:
first:
name: _Parallax
second: 0.02
data:
first:
name: _ZWrite
second: 1
data:
first:
name: _Glossiness
second: 0.5
data:
first:
name: _BumpScale
second: 1
data:
first:
name: _OcclusionStrength
second: 1
data:
first:
name: _DetailNormalMapScale
second: 1
data:
first:
name: _UVSec
second: 0
data:
first:
name: _Mode
second: 0
data:
first:
name: _Metallic
second: 0
data:
first:
name: value
second: 0
data:
first:
name: fadeToBackgroundColour
second: 1
data:
first:
name: distance
second: 0.01
data:
first:
name: numberOfBlinds
second: 20.6
data:
first:
name: dissolveRadius
second: 0.44
data:
first:
name: amplitude
second: 0.0625
data:
first:
name: wavelength
second: 8
data:
first:
name: spread
second: 0.25
data:
first:
name: horizontalCells
second: 16
data:
first:
name: verticalCells
second: 16
data:
first:
name: rectangles
second: 32
data:
first:
name: squares
second: 100
data:
first:
name: numberOfStripes
second: 16
data:
first:
name: numberOfSections
second: 8
data:
first:
name: amplitude1
second: 0.025
data:
first:
name: wavelength1
second: 16
data:
first:
name: amplitude2
second: 0.05
data:
first:
name: wavelength2
second: 4
data:
first:
name: _Step
second: 0
data:
first:
name: _Direction
second: 3
data:
first:
name: _Smoothing
second: 0.202
m_Colors:
data:
first:
name: _EmissionColor
second: {r: 0, g: 0, b: 0, a: 1}
data:
first:
name: _Color
second: {r: 1, g: 1, b: 1, a: 1}
data:
first:
name: backgroundColour
second: {r: 0, g: 0, b: 0, a: 1}
data:
first:
name: _BackgroundColour
second: {r: 0, g: 0, b: 0, a: 1}
data:
first:
name: _BackgroundColor
second: {r: 0.43382353, g: 0.05741782, b: 0.05741782, a: 1}

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 3a08940ebc9914ff7b06aecb5ee9e944
timeCreated: 1455819129
licenseType: Store
NativeFormatImporter:
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,9 @@
fileFormatVersion: 2
guid: 8f3ba8813eca14522bbee0afa9d72281
folderAsset: yes
timeCreated: 1456045102
licenseType: Store
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,69 @@
Shader "Hidden/ProCamera2D/TransitionsFX/Blinds"
{
Properties
{
_MainTex ("Texture", 2D) = "white" {}
_Step ("Step", Range(0, 1)) = 0
_BackgroundColor ("Background Color", Color) = (0, 0, 0, 1)
_Direction ("Direction", Int) = 0
_Blinds ("Blinds", Int) = 2
}
SubShader
{
// No culling or depth
Cull Off ZWrite Off ZTest Always
Pass
{
CGPROGRAM
#pragma vertex vert
#pragma fragment frag
#include "UnityCG.cginc"
struct appdata
{
float4 vertex : POSITION;
float2 uv : TEXCOORD0;
};
struct v2f
{
float2 uv : TEXCOORD0;
float4 vertex : SV_POSITION;
};
v2f vert (appdata v)
{
v2f o;
o.vertex = UnityObjectToClipPos(v.vertex);
o.uv = v.uv;
return o;
}
sampler2D _MainTex;
float _Step;
float4 _BackgroundColor;
int _Direction;
int _Blinds;
fixed4 frag (v2f i) : SV_Target
{
fixed4 colour = _BackgroundColor;
if (_Direction == 0 && frac(i.uv.x * _Blinds) < 1 - _Step)
colour = tex2D(_MainTex, i.uv);
else if (_Direction == 1 && frac(i.uv.x * _Blinds) > _Step)
colour = tex2D(_MainTex, i.uv);
else if (_Direction == 2 && frac(i.uv.y * _Blinds) > _Step)
colour = tex2D(_MainTex, i.uv);
else if (_Direction == 3 && frac(i.uv.y * _Blinds) < 1 - _Step)
colour = tex2D(_MainTex, i.uv);
return colour;
}
ENDCG
}
}
}

View File

@@ -0,0 +1,9 @@
fileFormatVersion: 2
guid: 6ccd0ab907f1343429283f8585be3b24
timeCreated: 1456401272
licenseType: Store
ShaderImporter:
defaultTextures: []
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,59 @@
Shader "Hidden/ProCamera2D/TransitionsFX/Circle"
{
Properties
{
_MainTex ("Texture", 2D) = "white" {}
_Step ("Step", Range(0, 1)) = 0
_BackgroundColor ("Background Color", Color) = (0, 0, 0, 1)
}
SubShader
{
// No culling or depth
Cull Off ZWrite Off ZTest Always
Pass
{
CGPROGRAM
#pragma vertex vert
#pragma fragment frag
#include "UnityCG.cginc"
struct appdata
{
float4 vertex : POSITION;
float2 uv : TEXCOORD0;
};
struct v2f
{
float2 uv : TEXCOORD0;
float4 vertex : SV_POSITION;
};
v2f vert (appdata v)
{
v2f o;
o.vertex = UnityObjectToClipPos(v.vertex);
o.uv = v.uv;
return o;
}
sampler2D _MainTex;
float _Step;
float4 _BackgroundColor;
fixed4 frag (v2f i) : SV_Target
{
fixed4 colour = _BackgroundColor;
float aspectRatio = _ScreenParams.y / _ScreenParams.x;
if (sqrt((float)(pow(i.uv.x - 0.5, 2) + pow((i.uv.y - 0.5) * aspectRatio, 2) < 0.5 - (_Step / 2))))
colour = tex2D(_MainTex, i.uv);
return colour;
}
ENDCG
}
}
}

View File

@@ -0,0 +1,9 @@
fileFormatVersion: 2
guid: 29bf35b79f6a14a3d95360620dfca7b8
timeCreated: 1456048289
licenseType: Store
ShaderImporter:
defaultTextures: []
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,56 @@
Shader "Hidden/ProCamera2D/TransitionsFX/Fade"
{
Properties
{
_MainTex ("Texture", 2D) = "white" {}
_Step ("Step", Range(0, 1)) = 0
_BackgroundColor ("Background Color", Color) = (0, 0, 0, 1)
}
SubShader
{
// No culling or depth
Cull Off ZWrite Off ZTest Always
Pass
{
CGPROGRAM
#pragma vertex vert
#pragma fragment frag
#include "UnityCG.cginc"
struct appdata
{
float4 vertex : POSITION;
float2 uv : TEXCOORD0;
};
struct v2f
{
float2 uv : TEXCOORD0;
float4 vertex : SV_POSITION;
};
v2f vert (appdata v)
{
v2f o;
o.vertex = UnityObjectToClipPos(v.vertex);
o.uv = v.uv;
return o;
}
sampler2D _MainTex;
float _Step;
float4 _BackgroundColor;
fixed4 frag (v2f i) : SV_Target
{
fixed4 colour = _BackgroundColor;
colour = tex2D(_MainTex, i.uv);
return (saturate(colour) * (1 - _Step)) + (_BackgroundColor * _Step);
}
ENDCG
}
}
}

View File

@@ -0,0 +1,9 @@
fileFormatVersion: 2
guid: 231866eed574e4a93b410bd871690e1e
timeCreated: 1456049822
licenseType: Store
ShaderImporter:
defaultTextures: []
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,63 @@
Shader "Hidden/ProCamera2D/TransitionsFX/Shutters"
{
Properties
{
_MainTex ("Texture", 2D) = "white" {}
_Step ("Step", Range(0, 1)) = 0
_BackgroundColor ("Background Color", Color) = (0, 0, 0, 1)
_Direction ("Direction", Int) = 0
}
SubShader
{
// No culling or depth
Cull Off ZWrite Off ZTest Always
Pass
{
CGPROGRAM
#pragma vertex vert
#pragma fragment frag
#include "UnityCG.cginc"
struct appdata
{
float4 vertex : POSITION;
float2 uv : TEXCOORD0;
};
struct v2f
{
float2 uv : TEXCOORD0;
float4 vertex : SV_POSITION;
};
v2f vert (appdata v)
{
v2f o;
o.vertex = UnityObjectToClipPos(v.vertex);
o.uv = v.uv;
return o;
}
sampler2D _MainTex;
float _Step;
float4 _BackgroundColor;
int _Direction;
fixed4 frag (v2f i) : SV_Target
{
fixed4 colour = _BackgroundColor;
if (_Direction == 0 && i.uv.x > _Step / 2 && i.uv.x < 1 - (_Step / 2))
colour = tex2D(_MainTex, i.uv);
else if (_Direction == 1 && i.uv.y > _Step / 2 && i.uv.y < 1 - (_Step / 2))
colour = tex2D(_MainTex, i.uv);
return colour;
}
ENDCG
}
}
}

View File

@@ -0,0 +1,9 @@
fileFormatVersion: 2
guid: be515eab61ea9430993a1c07592799ce
timeCreated: 1456398281
licenseType: Store
ShaderImporter:
defaultTextures: []
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,80 @@
// Adapted from a tutorial by https://twitter.com/DanielJMoran
Shader "Hidden/ProCamera2D/TransitionsFX/Texture"
{
Properties
{
_MainTex ("Texture", 2D) = "white" {}
_Step ("Step", Range(0, 1)) = 0
_BackgroundColor ("Background Color", Color) = (0, 0, 0, 1)
_TransitionTex("Transition Texture", 2D) = "white" {}
_Smoothing ("Smoothing", Range(0, 1)) = .1
}
SubShader
{
// No culling or depth
Cull Off ZWrite Off ZTest Always
Pass
{
CGPROGRAM
#pragma vertex vert
#pragma fragment frag
#include "UnityCG.cginc"
struct appdata
{
float4 vertex : POSITION;
float2 uv : TEXCOORD0;
};
struct v2f
{
float2 uv : TEXCOORD0;
float4 vertex : SV_POSITION;
};
v2f vert (appdata v)
{
v2f o;
o.vertex = UnityObjectToClipPos(v.vertex);
o.uv = v.uv;
return o;
}
sampler2D _MainTex;
float _Step;
float4 _BackgroundColor;
sampler2D _TransitionTex;
float _Smoothing;
fixed4 frag (v2f i) : SV_Target
{
if(_Step == 1)
return _BackgroundColor;
fixed4 transitTex = tex2D(_TransitionTex, i.uv);
fixed4 colour = tex2D(_MainTex, i.uv);
if (_Step >= transitTex.r)
{
float alpha = 1;
if(_Step > 1 - _Smoothing)
alpha = (_Step - transitTex.r) / (1 - _Step);
else
alpha = (_Step - transitTex.r) / _Smoothing;
alpha = clamp(alpha, 0, 1);
return lerp(colour, _BackgroundColor, alpha);
}
return colour;
}
ENDCG
}
}
}

View File

@@ -0,0 +1,9 @@
fileFormatVersion: 2
guid: 8792cf492ecb54aa989bb9be033e5c62
timeCreated: 1465055365
licenseType: Store
ShaderImporter:
defaultTextures: []
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,67 @@
Shader "Hidden/ProCamera2D/TransitionsFX/Wipe"
{
Properties
{
_MainTex ("Texture", 2D) = "white" {}
_Step ("Step", Range(0, 1)) = 0
_BackgroundColor ("Background Color", Color) = (0, 0, 0, 1)
_Direction ("Direction", Int) = 0
}
SubShader
{
// No culling or depth
Cull Off ZWrite Off ZTest Always
Pass
{
CGPROGRAM
#pragma vertex vert
#pragma fragment frag
#include "UnityCG.cginc"
struct appdata
{
float4 vertex : POSITION;
float2 uv : TEXCOORD0;
};
struct v2f
{
float2 uv : TEXCOORD0;
float4 vertex : SV_POSITION;
};
v2f vert (appdata v)
{
v2f o;
o.vertex = UnityObjectToClipPos(v.vertex);
o.uv = v.uv;
return o;
}
sampler2D _MainTex;
float _Step;
float4 _BackgroundColor;
int _Direction;
fixed4 frag (v2f i) : SV_Target
{
fixed4 colour = _BackgroundColor;
if (_Direction == 0 && i.uv.x < 1 - _Step)
colour = tex2D(_MainTex, i.uv);
else if(_Direction == 1 && i.uv.x > _Step)
colour = tex2D(_MainTex, i.uv);
else if(_Direction == 2 && i.uv.y > _Step)
colour = tex2D(_MainTex, i.uv);
else if(_Direction == 3 && i.uv.y < 1 - _Step)
colour = tex2D(_MainTex, i.uv);
return colour;
}
ENDCG
}
}
}

View File

@@ -0,0 +1,9 @@
fileFormatVersion: 2
guid: 5c7573986b4d441ceb333c3ca55ffb23
timeCreated: 1456050437
licenseType: Store
ShaderImporter:
defaultTextures: []
userData:
assetBundleName:
assetBundleVariant: