// 박스 셔플링.
    public IEnumerator BoxShuffling()
    {
        if (_bTouchLock)
        {
            yield break;
        }

        _bTouchLock = true;

        yield return(StartCoroutine(ShutterPlay(true)));

        yield return(StartCoroutine(Shuffle(_BoxList)));

        for (int i = 0; i < _BoxList.Count; ++i)
        {
            Box       box = _BoxList[i];
            Transform obj = _BoxTrans[box._Idx];

            AmiscGame.SetBoxColor(obj, box._CurType);
        }

        yield return(StartCoroutine(ShutterPlay(false)));

        _bTouchLock = false;
    }
Exemple #2
0
    // 게임 스테이지 클리어.
    public void COMPLETE()
    {
        _Step = STEP.COMPLETE;

        _iStageScore = (_CurMapData.iRow * _CurMapData.iCol) + _CurMapData.idx;

        //Debug.Log(string.Format("StageScore : {0} / Time : {1}", _iStageScore, (int)_Timer._fRemainTime));

        _iTotalScore += _iStageScore + (int)_Timer._fRemainTime;

        SetScore(_iTotalScore);

        _Timer.TimerStop();


#if !UNITY_EDITOR
        if (GameService._Instance.IsConnected())
        {
            AmiscGame.AchivStage(_iStage + 1);
            AmiscGame.AchivScore(_iTotalScore);
        }
#endif

        _bNextReady = true;
        _NextStep   = NEXT_STEP.ADDTIME;

        WaitTimeReset(1f);

        StartCoroutine(NextGame());

        SetClear(true);
    }
Exemple #3
0
    public void Dismiss()
    {
        if (_Type == HELP_TYPE.TUTORIAL)
        {
            if (_iCurPage == _iMaxPage - 1)
            {
                PlayerPrefs.SetInt("TUTORIAL", 0);

                UIManager._BackStep = BACK_STEP.GAME;

                _Parent.SetActive(false);
                _GameManager.GAMESTART();

                AmiscGame.AchivUnlock(0);
            }
        }
        else if (_Type == HELP_TYPE.MAIN)
        {
            UIManager._BackStep = BACK_STEP.MAIN;
            _Parent.SetActive(false);
        }
        else if (_Type == HELP_TYPE.GAME)
        {
            UIManager._BackStep = BACK_STEP.PAUSE;
            _Parent.SetActive(false);
        }
    }
    // 박스 오브젝트 셋팅.
    void SetBoxPrefab(Transform obj, Box box)
    {
        obj.name     = box._Idx.ToString();
        obj.parent   = _MyTransform;
        obj.position = box._Pos;

        AmiscGame.SetBoxColor(obj, box._CurType);
    }
    // 현재 상황 표시.
    public void ShowCur()
    {
        for (int i = 0; i < _BoxList.Count; ++i)
        {
            Box       box = _BoxList[i];
            Transform obj = _BoxTrans[box._Idx];

            AmiscGame.SetBoxColor(obj, box._CurType);
        }
    }
    // 박스 컬러링.
    public void BoxColoring()
    {
        if (_bTouchLock)
        {
            return;
        }

        int colorNum = _stMapData.iColorType;
        int colorCnt = _stMapData.iColorVolume;

        List <Box> listBox = _BoxList.ToList();

        for (int i = 0; i < listBox.Count; ++i)
        {
            listBox[i].Init();
        }

        System.Random rd = new System.Random();
        for (int i = 1; i <= colorNum; ++i)
        {
            for (int k = 0; k < colorCnt; ++k)
            {
                int rnd = rd.Next(listBox.Count);
                Box box = listBox[rnd];
                box.Setting((BOX_TYPE)i);

                listBox.Remove(box);
            }
        }

        for (int i = 0; i < _BoxList.Count; ++i)
        {
            Box       box = _BoxList[i];
            Transform obj = _BoxTrans[box._Idx];

            AmiscGame.SetBoxColor(obj, box._CurType);

            if (box._OriginTpye != BOX_TYPE.NONE)
            {
                LeanTween.moveY(obj.gameObject, 1f, 1.0f).setEase(LeanTweenType.punch);
            }
        }

        Sound._Instance.BoxDown();
    }
    // 박스 맵 셋팅.
    public IEnumerator SetBoxMap(BoxMapData mapdata)
    {
        if (_bTouchLock)
        {
            yield break;
        }

        MapSetting(mapdata);

        yield return(StartCoroutine(SpwanBox()));

        SettingTartgets();

        //_Floor.localPosition = AmiscGame.GetBackgroundPos(mapdata.iRow, mapdata.iCol);
        _Floor.localScale = AmiscGame.GetBackgroundScale(mapdata.iRow, mapdata.iCol);

        yield return(new WaitForEndOfFrame());
    }
    // 박스 체인지.
    public void BoxChange(Transform obj1, Transform obj2)
    {
        int idx1 = _BoxTrans.FindIndex(row => row == obj1);
        int idx2 = _BoxTrans.FindIndex(row => row == obj2);

        Box box1 = _BoxList[idx1];
        Box box2 = _BoxList[idx2];

        BOX_TYPE tmpType = box1._CurType;

        box1._CurType = box2._CurType;
        box2._CurType = tmpType;

        AmiscGame.SetBoxColor(obj1, box1._CurType);
        AmiscGame.SetBoxColor(obj2, box2._CurType);

        LeanTween.moveLocalY(obj1.gameObject, 0, 0.2f).setFrom(-6).setEase(LeanTweenType.easeSpring);
        LeanTween.moveLocalY(obj2.gameObject, 0, 0.2f).setFrom(6).setEase(LeanTweenType.easeSpring);

        // Dust Effect.
        _DustEffect.transform.position = obj2.position;
        _DustEffect.Play();

        DismissHint();

        Sound._Instance.BoxDown();

        if (IsComplete())
        {
            _GameManager.COMPLETE();
        }
        else
        {
            _GameManager.resetHint();
        }
    }