void OnTriggerExit(Collider coll) { if (coll.tag == "Player") { dd = coll.gameObject.GetComponent <SickLettersDraggableDD>(); if (!dd || dd.isInVase) { return; } if (dd.isDragging) { dd.touchedVase = false; } } }
void checkDDsOverlapping(Collider coll) { SickLettersDraggableDD dd = coll.gameObject.GetComponent <SickLettersDraggableDD>(); if (dd && dd.checkDDCollision && !dd.isCorrect && !dd.isDragging && dd.transform.parent) { foreach (Transform t in game.safeDropZones) { if (t.childCount == 0) { dd.transform.parent = t; dd.transform.localPosition = Vector3.zero; break; } } } }
public void addNewDDToVas(SickLettersDraggableDD dd) { if (dd.isCorrect) { game.Poof(dd.transform); dd.resetCorrectDD(); game.onWrongMove(); StartCoroutine(onDroppingCorrectDD()); } else if (!dd.isInVase) { //dd.deattached = true; game.onCorrectMove(dd); //game.checkForNextRound(); } }
public void onCorrectMove(SickLettersDraggableDD dd) { //AudioManager.I.PlayDialog("Keeper_Good_" + UnityEngine.Random.Range(1, 13)); if (goodCommentCounter == 3 || !lastMoveIsCorrect) { AudioManager.I.PlayDialog("Keeper_Good_" + UnityEngine.Random.Range(1, 13)); goodCommentCounter = 0; } scale.counter++; correctMoveSequence++; goodCommentCounter++; lastMoveIsCorrect = true; dd.deattached = true; if (!dd.touchedVase) { dd.boxCollider.isTrigger = false; } TutorialUI.MarkYes(scale.transform.position - Vector3.forward * 2 + Vector3.up, TutorialUI.MarkSize.Big); //game.Context.GetCheckmarkWidget().Show(true); Context.GetAudioManager().PlaySound(Sfx.OK); //int prevStarNum = game.currentStars; if (scale.counter > maxWieght) { Context.GetOverlayWidget().SetStarsThresholds((targetScale / 3), (targetScale * 2 / 3), targetScale); currentStars = (scale.counter / 2) / (targetScale / 6); Context.GetOverlayWidget().SetStarsScore(scale.counter /*game.currentStars*/); } dd.isInVase = true; dd.gameObject.tag = "Finish"; checkForNextRound(); }
public void scatterDDs(bool isSimpleLetter = true) { i = 0; string letter = "x"; if (isSimpleLetter) { letter = game.LLPrefab.dotlessLetter.text; } foreach (SickLettersDropZone dz in game.DropZones) { if (dz.letters.Contains(letter)) { if (i < game.Draggables.Length) { if (game.Draggables[i].diacritic != Diacritic.None && i >= game.numerOfWringDDs /*!game.with7arakat*/) { i++; continue; } SickLettersDraggableDD newDragable = game.createNewDragable(game.Draggables[i].gameObject); newDragable.transform.parent = dz.transform; newDragable.transform.localPosition = Vector3.zero; newDragable.transform.localEulerAngles = new Vector3(0, -90, 0); newDragable.setInitPos(newDragable.transform.localPosition); newDragable.checkDDCollision = true; //newDragable.isAttached = true; thisLLWrongDDs.Add(newDragable); game.allWrongDDs.Add(newDragable); i++; } } } if (i == 0) { scatterDDs(false); } }
/*void OnTriggerStay(Collider coll) * { * checkEntry(coll); * }*/ private void checkEntry(Collider coll) { if (coll.tag == "Player") { dd = coll.gameObject.GetComponent <SickLettersDraggableDD>(); if (dd.isDragging) { dd.touchedVase = true; } if (!dd || dd.isDragging || dd.isInVase || dd.collidedWithVase) { return; } //if (dd.isDragging) // cheatingDetected = true; dd.collidedWithVase = true; addNewDDToVas(dd); } }