diff --git a/Assets/InventoryStuff/Inventory.meta b/Assets/InventoryStuff/Inventory.meta new file mode 100644 index 0000000000000000000000000000000000000000..354d69c1005dcfdcdfd0baaabed1376dd2fb318a --- /dev/null +++ b/Assets/InventoryStuff/Inventory.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 8c00acf0711308b4eac44fb21f04a06f +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Level.cs b/Assets/Level.cs new file mode 100644 index 0000000000000000000000000000000000000000..bd58a9c7c5f33317e98bad487732c0060f0ae1fd --- /dev/null +++ b/Assets/Level.cs @@ -0,0 +1,49 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +//TODO: think about having one Level class and then different subclasses like TreeLevel, Tangenslevel? +public class Level : MonoBehaviour +{ + + //Solving game parameters + public GameObject snapZoneTop; + public GameObject snapZoneBottom; + public static Vector3 solutionVector; + public static bool solved = false; + // Start is called before the first frame update + void Start() + { + solutionVector = snapZoneTop.transform.position - snapZoneBottom.transform.position; + } + + + public static bool gameSolved() + { + + Vector3 tempDir1 = new Vector3(0, 0, 0); + Vector3 tempDir2 = new Vector3(0, 0, 0); + + if (solved == true) + return true; + else + { + var Facts = CommunicationEvents.Facts; + //Look for solutionFact in global factList + foreach (Fact fact in Facts) + { + if (typeof(LineFact).IsInstanceOfType(fact)) + { + tempDir1 = ((PointFact)Facts.Find(x => x.Id == ((LineFact)fact).Pid1)).Point - ((PointFact)Facts.Find(x => x.Id == ((LineFact)fact).Pid2)).Point; + tempDir2 = ((PointFact)Facts.Find(x => x.Id == ((LineFact)fact).Pid2)).Point - ((PointFact)Facts.Find(x => x.Id == ((LineFact)fact).Pid1)).Point; + if (solutionVector == tempDir1 || solutionVector == tempDir2) + { + solved = true; + return true; + } + } + } + return false; + } + } +} diff --git a/Assets/Level.cs.meta b/Assets/Level.cs.meta new file mode 100644 index 0000000000000000000000000000000000000000..0870875b35af00694f642798dce67f64b7d8cda0 --- /dev/null +++ b/Assets/Level.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: ca8bc7e0b1ca4384192fec35c8699cd9 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/StreamingAssets.meta b/Assets/StreamingAssets.meta new file mode 100644 index 0000000000000000000000000000000000000000..7a25ae40aa44a6a0fc806ba87069449a4c6a6d6f --- /dev/null +++ b/Assets/StreamingAssets.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 809deaa1d951e5741bce0ace20cdaed8 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: