コード例 #1
0
    public DataItemMaster(CsvItemData _data)
    {
        int count = 0;

        item_id          = _data.item_id;
        status           = 0;                   // 通常は利用できるとして扱う
        name             = _data.name;
        category         = _data.category;
        type             = _data.type;
        cell_type        = _data.cell_type;
        description      = _data.description;
        need_coin        = _data.need_coin;
        need_ticket      = _data.need_ticket;
        need_money       = _data.need_money;
        size             = _data.size;
        cost             = _data.cost;
        area             = _data.area;
        revenue          = _data.revenue;
        revenue_interval = _data.revenue_interval;
        revenue_up       = _data.revenue_up;
        production_time  = _data.production_time;
        setting_limit    = _data.setting_limit;
        sub_parts_id     = _data.sub_parts_id;
        open_item_id     = _data.open_item_id;
        revenue_up2      = _data.revenue_up2;
        add_coin         = _data.add_coin;
        item_id          = _data.item_id;
    }
コード例 #2
0
    static public float GetSymbolRate()
    {
        float fTotalRate = 1.0f;
        //List<DataItem> symbol_list = GameMain.dbItem.Select (" type = " + ((int)(Define.Item.Type.SYMBOL)).ToString () + " ");
        List <DataItem> symbol_list = GameMain.dbItem.Select(Define.WHERE_PATTERN.RATE);

        foreach (DataItem symbol in symbol_list)
        {
            CsvItemData csv_symbol_item_data = DataManager.GetItem(symbol.item_id);
            if ((int)(fTotalRate * 100.0f) < csv_symbol_item_data.revenue_up)
            {
                fTotalRate = csv_symbol_item_data.revenue_up * 0.01f;
            }
        }

        return(fTotalRate);
    }
コード例 #3
0
    public void Init(int _iNokoriSec, int _iDepth, int _iItemId)
    {
        int iUseDepth = _iDepth + 5;

        m_sprBack.depth      = iUseDepth;
        m_lbNokoriTime.depth = iUseDepth + 1;
        m_lbName.depth       = iUseDepth + 1;

        CsvItemData item_data = DataManager.GetItem(_iItemId);

        m_lbName.text = item_data.name;

        m_eStep    = STEP.INIT;
        m_eStepPre = STEP.MAX;

        // これはあまり意味ないかも
        m_iNokoriSec = _iNokoriSec;
        SetNokoriSec(m_iNokoriSec);

        //m_sprBack.gameObject.transform.localScale = new Vector3 (1.0f, 0.0f, 1.0f);

        return;
    }
コード例 #4
0
    public DataItem(MapChipCSV _mapChip, CsvItem _csvItem)
    {
        CsvItemData item_data = new CsvItemData();

        foreach (CsvItemData data in _csvItem.All)
        {
            if (data.item_id == _mapChip.item_id)
            {
                item_data = data;
            }
        }

        item_serial  = _mapChip.serial;
        item_id      = _mapChip.item_id;
        category     = item_data.category;
        x            = _mapChip.x;
        y            = _mapChip.y;
        width        = item_data.size; //_mapChip.width
        height       = item_data.size; //_mapChip.height
        status       = 1;
        level        = 1;
        collect_time = TimeManager.StrNow();;
        create_time  = TimeManager.StrNow();;
    }
