Moved Shader folder under a Resources folder to resolve UI Particle system and other shader issues.

Resolves #229
release
Simon (Darkside) Jackson 2018-03-22 18:09:48 +00:00
parent 4d913f33a8
commit 1dbfda47d9
40 changed files with 3966 additions and 107 deletions

View File

@ -0,0 +1,10 @@
fileFormatVersion: 2
guid: 65272187a39b1a64cb82bb9a55cdb703
folderAsset: yes
timeCreated: 1521741350
licenseType: Free
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,9 @@
fileFormatVersion: 2
guid: 6de6e08d11a51d14c97c4f7c647a1fca
timeCreated: 1521741378
licenseType: Free
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

10
Resources.meta Normal file
View File

@ -0,0 +1,10 @@
fileFormatVersion: 2
guid: a7296bad073428c4796089b44a48cab9
folderAsset: yes
timeCreated: 1521742084
licenseType: Free
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -1,69 +1,69 @@
// Upgrade NOTE: replaced 'mul(UNITY_MATRIX_MVP,*)' with 'UnityObjectToClipPos(*)'
/// Credit 00christian00
/// Sourced from - http://forum.unity3d.com/threads/any-way-to-show-part-of-an-image-without-using-mask.360085/#post-2332030
Shader "UI Extensions/UI Image Crop" {
Properties
{
_MainTex ("Base (RGB)", 2D) = "white" {}
_XCrop ("X Crop", Range(0.0,1.0)) = 1
_YCrop ("Y Crop", Range(0.0,1.0)) = 1
}
SubShader {
ZWrite Off
Tags
{
"Queue" = "Transparent"
"RenderType" = "Transparent"
"IgnoreProjector" = "True"
}
Blend SrcAlpha OneMinusSrcAlpha
Pass {
CGPROGRAM
#pragma vertex vert
#pragma fragment frag
#include "UnityCG.cginc"
struct v2f {
float4 pos : POSITION;
fixed4 color : COLOR;
float2 uv : TEXCOORD0; //UV1 coord
};
uniform sampler2D _MainTex;
float4 _MainTex_ST;
uniform float _XCrop;
uniform float _YCrop;
v2f vert (v2f v)
{
v2f o;
o.color=v.color;
o.color.a=0.1;
o.pos = UnityObjectToClipPos (v.pos);
o.uv=TRANSFORM_TEX(v.uv, _MainTex);
return o;
}
fixed4 frag (v2f i) : COLOR
{
//return fixed4(0.25,0,0,1);
i.color.a=step(i.uv.x,_XCrop);
//I don't like the bottom up ordering,so I reverse it
i.color.a=i.color.a*step(1-i.uv.y,_YCrop);
return i.color * tex2D (_MainTex, i.uv);
}
ENDCG
}
}
}
// Upgrade NOTE: replaced 'mul(UNITY_MATRIX_MVP,*)' with 'UnityObjectToClipPos(*)'
/// Credit 00christian00
/// Sourced from - http://forum.unity3d.com/threads/any-way-to-show-part-of-an-image-without-using-mask.360085/#post-2332030
Shader "UI Extensions/UI Image Crop" {
Properties
{
_MainTex ("Base (RGB)", 2D) = "white" {}
_XCrop ("X Crop", Range(0.0,1.0)) = 1
_YCrop ("Y Crop", Range(0.0,1.0)) = 1
}
SubShader {
ZWrite Off
Tags
{
"Queue" = "Transparent"
"RenderType" = "Transparent"
"IgnoreProjector" = "True"
}
Blend SrcAlpha OneMinusSrcAlpha
Pass {
CGPROGRAM
#pragma vertex vert
#pragma fragment frag
#include "UnityCG.cginc"
struct v2f {
float4 pos : POSITION;
fixed4 color : COLOR;
float2 uv : TEXCOORD0; //UV1 coord
};
uniform sampler2D _MainTex;
float4 _MainTex_ST;
uniform float _XCrop;
uniform float _YCrop;
v2f vert (v2f v)
{
v2f o;
o.color=v.color;
o.color.a=0.1;
o.pos = UnityObjectToClipPos (v.pos);
o.uv=TRANSFORM_TEX(v.uv, _MainTex);
return o;
}
fixed4 frag (v2f i) : COLOR
{
//return fixed4(0.25,0,0,1);
i.color.a=step(i.uv.x,_XCrop);
//I don't like the bottom up ordering,so I reverse it
i.color.a=i.color.a*step(1-i.uv.y,_YCrop);
return i.color * tex2D (_MainTex, i.uv);
}
ENDCG
}
}
}

View File

@ -1,38 +1,38 @@
Shader "UI/Particles/Hidden"
{
Properties
{
}
SubShader
{
Tags { "Queue"="Geometry" "RenderType"="Opaque" }
Cull Off Lighting Off ZWrite Off Fog { Mode Off }
LOD 100
Pass
{
CGPROGRAM
#pragma vertex vert
#pragma fragment frag
struct v2f
{
float4 vertex : SV_POSITION;
};
v2f vert ()
{
v2f o;
o.vertex = fixed4(0, 0, 0, 0);
return o;
}
fixed4 frag (v2f i) : SV_Target
{
discard;
return fixed4(0, 0, 0, 0);
}
ENDCG
}
}
Shader "UI/Particles/Hidden"
{
Properties
{
}
SubShader
{
Tags { "Queue"="Geometry" "RenderType"="Opaque" }
Cull Off Lighting Off ZWrite Off Fog { Mode Off }
LOD 100
Pass
{
CGPROGRAM
#pragma vertex vert
#pragma fragment frag
struct v2f
{
float4 vertex : SV_POSITION;
};
v2f vert ()
{
v2f o;
o.vertex = fixed4(0, 0, 0, 0);
return o;
}
fixed4 frag (v2f i) : SV_Target
{
discard;
return fixed4(0, 0, 0, 0);
}
ENDCG
}
}
}

View File

@ -9,7 +9,7 @@ using UnityEngine.EventSystems;
namespace UnityEngine.UI.Extensions
{
[RequireComponent(typeof(RectTransform))]
[RequireComponent(typeof(RectTransform), typeof(LayoutElement))]
public class ReorderableListElement : MonoBehaviour, IDragHandler, IBeginDragHandler, IEndDragHandler
{
[Tooltip("Can this element be dragged?")]