예제 #1
0
 void Awake()
 {
     Screen.SetResolution(720, 1280, false);
     jsonLoader      = LoadLevelFromJson.Create();
     uiButtons       = UIButtons.Create(this, jsonLoader);
     _levelGenerator = new LevelGenerator();
     board           = new BoardManager();
 }
예제 #2
0
    public static LoadLevelFromJson Create()
    {
        GameObject gameObject = new GameObject();

        gameObject.name = "JsonLoader";
        LoadLevelFromJson jsonLoader = gameObject.AddComponent <LoadLevelFromJson>();

        jsonLoader._levelLoader = new LevelLoader(jsonLoader._level);
        //GameManager.GetInstance().backgroundManager = jsonLoader._backgroundManager = BackGroundManager.Create();
        GameManager.GetInstance().piecesManager = jsonLoader._piecesManager = PiecesManager.Create();
        jsonLoader._levelLoader       = new LevelLoader(jsonLoader._level);
        jsonLoader.cursorPrefab       = Resources.Load <Cursor>("Prefabs/Cursor");
        jsonLoader._cameraCalculation = new CameraCalculation();
        jsonLoader.cursorPrefab       = Instantiate(jsonLoader.cursorPrefab, Vector2.zero, Quaternion.identity);
        GameManager.GetInstance().cursorObject = jsonLoader.cursorPrefab.gameObject;
        jsonLoader.cursorPrefab.gameObject.SetActive(false);
        return(jsonLoader);
    }
예제 #3
0
    public static UIButtons Create(GameManager gameManager, LoadLevelFromJson jsonLoader)
    {
        GameObject gameObject = new GameObject();

        gameObject.name = "UiButtons";
        UIButtons uiButtons = gameObject.AddComponent <UIButtons>();

        uiButtons._gameManager      = gameManager;
        uiButtons._jsonLoader       = jsonLoader;
        uiButtons.MenuHolderObjects = gameManager.MenuHolderObjects;
        uiButtons.LevelPacksHolder  = gameManager.LevelPacksHolder;
        uiButtons.LevelsHolder      = gameManager.LevelsHolder;
        uiButtons.InGame            = gameManager.InGame;
        uiButtons.StoreHolder       = gameManager.StoreHolder;
        uiButtons.OptionsHolder     = gameManager.OptionsHolder;
        uiButtons._sceneState       = new SceneState();
        return(uiButtons);
    }