| | | 1 | | using System; |
| | | 2 | | using System.Collections; |
| | | 3 | | using System.Collections.Generic; |
| | | 4 | | using UnityEngine; |
| | | 5 | | |
| | | 6 | | public class finalPuzzle : MonoBehaviour |
| | | 7 | | { |
| | | 8 | | // Start is called before the first frame update |
| | 4 | 9 | | private bool firstPartDone = false; |
| | | 10 | | |
| | 4 | 11 | | private int firstPart = 0; |
| | 4 | 12 | | private int secondPart = 0; |
| | | 13 | | |
| | | 14 | | public GameObject firstPartText; |
| | | 15 | | public GameObject secondPartText; |
| | | 16 | | public GameObject code; |
| | | 17 | | |
| | | 18 | | public GameObject pictures; |
| | | 19 | | |
| | | 20 | | public GameObject blocks1; |
| | | 21 | | public GameObject blocks2; |
| | | 22 | | public GameObject blocks3; |
| | | 23 | | |
| | | 24 | | //legg inn final puzzle teksten; |
| | | 25 | | |
| | | 26 | | void Start() |
| | 2 | 27 | | { |
| | 2 | 28 | | blocks1.SetActive(false); |
| | 2 | 29 | | blocks2.SetActive(false); |
| | 2 | 30 | | blocks3.SetActive(false); |
| | 2 | 31 | | } |
| | | 32 | | |
| | | 33 | | private void Update() |
| | 4910 | 34 | | { |
| | 4910 | 35 | | if (firstPart <= 0) |
| | 0 | 36 | | { |
| | 0 | 37 | | firstPartDone = true; |
| | 0 | 38 | | } |
| | 4910 | 39 | | if (firstPartDone) |
| | 0 | 40 | | { |
| | 0 | 41 | | firstPartText.SetActive(false); |
| | 0 | 42 | | pictures.SetActive(false); |
| | | 43 | | |
| | 0 | 44 | | secondPartText.SetActive(true); |
| | 0 | 45 | | blocks1.SetActive(true); |
| | 0 | 46 | | blocks2.SetActive(true); |
| | 0 | 47 | | blocks3.SetActive(true); |
| | 0 | 48 | | } |
| | 4910 | 49 | | if (secondPart >= 3) |
| | 0 | 50 | | { |
| | 0 | 51 | | secondPartText.SetActive(false); |
| | 0 | 52 | | code.SetActive(true); |
| | 0 | 53 | | } |
| | 4910 | 54 | | } |
| | | 55 | | |
| | | 56 | | internal void decrementFirstPart() |
| | 3 | 57 | | { |
| | 3 | 58 | | firstPart--; |
| | 3 | 59 | | } |
| | | 60 | | |
| | | 61 | | internal void incrementFirstPart() |
| | 6 | 62 | | { |
| | 6 | 63 | | firstPart++; |
| | 6 | 64 | | } |
| | | 65 | | |
| | | 66 | | internal void incrementSecondPart() |
| | 0 | 67 | | { |
| | 0 | 68 | | secondPart++; |
| | 0 | 69 | | } |
| | | 70 | | |
| | | 71 | | internal void decrementSecondPart() |
| | 0 | 72 | | { |
| | 0 | 73 | | secondPart--; |
| | 0 | 74 | | } |
| | | 75 | | } |