Fix and stuff antoine

This commit is contained in:
antoine.mcnabb 2016-06-25 17:43:51 -04:00
parent 4b3d7c2878
commit 2a2b274379
11 changed files with 104 additions and 13 deletions

Binary file not shown.

Binary file not shown.

View File

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

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 26a13cd54ea77304d851771c1c7cdcfe
timeCreated: 1466884752
licenseType: Free
NativeFormatImporter:
userData:
assetBundleName:
assetBundleVariant:

View File

@ -2,26 +2,64 @@
using System.Collections; using System.Collections;
[ExecuteInEditMode] [ExecuteInEditMode]
public class FloorTileGenerator : MonoBehaviour { public class FloorTileGenerator : MonoBehaviour {
public bool Generated = false;
public bool TileStartFalling;
public GameObject tile; public GameObject tile;
public int x; public int x;
public int y; public int y;
public int rowFalling = 0;
public GameObject[] floorArray; public GameObject[] floorArray;
//public GameObject[] testArray; //public GameObject[] testArray;
// Use this for initialization // Use this for initialization
void Start () { void Start()
{
#if UNITY_EDITOR
if(!Generated)
{
CreateFloor(); CreateFloor();
}
#endif
} }
void CreateFloor() void CreateFloor()
{ {
floorArray = new GameObject[x*y]; floorArray = new GameObject[x * y];
for (int i = 0; i < x * y; ++i) for (int i = 0; i < x * y; ++i)
{ {
floorArray[i] = (GameObject)Instantiate(tile, new Vector3(i/y, 0, i%y), new Quaternion()); floorArray[i] = (GameObject)Instantiate(tile, new Vector3(i / y, 0, i % y), new Quaternion());
floorArray[i].name = i/y + "," + i%y; floorArray[i].name = i / y + "," + i % y;
}
#if UNITY_EDITOR
Generated = true;
#endif
}
void Update()
{
if (TileStartFalling)
{
RowFall(rowFalling);
} }
} }
void RowFall(int j)
{
for (int i = j*y; i < (j+1)*y; ++i)
{
((TileController)floorArray[i].GetComponent<TileController>()).wasTouched = true;
//Destroy(floorArray[i],1);
}
if (j>x)
{
++rowFalling;
}
}
void End()
{
#if UNITY_EDITOR
for (int i = 0; i < x * y; ++i)
{
Destroy(floorArray[i]);
}
#endif
}
} }

View File

@ -1,10 +1,11 @@
fileFormatVersion: 2 fileFormatVersion: 2
guid: a2a093b34b4e3714293729a5a3c4bfb3 guid: a2a093b34b4e3714293729a5a3c4bfb3
timeCreated: 1466877393 timeCreated: 1466885732
licenseType: Free licenseType: Free
MonoImporter: MonoImporter:
serializedVersion: 2 serializedVersion: 2
defaultReferences: [] defaultReferences:
- tile: {fileID: 122918, guid: 2479cecac8cfd2e4faf372505019532e, type: 2}
executionOrder: 0 executionOrder: 0
icon: {instanceID: 0} icon: {instanceID: 0}
userData: userData:

View File

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

View File

@ -38,7 +38,7 @@ public class PlayerController : MonoBehaviour {
if (other.tag == "Trigger") if (other.tag == "Trigger")
{ {
Debug.Log("Trigger entered"); Debug.Log("Trigger entered");
gameController.GetComponent<GameController>().fallTriggerActivated = true; //gameController.GetComponent<GameController>().fallTriggerActivated = true;
} }
} }
} }

View File

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

View File

@ -27,7 +27,7 @@ public class PostEffectScript : MonoBehaviour {
} }
else if (blindnessRatio >= 0.1f) else if (blindnessRatio >= 0.1f)
{ {
blindnessRatio -= 0.01f; blindnessRatio -= 0.05f;
blindness = 1 * blindnessRatio; blindness = 1 * blindnessRatio;
} }

View File

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