private void PopulateSolvedStateList(Puzzle puzzle, int index)
    {
        // check if it's found
        if (puzzleUniqueIds.IndexOf(puzzle.UniqueId) != -1)
        {
            return;
        }

        // Check to see if the size is larger then the index passed if so then replace the id with the new item, else add the item to the list
        if (puzzleUniqueIds.Count > index)
        {
            puzzleUniqueIds[index] = puzzle.UniqueId;
        }
        else
        {
            puzzleUniqueIds.Add(puzzle.UniqueId);
        }

        // Create the ScriptableObject based on the puzzleType of the puzzle passed
        switch (puzzle.puzzleType)
        {
        case PuzzleObjectType.pressurepadObject:
            PuzzlePressurePad pp = CreateInstance(typeof(PuzzlePressurePad)) as PuzzlePressurePad;
            solvedList.CustomReplace(index, pp);
            break;

        case PuzzleObjectType.rotationObject:
            PuzzleRotation pr = CreateInstance(typeof(PuzzleRotation)) as PuzzleRotation;
            solvedList.CustomReplace(index, pr);
            break;
        }
    }
Пример #2
0
    public PuzzlePressurePad GetPuzzlePressurePad()
    {
        if (pppObj == null)
        {
            pppObj = ScriptableObject.CreateInstance(typeof(PuzzlePressurePad)) as PuzzlePressurePad;
        }

        return(pppObj);
    }