Example #1
0
    public void UpdatePuzzle()
    {
        puzzleCondObject   = null;
        puzzleActionObject = null;
        puzzleIfObject     = null;
        manager            = GetComponent <ManageDragAndDrop>();
        UpdateIfPuzzle();
        updateCondPuzzle();
        updateActPuzzle();

        if (puzzleCondObject)
        {
            puzzleCondObject.GetComponent <PuzzleScript>().isValid = true;
            puzzleCondObject.GetComponent <PuzzleScript>().UpdateNextPuzzle();
        }
        if (puzzleActionObject)
        {
            puzzleActionObject.GetComponent <PuzzleScript>().isValid = true;
            puzzleActionObject.GetComponent <PuzzleScript>().UpdateNextPuzzle();
        }
        if (puzzleIfObject)
        {
            puzzleIfObject.GetComponent <IfPuzzleScript>().isValid = true;
            puzzleIfObject.GetComponent <IfPuzzleScript>().UpdatePuzzle();
        }
    }
Example #2
0
    void UpdateNextCondPuzzle()
    {
        foreach (GameObject puzzle in GameObject.FindGameObjectsWithTag("Puzzle"))
        {
            manager = GetComponent <ManageDragAndDrop>();
            Vector2 currentGridPos = manager.getGridPosition();
            Vector2 puzzleGridPos  = puzzle.GetComponent <ManageDragAndDrop>().getGridPosition();
            Type    typePuzzle     = puzzle.GetComponent <PuzzleScript>().type;


            if (currentGridPos + new Vector2(2, 0) == puzzleGridPos && typePuzzle == Type.CONDITION)
            {
                nextPuzzle = puzzle;
                break;
            }
        }
    }
Example #3
0
 // Use this for initialization
 void Start()
 {
     manager      = GetComponent <ManageDragAndDrop>();
     image        = GetComponent <Image>();
     defaultColor = image.color;
 }
Example #4
0
 // Use this for initialization
 void Start()
 {
     manager        = GetComponent <ManageDragAndDrop>();
     editor         = GetComponent <createPuzzle>();
     numberIfPuzzle = 0;
 }