//public delegate void gameStateHandler(GameStateController.gameState newState);
    //public static event gameStateHandler onStateChange;

    public void Awake()
    {
        Instance     = this;
        currentState = gameState.idle;

        destroyUnit = DestroyChainedUnit.Instance;
        puzzleGen   = GeneratingPuzzle.Instance;

        gameOverPanelRectTransform  = gameOverPanel.GetComponent <RectTransform>();
        pauseGamePanelRectTransform = pauseGamePanel.GetComponent <RectTransform>();
    }
    void Start()
    {
        puzzleGen = GeneratingPuzzle.Instance;
        //inputHandler = InputHandler.Instance;
        scanUnitARR             = new ScanUnit[puzzleGen._columns, puzzleGen._rows];
        _unitCounter            = 0;
        _unitTypeCheckContainer = new List <int>();
        _score         = 0;
        _turnText.text = puzzleGen._turns.ToString();

        _scoreSlider.minValue = 0;
        _scoreSlider.maxValue = _1starPoint;
        _scoreSlider.value    = 0;
    }
Ejemplo n.º 3
0
    void Start()
    {
        puzzleGen    = GeneratingPuzzle.Instance;
        destroyUnit  = DestroyChainedUnit.Instance;
        _unitLayer   = LayerMask.GetMask("Unit");
        _unitsHolder = GeneratingPuzzle.Instance._unitsHolder;

        _unitHighLight.SetActive(false);
        _horizontalHighlightBeginPos = puzzleGen._unitPosARR[0, 0].x;
        _horizontalHighlightEndPos   = puzzleGen._unitPosARR[puzzleGen._columns - 1, 0].x + puzzleGen._unitWidth;
        _verticalHighlightBeginPos   = puzzleGen._unitPosARR[0, 0].y;
        _verticalHighlightEndPos     = puzzleGen._unitPosARR[0, puzzleGen._rows - 1].y + puzzleGen._unitHeight;

        StartCoroutine(controlMovingUnits());
    }
Ejemplo n.º 4
0
    void Start()
    {
        puzzleGen = GeneratingPuzzle.Instance;
        destroyUnit = DestroyChainedUnit.Instance;
        _unitLayer = LayerMask.GetMask("Unit");
        _unitsHolder = GeneratingPuzzle.Instance._unitsHolder;

        _unitHighLight.SetActive(false);
        _horizontalHighlightBeginPos = puzzleGen._unitPosARR[0, 0].x;
        _horizontalHighlightEndPos = puzzleGen._unitPosARR[puzzleGen._columns - 1, 0].x + puzzleGen._unitWidth;
        _verticalHighlightBeginPos = puzzleGen._unitPosARR[0, 0].y;
        _verticalHighlightEndPos = puzzleGen._unitPosARR[0, puzzleGen._rows - 1].y + puzzleGen._unitHeight;

        StartCoroutine(controlMovingUnits());
    }
    void Start()
    {
        puzzleGen = GeneratingPuzzle.Instance;
        gameStateController = GameStateController.Instance;
        //inputHandler = InputHandler.Instance;

        scanUnitARR = new ScanUnit[puzzleGen._columns, puzzleGen._rows];
        _unitCounter = 0;
        _unitTypeCheckContainer = new List<int>();
        _score = 0;
        _turnText.text = puzzleGen._turns.ToString();
        _1starPoint = puzzleGen._1starPoint;
        _2starPoint = puzzleGen._2starPoint;
        _3starPoint = puzzleGen._3starPoint;

        _scoreSlider.minValue = 0;
        _scoreSlider.maxValue = _1starPoint;
        _scoreSlider.value = 0;

    }
Ejemplo n.º 6
0
    private float _YOffset;                                    // Distance between the first row and bottom side of the screen


    //==============================================
    // Unity Methods
    //==============================================

    void Awake()
    {
        Instance = this;

        // Get current level infomation from levelsInfo text file
        string     levelsInfoString = _levelsInfo.text;
        JSONObject levelsInfoJSON   = new JSONObject(levelsInfoString);
        JSONObject puzzleInfoJSON   = levelsInfoJSON.GetField(MadLevel.arguments);

        _rows           = (int)puzzleInfoJSON.GetField("rows").f;
        _columns        = (int)puzzleInfoJSON.GetField("columns").f;
        _unitTypesCount = (int)puzzleInfoJSON.GetField("unit types count").f;
        _turns          = (int)puzzleInfoJSON.GetField("turns").f;
        _1starPoint     = (int)puzzleInfoJSON.GetField("1 star point").f;
        _2starPoint     = (int)puzzleInfoJSON.GetField("2 star point").f;
        _3starPoint     = (int)puzzleInfoJSON.GetField("3 star point").f;

        // Set SFX and Music silder value
        _sfxSlider.value   = SoundController.Instance.sfxSource.volume;
        _musicSlider.value = SoundController.Instance.musicSource.volume;
    }
 //==============================================
 // Unity Methods
 //==============================================
 void Awake()
 {
     Instance = this;
     Application.targetFrameRate = 60;
 }
    private float _YOffset;                              // Distance between the first row and bottom side of the screen


    //==============================================
    // Unity Methods
    //==============================================

    void Awake()
    {
        Instance = this;
        Application.targetFrameRate = 60;
    }