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

View File

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

View File

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