コード例 #5
0
    // Update is called once per frame
    void Update()
    {
        bool bInit = false;

        if (m_eStepPre != m_eStep)
        {
            m_eStepPre = m_eStep;
            bInit      = true;
            //Debug.LogError (m_eStep);
        }

        switch (m_eStep)
        {
        case STEP.IDLE:
            if (bInit)
            {
                InputManager.Instance.m_TouchInfo.TouchON = false;
                m_YesNoButtonManager.TriggerClearAll();
                m_bTapRelease = false;
                m_bButtonLock = false;
                Debug.Log(string.Format("x={0} y={1} size={2} ", m_editItem.m_dataItem.x, m_editItem.m_dataItem.y, m_editItem.m_dataItem.width));
            }

            if (InputManager.Instance.m_TouchInfo.Swipe)
            {
                m_eStep = STEP.SWIPE;
            }
            else if (m_YesNoButtonManager.ButtonPushed)
            {
                if (m_YesNoButtonManager.Index == 0)
                {
                    bool bAbleSet = Grid.AbleSettingItem(m_editItemMaster, m_iEditItemX, m_iEditItemY, m_DontSetGridList);
                    if (bAbleSet)
                    {
                        m_eStep = STEP.SETTING;

                        // わけあってこっちから鳴らします
                        SoundManager.Instance.PlaySE(SoundName.SET_ITEM);
                    }
                    else
                    {
                        ;                        // エラー音
                    }
                }
                else
                {
                    m_eStep = STEP.CANCEL;
                }
                m_YesNoButtonManager.TriggerClearAll();
                m_bButtonLock = true;
            }
            else if (InputManager.Instance.m_TouchInfo.TouchON && m_bButtonLock == false)
            {
                int iGridX = 0;
                int iGridY = 0;

                if (Screen.height * 0.2f < InputManager.Instance.m_TouchInfo.TouchPoint.y)
                {
                    if (GameMain.GetGrid(InputManager.Instance.m_TouchInfo.TouchPoint, out iGridX, out iGridY))
                    {
                        if (GameMain.GridHit(iGridX, iGridY, m_editItem.m_dataItem, out m_iEditOffsetX, out m_iEditOffsetY))
                        {
                            //iSelectSerial = data_item.item_serial;
                            m_eStep = STEP.EDIT_TOUCH;
                            //Debug.Log ("hit");
                        }
                        else
                        {
                            //Debug.Log ("miss");
                            m_iTempX      = iGridX;
                            m_iTempY      = iGridY;
                            m_bTapRelease = true;
                        }
                    }
                }

                /*
                 * if (GameMain.GetGrid (InputManager.Instance.m_TouchInfo.TouchPoint, out iGridX, out iGridY)) {
                 *      if (m_iEditItemX == iGridX && m_iEditItemY == iGridY) {
                 *              m_eStep = STEP.EDIT_TOUCH;
                 *      } else {
                 *      }
                 * }
                 */
            }
            else if (InputManager.Instance.m_TouchInfo.TouchON == false)
            {
                if (m_bTapRelease == true)
                {
                    m_bTapRelease = false;
                    m_editItem.SetPos(m_iTempX, m_iTempY);

                    m_iEditItemX            = m_iTempX;
                    m_iEditItemY            = m_iTempY;
                    m_editItem.m_dataItem.x = m_iEditItemX;
                    m_editItem.m_dataItem.y = m_iEditItemY;
                    bool bAbleSet = Grid.AbleSettingItem(m_editItemMaster, m_iEditItemX, m_iEditItemY, m_DontSetGridList);
                    m_editItem.SetEditAble(bAbleSet);
                }
                m_bButtonLock = false;
            }
            else
            {
            }
            break;

        case STEP.HOLD:

            break;

        case STEP.SWIPE:
            if (bInit)
            {
                m_bTapRelease = false;
            }
            m_parkMain.goParkRoot.transform.localPosition += new Vector3(InputManager.Instance.m_TouchInfo.SwipeAdd.x, InputManager.Instance.m_TouchInfo.SwipeAdd.y, 0.0f);

            if (InputManager.Instance.m_TouchInfo.Swipe == false)
            {
                m_eStep = STEP.IDLE;
            }
            break;

        case STEP.EDIT_TOUCH:
            if (bInit)
            {
                InputManager.Instance.m_TouchInfo.TouchUp = false;
            }

            if (InputManager.Instance.m_TouchInfo.Swipe)
            {
                m_eStep = STEP.EDIT_SWIPE;
            }
            else if (InputManager.Instance.m_TouchInfo.TouchUp)
            {
                m_eStep = STEP.IDLE;
            }
            else
            {
            }


            break;

        case STEP.EDIT_SWIPE:
            if (InputManager.Instance.m_TouchInfo.TouchON)
            {
                int iGridX = 0;
                int iGridY = 0;

                if (GameMain.GetGrid(InputManager.Instance.m_TouchInfo.TouchPoint, out iGridX, out iGridY))
                {
                    if (iGridX != m_iEditItemX || iGridY != m_iEditItemY)
                    {
                        m_editItem.SetPos(iGridX - m_iEditOffsetX, iGridY - m_iEditOffsetY);
                        m_iEditItemX            = iGridX - m_iEditOffsetX;
                        m_iEditItemY            = iGridY - m_iEditOffsetY;
                        m_editItem.m_dataItem.x = m_iEditItemX;
                        m_editItem.m_dataItem.y = m_iEditItemY;
                        bool bAbleSet = Grid.AbleSettingItem(m_editItemMaster, m_iEditItemX, m_iEditItemY, m_DontSetGridList);
                        m_editItem.SetEditAble(bAbleSet);
                    }
                }

                int   iWidth  = (int)(Screen.width * 0.1f);
                int   iHeight = (int)(Screen.height * 0.3f);
                float fDelta  = 20.0f;

                if (InputManager.Instance.m_TouchInfo.TouchPoint.x < iWidth)
                {
                    //Debug.Log ("x short");
                    GameMain.ParkRoot.MoveAdd(fDelta, 0.0f);
                }
                else if ((Screen.width - iWidth) < InputManager.Instance.m_TouchInfo.TouchPoint.x)
                {
                    //Debug.Log ("x high");
                    GameMain.ParkRoot.MoveAdd(fDelta * -1.0f, 0.0f);
                }
                else
                {
                }
                if (InputManager.Instance.m_TouchInfo.TouchPoint.y < (int)(Screen.height * 0.3f))
                {
                    //Debug.Log ("y short");
                    GameMain.ParkRoot.MoveAdd(0.0f, fDelta);
                }
                else if (((int)(Screen.height * 0.6f)) < InputManager.Instance.m_TouchInfo.TouchPoint.y)
                {
                    //Debug.Log ("y high");
                    GameMain.ParkRoot.MoveAdd(0.0f, fDelta * -1.0f);
                }
                else
                {
                }

                //Debug.Log (InputManager.Instance.m_TouchInfo.TouchPoint);
            }
            else if (InputManager.Instance.m_TouchInfo.TouchUp)
            {
                m_eStep = STEP.IDLE;
            }

            break;


        case STEP.SETTING:
            if (bInit)
            {
            }

            if (0 < GameMain.Instance.m_iSettingItemSerial)
            {
                Debug.LogError(string.Format("setting serial:{0}", GameMain.Instance.m_iSettingItemSerial));
                GameMain.dbItem.Update(GameMain.Instance.m_iSettingItemSerial, (int)Define.Item.Status.SETTING, m_iEditItemX, m_iEditItemY);
            }
            else
            {
                GameMain.Instance.m_iSettingItemSerial = GameMain.dbItem.Insert(m_editItemMaster, (int)Define.Item.Status.SETTING, m_iEditItemX, m_iEditItemY);

                CsvItemData item_data = DataManager.GetItem(m_editItemMaster.item_id);
                if (0 < item_data.need_coin)
                {
                    DataManager.user.AddGold(-1 * item_data.need_coin);
                }
                else if (0 < item_data.need_ticket)
                {
                    DataManager.user.AddTicket(-1 * item_data.need_ticket);
                }
                else
                {
                    ;                    // エラーちゃう?
                                         // 課金アイテム
                }

                DataItem.OpenNewItem(m_editItemMaster.item_id);

                /*
                 * List<DataItemMaster> open_item_list = GameMain.dbItemMaster.Select (string.Format (" status = {0} and open_item_id = {1} ", (int)Define.Item.Status.NONE, m_editItemMaster.item_id));
                 * foreach (DataItemMaster open_item in open_item_list) {
                 *      Dictionary<string , string > update_value = new Dictionary<string , string > ();
                 *      update_value.Add ("status", string.Format ( "{0}" , (int)Define.Item.Status.SETTING ));
                 *      GameMain.dbItemMaster.Update ( open_item.item_id , update_value);
                 * }
                 */
            }
            TweenColorAll(m_editItem.gameObject, 0.025f, Color.white);
            TweenAlphaAll(m_editItem.gameObject, 0.025f, 1.0f);

            m_editItem.EditEnd(GameMain.Instance.m_iSettingItemSerial);

            Debug.Log(m_editItem.m_dataItem.width);
            GameMain.ParkRoot.AddFieldItem(m_editItem);
            GameMain.Instance.HeaderRefresh();
            //m_fieldItemList.Add (m_editItem);
            GameMain.Instance.PreSettingItemId = m_editItem.m_dataItem.item_id;

            if (m_editItem.m_dataItem.item_id == Define.ITEM_ID_ROAD && m_parkMain.m_eEditMode == ParkMain.EDIT_MODE.NORMAL)
            {
                Debug.Log(m_editItem.m_dataItem.item_id);

                // ここでやり直し
                initialize();
            }
            else
            {
                m_eStep = STEP.END;
            }
            break;

        case STEP.CANCEL:
            if (m_parkMain.m_eEditMode == ParkMain.EDIT_MODE.MOVE)
            {
                //DataItem return_data_item = GameMain.dbItem.Select (string.Format (" item_serial = {0} " , GameMain.Instance.m_iSettingItemSerial ));

                Debug.LogError(GameMain.Instance.m_iSettingItemSerial);

                DataItem return_data_item = GameMain.dbItem.Select(GameMain.Instance.m_iSettingItemSerial);
                m_iEditItemX = return_data_item.x;
                m_iEditItemY = return_data_item.y;
                m_eStep      = STEP.SETTING;

                SoundManager.Instance.PlaySE(SoundName.BUTTON_CANCEL);
            }
            else
            {
                Destroy(m_editItem.gameObject);
                m_eStep = STEP.END;
            }


            break;

        case STEP.END:
            break;

        case STEP.MAX:
        default:
            break;
        }
    }
