public void PutInHolder(GrabbableScribbler scribbler, ScribblerHolder targetHolder) { targetHolder.AddScribbler(scribbler); bool isPuzzleSolved = false; if (NumScribblersInHolders() == allScribblers.Count) { isPuzzleSolved = true; // Flip bool before this for-loop foreach (ScribblerHolder holder in allHolders) { if (!holder.AreAllScribblersOfTheSameType()) { isPuzzleSolved = false; break; } } } if (isPuzzleSolved) { Debug.Log("Scribbler sorting puzzle is solved!"); CompletePuzzle(); } }
public void PutInHolder(GrabbableScribbler scribbler, ScribblerHolder targetHolder) { targetHolder.AddScribbler(scribbler); bool isPuzzleSolved = false; if (NumScribblersInHolders() == allScribblers.Count) { isPuzzleSolved = true; // Flip bool before this for-loop foreach (ScribblerHolder holder in allHolders) { if (!holder.AreAllScribblersOfTheSameType()) { isPuzzleSolved = false; break; } } } if (isPuzzleSolved) { Debug.Log("Scribbler sorting puzzle is solved!"); } }
public override bool OffInteract(GazePointer pointer, Transform objectToInteractWith) { if (objectToInteractWith) { holder = objectToInteractWith.GetComponent<ScribblerHolder>(); if (holder) { holder.puzzle.PutInHolder(this, holder); dropPosition = holder.GetFreeDropPosition(); } } else { Debug.Log("objectToInteractWith is null"); holder = null; } return base.OffInteract(pointer, objectToInteractWith); }
public override bool OffInteract(GazePointer pointer, Transform objectToInteractWith) { if (objectToInteractWith) { holder = objectToInteractWith.GetComponent <ScribblerHolder>(); if (holder) { holder.puzzle.PutInHolder(this, holder); dropPosition = holder.GetFreeDropPosition(); } } else { Debug.Log("objectToInteractWith is null"); holder = null; } return(base.OffInteract(pointer, objectToInteractWith)); }
public void AddScribblerHolder(ScribblerHolder holder) { allHolders.Add(holder); }