override protected void initialize() { bool bBuyAble = true; CtrlFieldItem moveFieldItem = null; if (m_parkMain.m_eEditMode == ParkMain.EDIT_MODE.NORMAL) { // 道路のみ特殊処理 // 道のみシリアルがあるものから利用 // あとあとを見越して、同じitem_idがあれば反応できるようにしておく if (GameMain.Instance.m_iSettingItemId == Define.ITEM_ID_ROAD) { List <DataItem> same_list = GameMain.dbItem.Select(string.Format(" item_id = {0} and status = {1} ", GameMain.Instance.m_iSettingItemId, (int)Define.Item.Status.NONE)); if (0 < same_list.Count) { GameMain.Instance.m_iSettingItemSerial = same_list [0].item_serial; } else { GameMain.Instance.m_iSettingItemSerial = 0; } } } else if (m_parkMain.m_eEditMode == ParkMain.EDIT_MODE.MOVE) { // そのまま使う // 自分を一度消す int iRemoveIndex = 0; foreach (CtrlFieldItem item in GameMain.ParkRoot.m_fieldItemList) { if (item.m_dataItem.item_serial == GameMain.Instance.m_iSettingItemSerial) { //item.Remove (); moveFieldItem = item; GameMain.Instance.m_iSettingItemId = moveFieldItem.m_dataItem.item_id; // 別にここでやる必要はない GameMain.ParkRoot.m_fieldItemList.RemoveAt(iRemoveIndex); break; } iRemoveIndex += 1; } DataItem dataItem = GameMain.dbItem.Select(GameMain.Instance.m_iSettingItemSerial); // 消す予定のところに新しい土地を設置する for (int x = dataItem.x; x < dataItem.x + dataItem.width; x++) { for (int y = dataItem.y; y < dataItem.y + dataItem.height; y++) { GameObject obj = PrefabManager.Instance.MakeObject("prefab/PrefFieldItem", GameMain.ParkRoot.gameObject); obj.name = "fielditem_" + x.ToString() + "_" + y.ToString(); CtrlFieldItem script = obj.GetComponent <CtrlFieldItem> (); script.Init(x, y, 0); GameMain.ParkRoot.m_fieldItemList.Add(script); } } } else { } //Debug.LogError (GameMain.Instance.m_iSettingItemSerial); if (m_parkMain.m_pageHeader == null) { m_parkMain.m_pageHeader = m_parkMain.makeHeader("header_item", "Setting1"); } m_editItemMaster = GameMain.dbItemMaster.Select(GameMain.Instance.m_iSettingItemId); m_DontSetGridList.Clear(); Release(m_goBuyType); if (GameMain.Instance.m_iSettingItemId == Define.ITEM_ID_ROAD && GameMain.Instance.m_iSettingItemSerial == 0 && GameMain.Instance.PreSettingItemId == Define.ITEM_ID_ROAD) { m_goBuyType = PrefabManager.Instance.MakeObject("prefab/PrefBuyType", gameObject); m_goBuyType.transform.localPosition = new Vector3(190.0f, 268.0f, 0.0f); BuyItemButton buy_type = m_goBuyType.GetComponent <BuyItemButton> (); string strBuyType = "[FF0000]購入[-]"; if (0 < GameMain.Instance.m_iSettingItemSerial) { strBuyType = "保管庫"; } buy_type.SetText(strBuyType); buy_type.SetText(string.Format("{0}G", m_editItemMaster.need_coin)); } if (m_YesNoButtonManager == null) { GameObject goButtonManager = PrefabManager.Instance.MakeObject("prefab/PrefYesNoButton", gameObject); goButtonManager.transform.localPosition = new Vector3(0.0f, -400.0f, 0.0f); m_YesNoButtonManager = goButtonManager.GetComponent <ButtonManager> (); m_YesNoButtonManager.ButtonInit(); m_YesNoButtonManager.TriggerClearAll(); } CtrlYesNoButton yes_no_button = m_YesNoButtonManager.gameObject.GetComponent <CtrlYesNoButton> (); m_eStep = STEP.IDLE; m_eStepPre = STEP.MAX; GameMain.Instance.m_bStartSetting = false; // ゾンビアイコンを00の位置に表示する m_iEditItemX = 3; m_iEditItemY = 3; GameMain.GetGrid(new Vector2(Screen.width / 2, Screen.height / 2), out m_iEditItemX, out m_iEditItemY); ParkMain.EDIT_MODE eEditMode = ParkMain.EDIT_MODE.NORMAL; Debug.Log(m_parkMain.m_eEditMode); if (m_parkMain.m_eEditMode == ParkMain.EDIT_MODE.NORMAL) { GameObject prefab = PrefabManager.Instance.PrefabLoadInstance("prefab/PrefFieldItem"); GameObject obj = PrefabManager.Instance.MakeObject(prefab, m_parkMain.goParkRoot); m_editItem = obj.GetComponent <CtrlFieldItem> (); } else if (m_parkMain.m_eEditMode == ParkMain.EDIT_MODE.MOVE) { eEditMode = ParkMain.EDIT_MODE.MOVE; m_editItem = moveFieldItem; //GameMain.ParkRoot.GetFieldItem (GameMain.Instance.m_iSettingItemSerial); m_iEditItemX = m_editItem.m_dataItem.x; m_iEditItemY = m_editItem.m_dataItem.y; Debug.Log(m_editItem.m_dataItem.item_id); } m_editItem.InitEdit(m_iEditItemX, m_iEditItemY, GameMain.Instance.m_iSettingItemId, eEditMode); //Debug.LogError( string.Format( "x:{0} y:{1}" , m_iEditItemX , m_iEditItemY )); // お金が足りる // 実際には道路しかひっかからないはず if (m_editItemMaster.need_coin <= DataManager.user.m_iGold) { bBuyAble = true; ; //OK } else { bBuyAble = false; } if (bBuyAble == false && 0 == GameMain.Instance.m_iSettingItemSerial) { yes_no_button.EnableButtonYes(false); } string strWhere = " status != 0 "; if (m_parkMain.m_eEditMode == ParkMain.EDIT_MODE.MOVE) { strWhere = string.Format(" status != {0} and item_serial != {1} ", (int)Define.Item.Status.NONE, GameMain.Instance.m_iSettingItemSerial); } DataManager.Instance.m_ItemDataList = GameMain.dbItem.Select(strWhere); Grid.SetUsingGrid(ref m_DontSetGridList, DataManager.Instance.m_ItemDataList); foreach (Grid dont in m_DontSetGridList) { //Debug.Log (string.Format ("x={0} y={1} ", dont.x, dont.y)); } bool bAbleSet = Grid.AbleSettingItem(m_editItemMaster, m_iEditItemX, m_iEditItemY, m_DontSetGridList); m_editItem.SetEditAble(bAbleSet); return; }
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); }
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); }
// Update is called once per frame void Update() { bool bInit = false; if (m_eStepPre != m_eStep) { m_eStepPre = m_eStep; bInit = true; } switch (m_eStep) { case STEP.IDLE: if (bInit) { if (m_csKatazukeCheck != null) { Destroy(m_csKatazukeCheck.gameObject); m_csKatazukeCheck = null; } m_pageHeader.TriggerClear(); } displayAutoUpdate(ITEM_DETAIL_TABS); if (m_pageHeader.ButtonPushed) { m_eStep = STEP.KATAZUKE_CHECK; } break; case STEP.KATAZUKE_CHECK: if (bInit) { GameObject obj = PrefabManager.Instance.MakeObject("prefab/PrefKatazukeCheck", gameObject); m_csKatazukeCheck = obj.GetComponent <CtrlKatazukeCheck> (); m_csKatazukeCheck.Initialize(); } if (m_csKatazukeCheck.YesOrNo.IsYes()) { m_eStep = STEP.KATAZUKE; } else if (m_csKatazukeCheck.YesOrNo.IsNo()) { m_eStep = STEP.IDLE; } else { ; // なにもしない } break; case STEP.KATAZUKE: if (bInit) { } List <DataStaff> staff_list = GameMain.dbStaff.Select(" office_serial = " + GameMain.Instance.m_iSettingItemSerial.ToString()); Dictionary <string, string> dict = new Dictionary <string, string> (); dict.Add("office_serial", "0"); dict.Add("item_serial", "0"); foreach (DataStaff staff in staff_list) { CtrlFieldItem fielditem = GameMain.ParkRoot.GetFieldItem(staff.item_serial); fielditem.RemoveStaff(staff.staff_serial); GameMain.dbStaff.Update(staff.staff_serial, dict); } // 上のスタッフを削除したとにしてください Debug.Log(GameMain.Instance.m_iSettingItemSerial); CtrlFieldItem ctrlFieldItem = GameMain.ParkRoot.GetFieldItem(GameMain.Instance.m_iSettingItemSerial); for (int x = m_dataItem.x; x < m_dataItem.x + m_dataItem.width; x++) { for (int y = m_dataItem.y; y < m_dataItem.y + m_dataItem.height; y++) { GameObject obj = PrefabManager.Instance.MakeObject("prefab/PrefFieldItem", GameMain.ParkRoot.gameObject); obj.name = "fielditem_" + x.ToString() + "_" + y.ToString(); CtrlFieldItem script = obj.GetComponent <CtrlFieldItem> (); script.Init(x, y, 0); GameMain.ParkRoot.m_fieldItemList.Add(script); } } ctrlFieldItem.Remove(); GameMain.dbItem.Update(GameMain.Instance.m_iSettingItemSerial, 0, 0, 0); int iRemoveIndex = 0; foreach (CtrlFieldItem item in GameMain.ParkRoot.m_fieldItemList) { if (item.m_dataItem.item_serial == GameMain.Instance.m_iSettingItemSerial) { GameMain.ParkRoot.m_fieldItemList.RemoveAt(iRemoveIndex); break; } iRemoveIndex += 1; } // 取り除く if (m_itemDetailBase != null) { m_itemDetailBase.Remove(); } // 片付けして戻る m_closeButton.Close(); Destroy(m_csKatazukeCheck.gameObject); m_csKatazukeCheck = null; // 仕事の確認 DataWork.WorkCheck(); GameMain.Instance.HeaderRefresh(); break; default: break; } }
override protected void initialize() { m_bRemove = false; m_areaFieldItem.Clear(); m_ctrlFieldItem.gameObject.transform.parent = m_goRootPosition.transform; m_ctrlFieldItem.gameObject.transform.localScale = Vector3.one; m_ctrlFieldItem.ResetPos(); DataItemMaster master_data = GameMain.dbItemMaster.Select(m_dataItem.item_id); CsvItemDetailData item_detail = DataManager.GetItemDetail(m_dataItem.item_id, m_dataItem.level); m_lbCostMax.text = item_detail.cost.ToString(); int iCostNow = 0; int iShisyutsu = 0; List <DataStaff> staff_list = GameMain.dbStaff.Select(" office_serial = " + m_dataItem.item_serial.ToString() + " "); foreach (DataStaff staff in staff_list) { CsvStaffData data = DataManager.GetStaff(staff.staff_id); iCostNow += data.cost; iShisyutsu += data.expenditure; // わかりにくい名前にしてしまったな } m_lbCostNow.text = iCostNow.ToString(); m_lbShisyutsu.text = iShisyutsu.ToString(); Debug.Log("count=" + DataManager.Instance.m_ItemDataList.Count); for (int x = m_dataItem.x - (master_data.area); x < m_dataItem.x + master_data.size + (master_data.area); x++) { for (int y = m_dataItem.y - (master_data.area); y < m_dataItem.y + master_data.size + (master_data.area); y++) { //Debug.Log ("x=" + x.ToString () + " y=" + y.ToString ()); //foreach (DataItem data_item in DataManager.Instance.m_ItemDataList) { foreach (CtrlFieldItem field_item in GameMain.ParkRoot.m_fieldItemList) { // xyが合ってて、シリアルは別 if (field_item.m_dataItem.x == x && field_item.m_dataItem.y == y && m_dataItem.item_serial != field_item.m_dataItem.item_serial) { //CtrlFieldItem script = GameMain.ParkRoot.GetFieldItem (data_item.item_serial); CtrlFieldItem script = field_item; m_areaFieldItem.Add(script); script.gameObject.transform.parent = m_goRootPosition.transform; script.gameObject.transform.localScale = Vector3.one; script.ResetPos(); } } } } /* * float fScale = 0.5f; * m_goRootPosition.transform.localPosition = (-1.0f * Define.CELL_X_DIR.normalized * Define.CELL_X_LENGTH * m_dataItem.x) + (-1.0f * Define.CELL_Y_DIR.normalized * Define.CELL_Y_LENGTH * m_dataItem.y + new Vector3(0.0f, -240.0f,0.0f )); */ float fScale = 0.5f; m_goRootPosition.transform.localScale = new Vector3(fScale, fScale, fScale); m_goRootPosition.transform.localPosition = (-1.0f * Define.CELL_X_DIR.normalized * Define.CELL_X_LENGTH * m_dataItem.x) + (-1.0f * Define.CELL_Y_DIR.normalized * Define.CELL_Y_LENGTH * m_dataItem.y + new Vector3(0.0f, -240.0f, 0.0f)); m_goRootPosition.transform.localPosition *= fScale; return; }
// 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; } }