コード例 #6
0
    public int GetUriagePerHour()
    {
        float fTotalRate = GetSymbolRate();

        int           iRet          = 0;
        bool          bHalf         = true;
        CtrlFieldItem ctrlFieldItem = GameMain.ParkRoot.GetFieldItem(item_serial);

        //Debug.LogError (item_serial);
        if (ctrlFieldItem != null)
        {
            //Debug.LogError (ctrlFieldItem.m_dataItem.category);
        }
        if (ctrlFieldItem != null && ctrlFieldItem.m_eRoad == Define.ROAD.CONNECTION_SHOP)
        {
            bHalf = false;
            //Debug.LogError ("here ");
        }
        //Debug.LogError (bHalf);

        // 例外?処理
        CsvItemData csv_item_data = DataManager.GetItem(item_id);

        if (0 < csv_item_data.revenue)
        {
            int iCount = 3600 / csv_item_data.revenue_interval;
            // お店自体金額回収

            iRet = iCount * csv_item_data.revenue;
            if (bHalf)
            {
                iRet /= 2;
            }
            if (status == 0)
            {
                iRet = 0;
            }

            iRet = (int)(iRet * fTotalRate);

            return(iRet);
        }

        List <DataMonster> monster_list = GameMain.dbMonster.Select(" item_serial = " + item_serial.ToString());
        int iUriageMax = 0;

        foreach (DataMonster monster in monster_list)
        {
            CsvMonsterData monster_csv = DataManager.GetMonster(monster.monster_id);

            int iCount = 3600 / monster_csv.revenew_interval;
            iUriageMax += monster_csv.revenew_coin * iCount;
        }
        CsvItemDetailData item_detail_data = DataManager.GetItemDetail(item_id, level);

        iUriageMax = (iUriageMax * item_detail_data.revenue_rate) / 100;
        iRet       = iUriageMax;
        if (bHalf)
        {
            iRet /= 2;
        }
        iRet = (int)(iRet * fTotalRate);

        return(iRet);
    }
