,Assets\Puzzle Maker\PM Prefabs\HelperPrefabs\SceneChanger.cs(34,30): error CS0117: 'SceneChanger' does not contain a definition for 'LoadScene'

,using UnityEngine;
using UnityEngine.UI;
using System.Collections;
using UnityEngine.SceneManagement;

public class SceneChanger : MonoBehaviour {

public Button btnSlidingPuzzle;
public Button btnMemoryPuzzle;
public Button btnPickAndPlace;
public Button btnJoinPieces;

private const string JoinPieces = "PM Join Pieces Example";
private const string PickAndPlace = "PM Pick And Place Example";
private const string MemoryPuzzle = "PM Memory Puzzle Example";
private const string SlidingPieces = "PM Sliding Pieces Example";

public void Start () {

#if UNITY_EDITOR

    UnityEditor.EditorBuildSettingsScene[] Temp = UnityEditor.EditorBuildSettings.scenes;
    if (Temp.Length < 4)
    {
        Debug.LogError("Please add all example scenes in build settings");
        DisableAllButtons();
        return;
    }

#endif

    //Disable button for current loaded scene
    switch (SceneChanger.LoadScene)
    {
        case JoinPieces:
            btnJoinPieces.gameObject.SetActive(false);
            break;

        case MemoryPuzzle:
            btnMemoryPuzzle.gameObject.SetActive(false);
            break;

        case PickAndPlace:
            btnPickAndPlace.gameObject.SetActive(false);
            break;

        case SlidingPieces:
            btnSlidingPuzzle.gameObject.SetActive(false);
            break;

        default:
            break;
    }

}

void DisableAllButtons()
{
    btnSlidingPuzzle.gameObject.SetActive(false);
    btnMemoryPuzzle.gameObject.SetActive(false);
    btnPickAndPlace.gameObject.SetActive(false);
    btnJoinPieces.gameObject.SetActive(false);
}

public void GotoSlidingPuzzle()
{
    SceneManager.LoadScene(SlidingPieces);
}

public void GotoPickAndPlace()
{
    SceneManager.LoadScene(PickAndPlace);
}

public void GotoMemoryPuzzle()
{
    SceneManager.LoadScene(MemoryPuzzle);
}

public void GotoJoinPieces()
{
    SceneManager.LoadScene(JoinPieces);
}

}

Hi,

The error says it all, your class does not have a LoadScene variable. Here switch (SceneChanger.LoadScene) switch expects some type of variable to campare to things defined after "case: keywords. In your example i think you want to get the active scene name like so switch(SceneManager.GetActiveScene().name). The thing you have there “SceneChanger.LoadScene” is a little confusing, first you don’t have to type a class name inside the same class and LoadScene is not a variable (like i said switch needs varaible or at least a method returning it) beside the fact that it does not exist (and error desc points it out).