//public void EnterButton(GameObject button) //{ // insertedOrder.Add(button); //} //public void CheckOrder() //{ // int w = new int(); // bool incorrect = new bool(); // foreach (GameObject g in insertedOrder) // { // //if (correctOrder.Contains(g)) // //{ // for (int i = 0; i < correctOrder.Count; i++) // { // if (insertedOrder[i] == correctOrder[i]) // { // Debug.Log("Correct"); // finalOrder.Add(insertedOrder[i]); // for (int q = 0; q < correctOrder.Count; q++) // { // if(finalOrder[i] == correctOrder[i]) // { // w++; // if(w == correctOrder.Count) // { // Winner(); // } // } // } // //if (correctAmount < correctOrder.Count) // //{ // // correctAmount++; // //} // Debug.Log(correctAmount); // } // else // { // incorrect = true; // break; // } // } // //} // } // if (incorrect) // { // IncorrectAnswer(); // } //} //public void Winner() //{ // foreach (TriggerdObjects t in toTriggerOnWin) // { // t.TriggerFunctionality(); // } // done = true; //} //void IncorrectAnswer() //{ // Debug.Log("Incorrect"); // insertedOrder.Clear(); // finalOrder.Clear(); // correctAmount = 0; // Debug.Log(correctAmount); // foreach (TriggerdObjects t in trapsToTriggerOnLose) // { // t.TriggerFunctionality(); // } //} public override void PuzzleTrigger(TriggerdObjects currentObject) { if (!done) { if (correctOrder[intyMcIntface] == currentObject.gameObject) { currentObject.GetComponent <SayButton>().StartCoroutine(currentObject.GetComponent <SayButton>().LightUp(.6F)); intyMcIntface++; } else { foreach (TriggerdObjects t in trapsToTriggerOnLose) { t.TriggerFunctionality(); } intyMcIntface = 0; } if (intyMcIntface == correctOrder.Count) { StartCoroutine(ShowWhenDone()); puzzleManager.done = true; done = true; //foreach (TriggerdObjects t in toTriggerOnWin) //{ // t.TriggerFunctionality(); //} } } //IsDone(); }
public override void PuzzleTrigger(TriggerdObjects currentObject) { if (myWheel.currentSelected == myWheel.combination[i]) { StartCoroutine(BlinkLight(blinkCorrectTime)); Debug.Log("Correct"); i++; if (i == myWheel.combination.Count) { puzzleManager.done = true; StartCoroutine(BlinkCorrect()); } } else { Debug.Log("Incorrect"); i = 0; //Trigger traps foreach (TriggerdObjects t in trapsLose) { t.TriggerFunctionality(); } } }
public IEnumerator NextBeam(TriggerdObjects beam) { yield return(new WaitForSeconds(time)); beam.TriggerFunctionality(); beamsLeft -= 1; if (beamsLeft == 0) { time = 0; } }
public override void PuzzleTrigger(TriggerdObjects currentObject) { if (currentObject.GetComponent <Lamp>()) { CheckLights(currentObject.puzzlePart); } else if (currentObject.puzzlePart == 1) { if (hor == 0) { arrowHor.transform.Translate(4, 0, 0); hor = gridWidth - 1; } else { arrowHor.transform.Translate(-1, 0, 0); hor -= 1; } } else if (currentObject.puzzlePart == 2) { TriggerAllLights(); } else if (currentObject.puzzlePart == 3) { if (hor == gridWidth - 1) { arrowHor.transform.Translate(-4, 0, 0); hor = 0; } else { arrowHor.transform.Translate(1, 0, 0); hor += 1; } } else if (currentObject.puzzlePart == 4) { if (ver == gridWidth - 1) { print(gridWidth); arrowVer.transform.Translate(0, -4, 0); ver = 0; } else { arrowVer.transform.Translate(0, 1, 0); ver += 1; } } }
public override void PuzzleTrigger(TriggerdObjects currentObject) { if (beamsLeft == 0) { if (currentObject.puzzlePart == 0) { beamsLeft = beams.Count; foreach (TriggerdObjects beam in beams) { StartCoroutine(NextBeam(beam)); time += timeBetween; } } else if (currentObject.puzzlePart == 1) { puzzleManager.done = true; } } }
//Takes a Trigger object checking its puzzle part public override void PuzzleTrigger(TriggerdObjects currentObject) { //If the part is specificly the part that has to trigger a completion check if (currentObject.puzzlePart == 3) { PuzzleCheck(); } else { //if the part is used to make the correct combination if (finishedParts[currentObject.puzzlePart] != true) { finishedParts[currentObject.puzzlePart] = true; } else { finishedParts[currentObject.puzzlePart] = false; } } }
public abstract void PuzzleTrigger(TriggerdObjects currentObject);
public override void PuzzleTrigger(TriggerdObjects currentObject) { puzzleManager.done = true; }
public override void PuzzleTrigger(TriggerdObjects currentObject) { CheckTorches(currentObject.puzzlePart); }