private void CreateBlueprints() { for (int i = 0; i < 5; i++) { BlueprintPickupBehaviour newBlueprint = Instantiate <BlueprintPickupBehaviour>(blueprintPrefab); newBlueprint.transform.position = new Vector3(0, -10, 0); } }
void OnTriggerEnter2D(Collider2D other) { if (other.transform.tag == "Pickup") { Debug.Log("Collider"); BlueprintPickupBehaviour behaviour = other.GetComponent <BlueprintPickupBehaviour>(); behaviour.PickedUp(); behaviour.ResetPosition(); GameController.GotBlueprint(); } if (other.transform.tag == "Floor") { GameController.CrashFloor(); } }