Inheritance: MonoBehaviour
Esempio n. 1
0
    // Use this for initialization
    void Start()
    {
        // Reference this script in the puzzle master
        PuzzleMaster script = puzzleMaster.GetComponent <PuzzleMaster>();

        script.sandPlate = this;
    }
Esempio n. 2
0
    // Use this for initialization
    void Start()
    {
        if (puzzleMaster == null)
        {
            Debug.LogError("Puzzle Master object is not defined in Color Button script!");
        }
        if (wrongColor == null)
        {
            Debug.LogError("Wrong Color is not defined in " + gameObject.name + " Color Button script!");
        }
        if (correctColor == null)
        {
            Debug.LogError("Correct Color is not defined in " + gameObject.name + " Color Button script!");
        }

        script         = puzzleMaster.GetComponent <PuzzleMaster>();
        spriteRenderer = gameObject.GetComponent <SpriteRenderer>();

        // Failed Recursion Algorithm for expandable tree

        /*int result = 1;
         * result = (int)(Mathf.Pow(3, patternLength - 1) * patternLength);
         *
         * allColorPaths = new Sprite[result];
         * for (int j = 0; j < allColors.Count; j++)
         *  RecurseColors(result, 0, 0, -1, 0, true);*/

        for (int i = 0; i < allColorPaths.Length;)
        {
            List <Sprite> colorList = new List <Sprite>();
            colors.Add(colorList);
            for (int j = 0; j < patternLength; j++)
            {
                colorList.Add(allColorPaths[i]);
                i++;
            }
        }

        if (colors.Count != script.colorCodes.Count)
        {
            Debug.LogError("Colors list does not line up with Puzzle Master code in " + gameObject.name + " Color Button script!");
        }
        else
        {
            for (int i = 0; i < script.colorCodes.Count; i++)
            {
                if (colors[i].Count != script.colorCodes[i].Count)
                {
                    Debug.LogError("Colors list does not line up with Puzzle Master code in " + gameObject.name + " Color Button script!");
                }
            }
        }
    }
Esempio n. 3
0
    void Awake()
    {
        pm_scr = this;
        puzzle_Entrance_by_class.Initialize();
        insideElevators_class.Initialize();

        puzzle_Room5_class.Initialize();
        //puzzle_Room6_class.Initialize ();


        /*
         * pm_scr.spawningKeys_class.SpawnKey1 ();
         * pm_scr.spawningKeys_class.SpawnKey2 ();
         * pm_scr.spawningKeys_class.SpawnKey3 ();
         */
    }
Esempio n. 4
0
    // Use this for initialization
    void Start()
    {
        if (sandBag == null)
        {
            Debug.LogError("Sand Bag object was not found in SandBagHold script!");
        }
        if (player == null)
        {
            Debug.LogError("Player object was not found in SandBagHold script!");
        }
        movementScript = player.GetComponent <PlayerMovement>();

        // Reference this script in the puzzle master
        PuzzleMaster script = puzzleMaster.GetComponent <PuzzleMaster>();

        script.sandBagHold   = this;
        script.sandBagObject = sandBag;
    }
Esempio n. 5
0
    // Use this for initialization
    void Start()
    {
        if (sandBagHoldScript == null)
        {
            Debug.LogError("Sand Bag Hold script was not found in Sand Bag script!");
        }
        if (sandBag == null)
        {
            Debug.LogError("Sand Bag object was not found in Sand Bag script!");
        }
        if (rockScale == null)
        {
            Debug.LogError("Rock Scale object was not found in Sand Bag script!");
        }

        // Reference this script in the puzzle master
        PuzzleMaster script = puzzleMaster.GetComponent <PuzzleMaster>();

        script.sandBag         = this;
        script.rockScaleObject = rockScale;
    }