Inheritance: MonoBehaviour
コード例 #1
0
    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();
        }
    }
コード例 #2
0
	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!");
		}
	}
コード例 #3
0
    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);
    }
コード例 #4
0
    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));
    }
コード例 #5
0
 public void AddScribblerHolder(ScribblerHolder holder)
 {
     allHolders.Add(holder);
 }
コード例 #6
0
	public void AddScribblerHolder(ScribblerHolder holder)
	{
		allHolders.Add(holder);
	}