Exemplo n.º 1
0
    private void Awake()
    {
        // set so this persists on scene change

        if (instance == null)
        {
            instance = this;
        }
        else if (instance != this)
        {
            Destroy(gameObject);
        }

        DontDestroyOnLoad(this.gameObject);
    }
Exemplo n.º 2
0
    // Use this for initialization
    void Start()
    {
        tiles      = new BoardTile[size.x, size.z];
        lvlManager = FindObjectOfType <LevelFileManager>();

        if (GetComponent <EditorControl>())
        {
            Debug.Log("Test-Editor");
            editorMode = true;
            GenerateEditor();
        }
        else
        {
            XMLManager xml = FindObjectOfType <XMLManager>();
            if (lvlManager.LevelPath != null)
            {
                xml.LoadFile(lvlManager.LevelPath);
            }
        }
        // else bring up Level select menu
        // gets every file in specific folder, path is saved in a list
        // user clicks on (clickable object, button img, etc) corresponding to a specific file in list with data on a lvl
    }
Exemplo n.º 3
0
 private void Start()
 {
     lvlManager = FindObjectOfType <LevelFileManager>();
     name       = GetComponentInChildren <Text>();
     name.text  = filePath;
 }