コード例 #7
0
    public int GetCollect(bool _bCollect, out int _iCollectGold, out int _iCollectExp)
    {
        float fTotalRate = GetSymbolRate();

        int iCollectGold = 0;
        int iCollectExp  = 0;
        List <DataMonster> monster_list = GameMain.dbMonster.Select(" item_serial = " + item_serial.ToString());

        foreach (DataMonster monster in monster_list)
        {
            int iTempGold = 0;
            int iTempExp  = 0;

            monster.GetCollect(_bCollect, out iTempGold, out iTempExp);

            iCollectGold += iTempGold;
            iCollectExp  += iTempExp;
        }

        int         iShopCollectGold = 0;
        CsvItemData csv_item_data    = DataManager.GetItem(item_id);

        if (0 < csv_item_data.revenue)
        {
            // お店自体金額回収
            double diffSec = TimeManager.Instance.GetDiffNow(collect_time).TotalSeconds * -1.0d;
            double dCount  = diffSec / csv_item_data.revenue_interval;
            iShopCollectGold = (int)dCount * csv_item_data.revenue;

            /*
             * Debug.LogError (collect_time);
             * Debug.LogError (diffSec);
             * Debug.LogError (dCount);
             * Debug.LogError (iShopCollectGold);
             */
            if (_bCollect)
            {
                double amari  = diffSec % csv_item_data.revenue_interval;
                string strNow = TimeManager.StrGetTime(-1 * (int)amari);
                Dictionary <string, string> dict = new Dictionary <string, string> ();
                dict.Add("collect_time", "\"" + strNow + "\"");
                GameMain.dbItem.Update(item_serial, dict);
            }
        }

        if (0 < iShopCollectGold)
        {
            iCollectGold = iShopCollectGold;
        }
        else
        {
            CsvItemDetailData item_detail_data = DataManager.GetItemDetail(item_id, level);

            iCollectGold = (iCollectGold * item_detail_data.revenue_rate) / 100;
        }
        // お店のぶんも計上

        CtrlFieldItem ctrlFieldItem = GameMain.ParkRoot.GetFieldItem(item_serial);

        if (ctrlFieldItem != null && ctrlFieldItem.m_eRoad != Define.ROAD.CONNECTION_SHOP)
        {
            iCollectGold /= 2;
            iCollectExp  /= 2;
        }

        //Debug.Log( string.Format( "rate:{0}" ,fTotalRate ));
        iCollectGold = (int)(iCollectGold * fTotalRate);

        _iCollectGold = iCollectGold;
        _iCollectExp  = iCollectExp;

        return(iCollectGold);
    }
