void Update() { if (puzzle1 == 4) { PC1.SetActive(true); } if (puzzle2 == 4) { PC2.SetActive(true); } if (puzzle3 == 4) { PC3.SetActive(true); } Puzzle_Count = puzzle1 + puzzle2 + puzzle3; //한번만 실행되게 하기위해 if (solDialogue && isSolved) { solvedDialogue.GetComponent <DialogueTrigger>().TriggerDialogue(); solDialogue = false; } }
void FixedUpdate() { // Part1 if (ps1.isVisible) { if (pickedUp) { ps1.isVisible = false; map1.SetActive(false); PC1.SetActive(true); mapMM.SetActive(true); parts1.SetActive(false); hold = 1; } } if (hold == 1) { Debug.Log("yo"); if (playerDetected == true) { ps2.isVisible = true; map2.SetActive(true); mapMM.SetActive(false); PC1.SetActive(false); parts2.SetActive(true); pickedUp = false; tc.startPoint += addTime; score += 1; hold = 0; playerDetected = false; } } // Part2 if (ps2.isVisible) { if (pickedUp) { ps2.isVisible = false; parts2.SetActive(false); PC2.SetActive(true); map2.SetActive(false); mapMM.SetActive(true); hold = 1; } } if (hold == 1) { if (playerDetected == true) { ps3.isVisible = true; map3.SetActive(true); PC2.SetActive(false); mapMM.SetActive(false); parts3.SetActive(true); pickedUp = false; tc.startPoint += addTime; score += 1; hold = 0; playerDetected = false; } } // Part3 if (ps3.isVisible) { if (pickedUp) { ps3.isVisible = false; parts3.SetActive(false); PC3.SetActive(true); map2.SetActive(false); mapMM.SetActive(true); hold = 1; } } if (hold == 1) { if (playerDetected == true) { ps4.isVisible = true; map4.SetActive(true); PC3.SetActive(false); mapMM.SetActive(false); parts4.SetActive(true); pickedUp = false; tc.startPoint += addTime; score += 1; hold = 0; playerDetected = false; } } // Part4 if (ps4.isVisible) { if (pickedUp) { ps4.isVisible = false; map2.SetActive(false); PC4.SetActive(true); mapMM.SetActive(true); parts4.SetActive(false); hold = 1; } } if (hold == 1) { if (playerDetected == true) { ps5.isVisible = true; parts5.SetActive(true); PC4.SetActive(false); map5.SetActive(true); mapMM.SetActive(false); pickedUp = false; tc.startPoint += addTime; score += 1; hold = 0; playerDetected = false; } } // Part5 if (ps5.isVisible) { if (pickedUp) { ps5.isVisible = false; map5.SetActive(false); PC5.SetActive(true); mapMM.SetActive(true); parts5.SetActive(false); hold = 1; } } if (hold == 1) { if (playerDetected == true) { pickedUp = false; PC5.SetActive(false); tc.startPoint += addTime; score += 1; hold = 0; win = true; animate.SetBool("isWin", true); } } if (win == true) { animate.SetBool("isWin", true); SceneManager.LoadScene("Win"); } }