mirror of
https://github.com/ConjureETS/MeltedBananasOJam2016.git
synced 2026-03-24 02:21:06 +00:00
Level generator + fade in fade out
This commit is contained in:
parent
0259352313
commit
4b3d7c2878
Binary file not shown.
Binary file not shown.
BIN
Assets/Prefabs/Cube.prefab
Normal file
BIN
Assets/Prefabs/Cube.prefab
Normal file
Binary file not shown.
8
Assets/Prefabs/Cube.prefab.meta
Normal file
8
Assets/Prefabs/Cube.prefab.meta
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: edbc472cdc087e04b8454564a02e0105
|
||||||
|
timeCreated: 1466879663
|
||||||
|
licenseType: Free
|
||||||
|
NativeFormatImporter:
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
BIN
Assets/Scripts/Cube 1.prefab
Normal file
BIN
Assets/Scripts/Cube 1.prefab
Normal file
Binary file not shown.
8
Assets/Scripts/Cube 1.prefab.meta
Normal file
8
Assets/Scripts/Cube 1.prefab.meta
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 7159df8adbfc94e4f8acac37ab9af5ce
|
||||||
|
timeCreated: 1466884176
|
||||||
|
licenseType: Free
|
||||||
|
NativeFormatImporter:
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
BIN
Assets/Scripts/Cube.prefab
Normal file
BIN
Assets/Scripts/Cube.prefab
Normal file
Binary file not shown.
8
Assets/Scripts/Cube.prefab.meta
Normal file
8
Assets/Scripts/Cube.prefab.meta
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 2479cecac8cfd2e4faf372505019532e
|
||||||
|
timeCreated: 1466882337
|
||||||
|
licenseType: Free
|
||||||
|
NativeFormatImporter:
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
27
Assets/Scripts/FloorTileGenerator.cs
Normal file
27
Assets/Scripts/FloorTileGenerator.cs
Normal 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;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
12
Assets/Scripts/FloorTileGenerator.cs.meta
Normal file
12
Assets/Scripts/FloorTileGenerator.cs.meta
Normal 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:
|
||||||
@ -6,6 +6,7 @@ public class PostEffectScript : MonoBehaviour {
|
|||||||
public float blindness = 0.5f;
|
public float blindness = 0.5f;
|
||||||
public Rigidbody character;
|
public Rigidbody character;
|
||||||
public float blindnessRatio = 0.1f;
|
public float blindnessRatio = 0.1f;
|
||||||
|
public float blindnessSpeed = 0.1f;
|
||||||
public float velocity;
|
public float velocity;
|
||||||
// Use this for initialization
|
// Use this for initialization
|
||||||
void Start () {
|
void Start () {
|
||||||
@ -18,15 +19,16 @@ public class PostEffectScript : MonoBehaviour {
|
|||||||
}
|
}
|
||||||
void OnRenderImage(RenderTexture src, RenderTexture dest)
|
void OnRenderImage(RenderTexture src, RenderTexture dest)
|
||||||
{
|
{
|
||||||
|
Vector2 planarVelocity = new Vector3(character.velocity.x, 0, character.velocity.z);
|
||||||
if (character.velocity.magnitude > 0)
|
if (character.velocity.magnitude > 0)
|
||||||
{
|
{
|
||||||
blindness = character.velocity.normalized.magnitude * blindnessRatio;
|
blindness = 1 * blindnessRatio;
|
||||||
blindnessRatio += 0.01f;
|
blindnessRatio += 0.01f;
|
||||||
}
|
}
|
||||||
else if (blindnessRatio >= 0.1f)
|
else if (blindnessRatio >= 0.1f)
|
||||||
{
|
{
|
||||||
blindness = character.velocity.normalized.magnitude * blindnessRatio;
|
blindnessRatio -= 0.01f;
|
||||||
blindnessRatio = 0.1f;
|
blindness = 1 * blindnessRatio;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -45,6 +45,7 @@
|
|||||||
fixed4 frag (v2f i) : SV_Target
|
fixed4 frag (v2f i) : SV_Target
|
||||||
{
|
{
|
||||||
fixed4 col = tex2D(_MainTex, i.uv);
|
fixed4 col = tex2D(_MainTex, i.uv);
|
||||||
|
//half4 transparent = tex2D(_MainText, UNITY_PROJ_COORD(i));
|
||||||
col.r = col.r+_Blindness;
|
col.r = col.r+_Blindness;
|
||||||
col.g = col.g+_Blindness;
|
col.g = col.g+_Blindness;
|
||||||
col.b = col.b+_Blindness;
|
col.b = col.b+_Blindness;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user