Пример #1
0
    public override void SetBlockColor(E_BLOCK_COLOR_TYPE _type = E_BLOCK_COLOR_TYPE.E_NONE)
    {
        ColorType = _type;

        switch (ColorType)
        {
        case E_BLOCK_COLOR_TYPE.E_NONE:
        {
            backgroudnSrpite.color = Color.gray;
        }
        break;

        case E_BLOCK_COLOR_TYPE.E_RED:
        {
            backgroudnSrpite.color = Color.red;
        }
        break;

        case E_BLOCK_COLOR_TYPE.E_BLUE:
        {
            backgroudnSrpite.color = Color.blue;
        }
        break;

        case E_BLOCK_COLOR_TYPE.E_GREEN:
        {
            backgroudnSrpite.color = Color.green;
        }
        break;
        }
    }
Пример #2
0
    public override E_CHECK_BLOCK CheckBlock(E_BLOCK_COLOR_TYPE _Type)
    {
        if (ColorType == _Type)
        {
            return(E_CHECK_BLOCK.E_SUCCESS);
        }

        return(E_CHECK_BLOCK.E_FAILED);
    }
Пример #3
0
    public override void Init(BlockData _blockData, Vector2 _vecFloorPosition)
    {
        base.Init(_blockData, _vecFloorPosition);

        int nRandomIndex = Random.Range(0, 9);

        ColorType = (nRandomIndex < 3) ? E_BLOCK_COLOR_TYPE.E_RED :
                    (nRandomIndex < 6) ? E_BLOCK_COLOR_TYPE.E_BLUE :
                    E_BLOCK_COLOR_TYPE.E_GREEN;

        //임시
        SetBlockColor(ColorType);
    }
Пример #4
0
 public virtual void SetBlockColor(E_BLOCK_COLOR_TYPE _type = E_BLOCK_COLOR_TYPE.E_NONE)
 {
 }
Пример #5
0
 public virtual E_CHECK_BLOCK CheckBlock(E_BLOCK_COLOR_TYPE _Type)
 {
     Debug.LogWarning("ParentCheckBlock");
     return(E_CHECK_BLOCK.E_FAILED);
 }
Пример #6
0
    void ClickButton(E_BLOCK_COLOR_TYPE _colorType)
    {
        if (Block_List.Count < 0)
        {
            return;
        }

        if (TouchStartTextObject.activeSelf && isGameOver)
        {
            isGameOver = false;
            TouchStartTextObject.SetActive(false);
        }


        Block checkBlock = Block_List.Find(((list) => list.GetBlockData().nFloorIndex == nFloorCount + 1));

        switch (checkBlock.CheckBlock(_colorType))
        {
        case E_CHECK_BLOCK.E_SUCCESS:
        {
            sliderTimer.value += 1;

            checkBlock.SetBlockColor(E_BLOCK_COLOR_TYPE.E_NONE);
            NextStair();
        }
        break;

        case E_CHECK_BLOCK.E_FAILED:
        {
#if CHEAT
            checkBlock.SetBlockColor(E_BLOCK_COLOR_TYPE.E_NONE);
            NextStair();
#endif
            isGameOver = true;

            CWindowResultPopup.CWindowResultData data = new CWindowResultPopup.CWindowResultData();

            //임시
            data.strTitle      = "Result";
            data.strOk         = "Lobby";
            data.strCancle     = "Restart";
            data.strScoreValue = nFloorCount.ToString();

            GameManager.Instance.Window_ResultPopup(data, (result) =>
                {
                    switch (result)
                    {
                    case (int)CWindowResultPopup.E_WINDOW_RESULT.E_LOBBY:
                        {
                            BlocksClear();
                            uiManager.ShowScene(this, E_GAME_SCENE.E_LOBBY);
                        }
                        break;

                    case (int)CWindowResultPopup.E_WINDOW_RESULT.E_RESTART:
                        {
                            GameInit();
                        }
                        break;
                    }
                });
        }
        break;
        }
    }