Inheritance: GrabbableObject
コード例 #1
0
    public void RemoveFromHolder(GrabbableScribbler scribbler)
    {
		bool isScribblerFoundInHolders = false;
        foreach (var holder in allHolders) {
        	if (holder.ContainsScribbler(scribbler)) {
				holder.RemoveScribbler(scribbler);
				isScribblerFoundInHolders = true;
			}
		}

		if (!isScribblerFoundInHolders) {
			throw new UnityException("You are unexpectedly trying to remove a pen or pencil from a holder when the scribbler was in a holder to begin with");
		}
    }
コード例 #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
//	// Update is called once per frame
//	void Update () {
//	
//	}
	
	public void AddScribbler(GrabbableScribbler scribbler)
	{
		allScribblers.Add(scribbler);
	}
コード例 #4
0
ファイル: ScribblerHolder.cs プロジェクト: gadauto3/OCDEscape
	public bool ContainsScribbler(GrabbableScribbler scribbler)
	{
		return scribblers.Contains(scribbler);
	}
コード例 #5
0
ファイル: ScribblerHolder.cs プロジェクト: gadauto3/OCDEscape
	public void RemoveScribbler(GrabbableScribbler scribbler)
	{
		scribblers.Remove(scribbler);
	}