/// <summary>
    /// Unhide all platforms
    /// </summary>
    public void UnhidePlatforms()
    {
        RockPuzzle rockPuzzle = GetComponent <RockPuzzle>();

        foreach (Platform platform in rockPuzzle.platforms)
        {
            platform.Unhide();
        }
    }
Exemple #2
0
    public void OnTriggerEnter(Collider collider)
    {
        print(gameObject.name);
        if (collider.name == "Player1" || collider.name == "Player2")
        {
            switch (gameObject.name)
            {
            case "RiverStart":
                RockPuzzle.CreatePickups();
                break;

            case "P1Pickup":
                if (collider.name == "Player1")
                {
                    RockPuzzle.P1Pickup(collider.name);
                }
                break;

            case "P1Drop":
                if (collider.name == "Player1")
                {
                    RockPuzzle.P1Drop(collider.name);
                }
                break;

            case "P2Pickup":
                if (collider.name == "Player2")
                {
                    RockPuzzle.P2Pickup(collider.name);
                }
                break;

            case "P2Drop":
                if (collider.name == "Player2")
                {
                    RockPuzzle.P2Drop(collider.name);
                }
                break;

            case "GameOver":
                RockPuzzle.GameOver();
                break;
            }
        }
    }
    protected override void Start()
    {
        doors   = GetComponentsInChildren <Door>();
        puzzles = GetComponents <Puzzle>();
        CombinationLeverPuzzle comboLeverPuzzle = GetComponent <CombinationLeverPuzzle>();
        RockPuzzle             rockPuzzle       = GetComponent <RockPuzzle>();

        // Set and return a colour combination for levers
        CharacterColour[] combination = comboLeverPuzzle.SetColourCombination();

        // Set colours of all interactables in the task based on combination
        for (int i = 0; i < combination.Length; i++)
        {
            rockPuzzle.rocks[i].colour     = combination[i];
            rockPuzzle.platforms[i].colour = combination[i];
            rockPuzzle.rocks[i].SetMaterialColour(combination[i]);
            rockPuzzle.platforms[i].SetMaterial(combination[i]);
        }
        introDialogueTrigger.TriggerDialogue();
    }
    protected override void Start()
    {
        CombinationLeverPuzzle combinationPuzzle = GetComponent <CombinationLeverPuzzle>();
        EnemyPuzzle            enemyPuzzle       = GetComponent <EnemyPuzzle>();

        // Set colours of all enemies in the task based on combination
        CharacterColour[] combination = combinationPuzzle.SetColourCombination();
        for (int i = 0; i < combination.Length; i++)
        {
            EnemyStatsController enemy = enemyPuzzle.enemyPrefabs[i].GetComponent <EnemyStatsController>();
            enemy.AssignEnemyColour(combination[i]);
        }

        // Hide all platforms
        RockPuzzle rockPuzzle = GetComponent <RockPuzzle>();

        foreach (Platform platform in rockPuzzle.platforms)
        {
            platform.Hide();
        }
    }