コード例 #8
0
    // Update is called once per frame
    void Update()
    {
        bool bInit = false;

        if (m_eStepPre != m_eStep)
        {
            m_eStepPre = m_eStep;
            bInit      = true;
            Debug.Log(m_eStep);
        }

        switch (m_eStep)
        {
        case STEP.IDLE:
            if (bInit)
            {
                m_parkMain.m_bInputTrigger = false;
                InputManager.Instance.m_TouchInfo.TouchUp = false;

                // 更新
                DataManager.Instance.m_ItemDataList = GameMain.dbItem.Select(" status != 0 ");

                m_fLongTapTime  = 0.0f;
                m_bLongTapCheck = false;
                GameMain.Instance.BuildingSerial = 0;
            }

            if (0 < GameMain.Instance.SwitchItemSerial)
            {
                int iSelectSerial = GameMain.Instance.SwitchItemSerial;
                GameMain.Instance.m_iSettingItemSerial = iSelectSerial;
                GameMain.Instance.SwitchItemSerial     = 0;
                m_selectItem = GameMain.dbItem.Select(iSelectSerial);
                SoundManager.Instance.PlaySE(SoundName.BUTTON_SELECT);
                CtrlFieldItem field_item = GameMain.ParkRoot.GetFieldItem(iSelectSerial);
                GameMain.Instance.SetStatus(GameMain.STATUS.CAGE_DETAIL);
            }
            else if (GameMain.Instance.TutorialInputLock == true)
            {
                // チュートリアルの入力制限中はすぐ終わる
            }
            else if (InputManager.Instance.IsPinch())
            {
                m_eStep = STEP.PINCH;
            }
            else if (InputManager.Instance.m_TouchInfo.Swipe)
            {
                m_eStep = STEP.SWIPE;
            }
            else if (InputManager.Instance.m_TouchInfo.TouchUp)
            {
                InputManager.Instance.m_TouchInfo.TouchUp = false;
                int iGridX = 0;
                int iGridY = 0;

                if (GameMain.GetGrid(InputManager.Instance.m_TouchInfo.TouchPoint, out iGridX, out iGridY))
                {
                    int iSelectSerial = 0;

                    if (0 < GameMain.Instance.BuildingSerial)
                    {
                        iSelectSerial = GameMain.Instance.BuildingSerial;
                        GameMain.Instance.BuildingSerial = 0;
                    }
                    else
                    {
                        foreach (DataItem data_item in DataManager.Instance.m_ItemDataList)
                        {
                            if (GameMain.GridHit(iGridX, iGridY, data_item))
                            {
                                iSelectSerial = data_item.item_serial;
                            }
                        }
                    }

                    if (0 < iSelectSerial)
                    {
                        Debug.Log("hit:serial=" + iSelectSerial.ToString());

                        GameMain.Instance.m_iSettingItemSerial = iSelectSerial;
                        m_selectItem = GameMain.dbItem.Select(iSelectSerial);
                        int iCategory = m_selectItem.category;
                        if (iCategory == (int)Define.Item.Category.SHOP)
                        {
                            SoundManager.Instance.PlaySE(SoundName.BUTTON_SELECT);
                            CtrlFieldItem field_item = GameMain.ParkRoot.GetFieldItem(iSelectSerial);
                            if (field_item.IsReady())
                            {
                                m_iNokoriTime = field_item.GetNokoriTime();
                                m_eStep       = STEP.SPEED_BUILD_CHECK;
                            }
                            else
                            {
                                m_eStep = STEP.SHOP;
                            }
                        }
                        else if (iCategory == (int)Define.Item.Category.CAGE)
                        {
                            SoundManager.Instance.PlaySE(SoundName.BUTTON_SELECT);
                            CtrlFieldItem field_item = GameMain.ParkRoot.GetFieldItem(iSelectSerial);
                            if (field_item.IsReady())
                            {
                                m_iNokoriTime = field_item.GetNokoriTime();
                                m_eStep       = STEP.SPEED_BUILD_CHECK;
                            }
                            else
                            {
                                GameMain.Instance.SetStatus(GameMain.STATUS.CAGE_DETAIL);
                            }
                        }
                        else if (iCategory == (int)Define.Item.Category.OFFICE)
                        {
                            SoundManager.Instance.PlaySE(SoundName.BUTTON_SELECT);
                            CtrlFieldItem field_item = GameMain.ParkRoot.GetFieldItem(iSelectSerial);
                            if (field_item.IsReady())
                            {
                                m_iNokoriTime = field_item.GetNokoriTime();
                                m_eStep       = STEP.SPEED_BUILD_CHECK;
                            }
                            else
                            {
                                GameMain.Instance.SetStatus(GameMain.STATUS.OFFICE_DETAIL);
                            }
                        }
                        else
                        {
                        }
                        break;
                    }
                }
            }
            else if (m_parkMain.m_bInputTrigger == false && InputManager.Instance.m_TouchInfo.TouchON)
            {
                m_parkMain.m_bInputTrigger = true;
                Vector2 pos = InputManager.Instance.m_TouchInfo.TouchPoint;

                Vector2 offset = new Vector2(Screen.width * 0.5f, Screen.height * 0.5f - 40.0f);

                Vector2 use = InputManager.Instance.m_TouchInfo.TouchPoint - offset;
            }
            else if (InputManager.Instance.m_TouchInfo.TouchON == false)
            {
                m_parkMain.m_bInputTrigger = false;
            }
            else if (InputManager.Instance.m_TouchInfo.TouchON && m_bLongTapCheck == false)
            {
                if (m_fLongTapTime < Define.LONG_TAP_TIME)
                {
                    m_fLongTapTime += Time.deltaTime;
                }
                else
                {
                    int iGridX = 0;
                    int iGridY = 0;
                    if (GameMain.GetGrid(InputManager.Instance.m_TouchInfo.TouchPoint, out iGridX, out iGridY))
                    {
                        int iSelectSerial = 0;
                        foreach (DataItem data_item in DataManager.Instance.m_ItemDataList)
                        {
                            if (GameMain.GridHit(iGridX, iGridY, data_item))
                            {
                                iSelectSerial = data_item.item_serial;
                            }
                        }
                        if (0 < iSelectSerial)
                        {
                            Debug.Log("hit:serial=" + iSelectSerial.ToString());

                            GameMain.Instance.m_iSettingItemSerial = iSelectSerial;
                            m_selectItem = GameMain.dbItem.Select(iSelectSerial);
                            int iCategory = m_selectItem.category;
                            if (iCategory == (int)Define.Item.Category.SHOP)
                            {
                            }
                            else if (iCategory == (int)Define.Item.Category.CAGE)
                            {
                            }
                            else if (iCategory == (int)Define.Item.Category.OFFICE)
                            {
                            }
                            else
                            {
                            }
                            m_eStep = STEP.END;
                            break;
                        }
                    }
                }
            }
            else
            {
            }

            break;

        case STEP.SWIPE:
            m_parkMain.goParkRoot.transform.localPosition += new Vector3(InputManager.Instance.m_TouchInfo.SwipeAdd.x, InputManager.Instance.m_TouchInfo.SwipeAdd.y, 0.0f);

            float fMaxX = (DataManager.user.m_iWidth) * Define.CELL_X_DIR.x;
            float fMinX = fMaxX * -1.0f;

            if (m_parkMain.goParkRoot.transform.localPosition.x < fMinX)
            {
                m_parkMain.goParkRoot.transform.localPosition = new Vector3(fMinX, m_parkMain.goParkRoot.transform.localPosition.y, m_parkMain.goParkRoot.transform.localPosition.z);
            }
            else if (fMaxX < m_parkMain.goParkRoot.transform.localPosition.x)
            {
                m_parkMain.goParkRoot.transform.localPosition = new Vector3(fMaxX, m_parkMain.goParkRoot.transform.localPosition.y, m_parkMain.goParkRoot.transform.localPosition.z);
            }
            else
            {
            }

            float fMaxY = 0.0f;
            float fMinY = (DataManager.user.m_iHeight * 2) * Define.CELL_X_DIR.y * -1.0f;
            if (m_parkMain.goParkRoot.transform.localPosition.y < fMinY)
            {
                m_parkMain.goParkRoot.transform.localPosition = new Vector3(m_parkMain.goParkRoot.transform.localPosition.x, fMinY, m_parkMain.goParkRoot.transform.localPosition.z);
            }
            else if (fMaxY < m_parkMain.goParkRoot.transform.localPosition.y)
            {
                m_parkMain.goParkRoot.transform.localPosition = new Vector3(m_parkMain.goParkRoot.transform.localPosition.x, fMaxY, m_parkMain.goParkRoot.transform.localPosition.z);
            }
            else
            {
            }


            if (InputManager.Instance.m_TouchInfo.Swipe == false)
            {
                m_eStep = STEP.IDLE;
            }
            break;

        case STEP.PINCH:
            if (bInit)
            {
                m_fPinchValueBase = InputManager.Instance.m_TouchInfo.PinchPos.magnitude;
                m_fPinchValue     = m_fPinchValueBase;
                //m_fPinchValue = InputManager.Instance.m_TouchInfo.PinchDelta;
                Debug.Log(InputManager.Instance.m_TouchInfo.PinchPos);
            }

            //Debug.Log (string.Format ("base={0} now={1} rate={2} ", InputManager.Instance.m_TouchInfo.PinchDelta, m_fPinchValue, (InputManager.Instance.m_TouchInfo.PinchDelta / m_fPinchValue)));
            Debug.Log(string.Format("base={0} now={1} delta={2} rate={3} ", m_fPinchValueBase, m_fPinchValue, InputManager.Instance.m_TouchInfo.PinchDelta, (m_fPinchValue / m_fPinchValueBase)));

            // ここの判定危険かも
            if (InputManager.Instance.IsPinch() == false && InputManager.Instance.m_TouchInfo.TouchUp)
            {
                m_eStep = STEP.IDLE;
            }
            else
            {
                m_fPinchValue  = InputManager.Instance.m_TouchInfo.PinchDelta;
                m_fPinchValue *= 0.001f;

                float fRate = GameMain.ParkRoot.myTransform.localScale.x;
                fRate += m_fPinchValue;

                if (fRate < 0.5f)
                {
                    fRate = 0.5f;
                }
                else if (2.0f < fRate)
                {
                    fRate = 2.0f;
                }
                GameMain.ParkRoot.myTransform.localScale = new Vector3(fRate, fRate, fRate);
            }
            break;

        case STEP.SHOP:
            if (bInit)
            {
                GameObject objShopDetail = PrefabManager.Instance.MakeObject("prefab/PrefShopDetail", gameObject);
                m_ctrlShopDetail = objShopDetail.GetComponent <CtrlShopDetail> ();
                m_ctrlShopDetail.Init(m_selectItem, m_parkMain.m_csParkRoot);
                //m_selectItem;
            }
            if (m_ctrlShopDetail.IsEnd())
            {
                Destroy(m_ctrlShopDetail.gameObject);
                m_ctrlShopDetail = null;
                m_eStep          = STEP.IDLE;
            }
            break;

        case STEP.SPEED_BUILD_CHECK:
            if (bInit)
            {
                //PrefItemCheck
                GameObject objOjisan = PrefabManager.Instance.MakeObject("prefab/PrefItemCheck", gameObject);
                m_itemCheck = objOjisan.GetComponent <CtrlItemCheck> ();
                string strNokoriTime = makeNokoriTime(m_iNokoriTime);
                int    iNeedTicket   = RequireTicketNum(m_iNokoriTime);
                m_itemCheck.Initialize(m_selectItem.item_id, string.Format("この施設は完成まで\n{0}です\n\nチケット{1}枚で\nすぐに完成します。", strNokoriTime, iNeedTicket));

                if (DataManager.user.m_iTicket < iNeedTicket)
                {
                    m_itemCheck.YesOrNo.EnableButtonYes(false);
                }
            }
            if (m_itemCheck.IsYes())
            {
                m_eStep = STEP.SPEED_BUILD;
            }
            else if (m_itemCheck.IsNo())
            {
                Destroy(m_itemCheck.gameObject);
                m_eStep = STEP.IDLE;
            }
            else
            {
            }
            break;

        case STEP.SPEED_BUILD:
            Destroy(m_itemCheck.gameObject);

            CsvItemData csv_item_data = DataManager.GetItem(m_selectItem.item_id);

            Dictionary <string, string> dict = new Dictionary <string, string> ();
            //dict.Add ("create_time", "\"1900-01-01 00:00:00\"");
            //dict.Add ("setting_time", "\""+ TimeManager.StrGetTime() + "\"");
            dict.Add("create_time", "\"" + TimeManager.StrGetTime(-1 * csv_item_data.production_time) + "\"");

            GameMain.dbItem.Update(m_selectItem.item_serial, dict);
            DataManager.user.AddTicket(-1 * RequireTicketNum(m_iNokoriTime));

            // 仕事の確認
            DataWork.WorkCheck();
            GameMain.Instance.HeaderRefresh();
            m_eStep = STEP.IDLE;
            break;


        default:
            break;
        }
    }