This commit is contained in:
karakune 2016-06-25 16:22:44 -04:00
commit bb144bb8b6
12 changed files with 70 additions and 4 deletions

Binary file not shown.

Binary file not shown.

BIN
Assets/Prefabs/Cube.prefab Normal file

Binary file not shown.

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: edbc472cdc087e04b8454564a02e0105
timeCreated: 1466879663
licenseType: Free
NativeFormatImporter:
userData:
assetBundleName:
assetBundleVariant:

Binary file not shown.

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 7159df8adbfc94e4f8acac37ab9af5ce
timeCreated: 1466884176
licenseType: Free
NativeFormatImporter:
userData:
assetBundleName:
assetBundleVariant:

BIN
Assets/Scripts/Cube.prefab Normal file

Binary file not shown.

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 2479cecac8cfd2e4faf372505019532e
timeCreated: 1466882337
licenseType: Free
NativeFormatImporter:
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,27 @@
using UnityEngine;
using System.Collections;
[ExecuteInEditMode]
public class FloorTileGenerator : MonoBehaviour {
public GameObject tile;
public int x;
public int y;
public GameObject[] floorArray;
//public GameObject[] testArray;
// Use this for initialization
void Start () {
CreateFloor();
}
void CreateFloor()
{
floorArray = new GameObject[x*y];
for (int i = 0; i < x * y; ++i)
{
floorArray[i] = (GameObject)Instantiate(tile, new Vector3(i/y, 0, i%y), new Quaternion());
floorArray[i].name = i/y + "," + i%y;
}
}
}

View File

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

View File

@ -6,6 +6,7 @@ public class PostEffectScript : MonoBehaviour {
public float blindness = 0.5f;
public Rigidbody character;
public float blindnessRatio = 0.1f;
public float blindnessSpeed = 0.1f;
public float velocity;
// Use this for initialization
void Start () {
@ -18,15 +19,16 @@ public class PostEffectScript : MonoBehaviour {
}
void OnRenderImage(RenderTexture src, RenderTexture dest)
{
Vector2 planarVelocity = new Vector3(character.velocity.x, 0, character.velocity.z);
if (character.velocity.magnitude > 0)
{
blindness = character.velocity.normalized.magnitude * blindnessRatio;
blindness = 1 * blindnessRatio;
blindnessRatio += 0.01f;
}
else if (blindnessRatio >= 0.1f)
{
blindness = character.velocity.normalized.magnitude * blindnessRatio;
blindnessRatio = 0.1f;
blindnessRatio -= 0.01f;
blindness = 1 * blindnessRatio;
}

View File

@ -45,6 +45,7 @@
fixed4 frag (v2f i) : SV_Target
{
fixed4 col = tex2D(_MainTex, i.uv);
//half4 transparent = tex2D(_MainText, UNITY_PROJ_COORD(i));
col.r = col.r+_Blindness;
col.g = col.g+_Blindness;
col.b = col.b+_Blindness;