Beispiel #1
0
    void Start()
    {
        saveFilePath = Application.persistentDataPath + "/save0.xml";
        Debug.Log("Save file: " + saveFilePath);

        mainBoard      = GameObject.Find("Main Board");
        mbs            = GameObject.Find("Main Board").GetComponent <MainBoardScript>();
        menu           = GetComponent <MenuScript>();
        exitButtonText = GameObject.Find("ExitButtonText");
        gameResult     = GameObject.Find("GameResult");
        gameResultText = GameObject.Find("GameResultText").GetComponent <Text>();
        audioPlayer    = GameObject.Find("Audio Player").GetComponent <AudioSource>();
        audioSource    = GetComponent <AudioSource>();
        gameResult.SetActive(false);
        if (boxClicked == null)
        {
            boxClicked = new BoxClickedEvent();
        }
        boxClicked.AddListener(OnBoxClicked);
        if (boxUpdated == null)
        {
            boxUpdated = new BoxUpdatedEvent();
        }
        difficulty = GameDifficulty.Medium;
        stats      = new Statistics();
        serializer = new XmlSerializer(typeof(SaveData));
        LoadGame();
    }
    void Start()
    {
        mbs = GameObject.Find("Main Board").GetComponent <MainBoardScript>();

        if (boxClicked == null)
        {
            boxClicked = new BoxClickedEvent();
        }
        boxClicked.AddListener(OnBoxClicked);
        if (boxUpdated == null)
        {
            boxUpdated = new BoxUpdatedEvent();
        }

        NewGame();
    }