diff --git a/Assets/AntoineScene.unity b/Assets/AntoineScene.unity index 091cc0e..0776dda 100644 Binary files a/Assets/AntoineScene.unity and b/Assets/AntoineScene.unity differ diff --git a/Assets/Materials/New Material.mat b/Assets/Materials/New Material.mat index 355f6eb..18fb0f3 100644 Binary files a/Assets/Materials/New Material.mat and b/Assets/Materials/New Material.mat differ diff --git a/Assets/Prefabs/Tile.prefab.meta b/Assets/Prefabs/Tile.prefab.meta new file mode 100644 index 0000000..4862c6c --- /dev/null +++ b/Assets/Prefabs/Tile.prefab.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: b7c19bde0cdbe0a449b341fe1d6db17b +timeCreated: 1466884752 +licenseType: Free +NativeFormatImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Prefabs/TileTrap.prefab.meta b/Assets/Prefabs/TileTrap.prefab.meta new file mode 100644 index 0000000..855cf6a --- /dev/null +++ b/Assets/Prefabs/TileTrap.prefab.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 26a13cd54ea77304d851771c1c7cdcfe +timeCreated: 1466884752 +licenseType: Free +NativeFormatImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/FloorTileGenerator.cs b/Assets/Scripts/FloorTileGenerator.cs index baf97e2..26de925 100644 --- a/Assets/Scripts/FloorTileGenerator.cs +++ b/Assets/Scripts/FloorTileGenerator.cs @@ -2,26 +2,64 @@ using System.Collections; [ExecuteInEditMode] public class FloorTileGenerator : MonoBehaviour { - + public bool Generated = false; + public bool TileStartFalling; public GameObject tile; public int x; public int y; + public int rowFalling = 0; public GameObject[] floorArray; //public GameObject[] testArray; // Use this for initialization - void Start () { - CreateFloor(); - - } + void Start() + { + #if UNITY_EDITOR + if(!Generated) + { + CreateFloor(); + } + #endif + } void CreateFloor() { - floorArray = new GameObject[x*y]; + 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; + floorArray[i] = (GameObject)Instantiate(tile, new Vector3(i / y, 0, i % y), new Quaternion()); + 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()).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 + + } } diff --git a/Assets/Scripts/FloorTileGenerator.cs.meta b/Assets/Scripts/FloorTileGenerator.cs.meta index f00fe25..14af044 100644 --- a/Assets/Scripts/FloorTileGenerator.cs.meta +++ b/Assets/Scripts/FloorTileGenerator.cs.meta @@ -1,10 +1,11 @@ fileFormatVersion: 2 guid: a2a093b34b4e3714293729a5a3c4bfb3 -timeCreated: 1466877393 +timeCreated: 1466885732 licenseType: Free MonoImporter: serializedVersion: 2 - defaultReferences: [] + defaultReferences: + - tile: {fileID: 122918, guid: 2479cecac8cfd2e4faf372505019532e, type: 2} executionOrder: 0 icon: {instanceID: 0} userData: diff --git a/Assets/Scripts/JumpingPlayer.cs.meta b/Assets/Scripts/JumpingPlayer.cs.meta new file mode 100644 index 0000000..bf31048 --- /dev/null +++ b/Assets/Scripts/JumpingPlayer.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: eab2a77c206aca744b77408a74d86ceb +timeCreated: 1466884750 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/PlayerController.cs b/Assets/Scripts/PlayerController.cs index 1233837..1e3b483 100644 --- a/Assets/Scripts/PlayerController.cs +++ b/Assets/Scripts/PlayerController.cs @@ -38,7 +38,7 @@ public class PlayerController : MonoBehaviour { if (other.tag == "Trigger") { Debug.Log("Trigger entered"); - gameController.GetComponent().fallTriggerActivated = true; + //gameController.GetComponent().fallTriggerActivated = true; } } } diff --git a/Assets/Scripts/PlayerController.cs.meta b/Assets/Scripts/PlayerController.cs.meta new file mode 100644 index 0000000..07825e0 --- /dev/null +++ b/Assets/Scripts/PlayerController.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: cfb2f87d1e97ad046a368f2dde5c75a7 +timeCreated: 1466884750 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/PostEffectScript.cs b/Assets/Scripts/PostEffectScript.cs index c735025..78f9fa3 100644 --- a/Assets/Scripts/PostEffectScript.cs +++ b/Assets/Scripts/PostEffectScript.cs @@ -27,7 +27,7 @@ public class PostEffectScript : MonoBehaviour { } else if (blindnessRatio >= 0.1f) { - blindnessRatio -= 0.01f; + blindnessRatio -= 0.05f; blindness = 1 * blindnessRatio; } diff --git a/Assets/Scripts/TileController.cs.meta b/Assets/Scripts/TileController.cs.meta new file mode 100644 index 0000000..3216ef1 --- /dev/null +++ b/Assets/Scripts/TileController.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 7ab581e79e309c8458969c3963f1542b +timeCreated: 1466884750 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: