コード例 #1
0
    // 박스 맵 셋팅.
    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());
    }
コード例 #2
0
ファイル: GameManager.cs プロジェクト: duswn1430/PhotoMemory
    // json에서 맵 데이터 가져오기.
    void LoadMapData()
    {
        TextAsset asset = (TextAsset)Resources.Load(_sMapFile);

        _JsonRoot = JSON.Parse(asset.text);

        for (int i = 0; i < _JsonRoot.Count; ++i)
        {
            BoxMapData data = new BoxMapData();
            data.idx          = _JsonRoot[i]["index"].AsInt;
            data.iRow         = _JsonRoot[i]["BoxW"].AsInt;
            data.iCol         = _JsonRoot[i]["BoxH"].AsInt;
            data.iColorType   = _JsonRoot[i]["ColorType"].AsInt;
            data.iColorVolume = _JsonRoot[i]["ColorVolume"].AsInt;
            data.iBonusTerms  = _JsonRoot[i]["BonusTerms"].AsInt;
            data.iBonusTime   = _JsonRoot[i]["BonusTime"].AsInt;

            _listMapData.Add(data);
        }
    }
コード例 #3
0
    // 맵 셋팅.
    void MapSetting(BoxMapData mapdata)
    {
        _stMapData = mapdata;

        for (int row = 0; row < mapdata.iRow; row++)
        {
            if (_listCol.Count < row + 1)
            {
                _listCol.Add(0);
            }

            for (int col = _listCol[row]; col < mapdata.iCol; col++)
            {
                Box box = new Box();
                box._Idx = _BoxList.Count;
                box._X   = row;
                box._Y   = col;

                _BoxList.Add(box);
            }
            _listCol[row] = mapdata.iCol;
        }
    }
コード例 #4
0
ファイル: GameManager.cs プロジェクト: duswn1430/PhotoMemory
    // 게임 시작 루틴.
    IEnumerator StartGame()
    {
        while (_bGaemReady)
        {
            if (WaitTime())
            {
                switch (_StartStep)
                {
                case START_STEP.INIT:
                    Init();
                    break;

                case START_STEP.SIZE:
                {
                    if (_iStage < _listMapData.Count)
                    {
                        _CurMapData = _listMapData[_iStage];
                    }

                    StartCoroutine(_BoxMapManager.SetBoxMap(_CurMapData));

                    _StartStep = START_STEP.COLOR;

                    WaitTimeReset(1.0f);
                }
                break;

                case START_STEP.COLOR:
                {
                    _BoxMapManager.BoxColoring();

                    _StartStep = START_STEP.COUNT;

                    WaitTimeReset(1.0f);
                }
                break;

                case START_STEP.COUNT:
                {
                    _Timer.BlinkStart();

                    _StartStep = START_STEP.SHUFFLE;

                    WaitTimeReset(3.0f);
                }
                break;

                case START_STEP.SHUFFLE:
                {
                    StartCoroutine(_BoxMapManager.BoxShuffling());

                    _StartStep = START_STEP.PLAY;

                    WaitTimeReset(0.7f);
                }
                break;

                case START_STEP.PLAY:
                    Play();
                    break;
                }
            }

            yield return(new WaitForFixedUpdate());
        }
    }