public bool IsYes() { if (GameMain.Instance.bOjisanCheck) { if (GameMain.Instance.OjisanCheckIndex == 0) { GameMain.Instance.bOjisanCheck = false; return(true); } } return(m_buttonYesNo.IsYes()); }
// Update is called once per frame void Update() { //m_fTimer += Time.deltaTime; if (10.0f < m_fTimer) { m_bIsEnd = true; } if (m_buttonYesNo.IsYes()) { m_bIsEnd = true; DataStaff staff; int iStaffCost = 0; if (0 < m_iSetStaffSerial) { //GameMain.dbStaff.Update( Debug.Log(string.Format("set staff from backyard:{0}", m_iSetStaffSerial)); string strNow = TimeManager.StrNow(); Dictionary <string, string> dict = new Dictionary <string, string> (); dict.Add("office_serial", m_dataOffice.item_serial.ToString()); dict.Add("item_serial", m_dispOffice.SelectingCageSerial.ToString()); dict.Add("setting_time", "\"" + strNow + "\""); staff = GameMain.dbStaff.Update(m_iSetStaffSerial, dict); CsvStaffData staff_data = DataManager.GetStaff(m_iSetStaffId); iStaffCost = staff_data.coin; } else { staff = GameMain.dbStaff.Insert(m_iSetStaffId, m_dataOffice.item_serial, m_dispOffice.SelectingCageSerial); CsvStaffData staff_data = DataManager.GetStaff(m_iSetStaffId); if (0 < staff_data.coin) { DataManager.user.AddGold(-1 * staff_data.coin); } else if (0 < staff_data.ticket) { DataManager.user.AddTicket(-1 * staff_data.ticket); } else { ; // エラーちゃう? } iStaffCost = staff_data.cost; } CtrlFieldItem fielditem = GameMain.ParkRoot.GetFieldItem(m_dispOffice.SelectingCageSerial); GameObject objIcon = PrefabManager.Instance.MakeObject("prefab/PrefIcon", fielditem.gameObject); CtrlIconRoot iconRoot = objIcon.GetComponent <CtrlIconRoot> (); iconRoot.Initialize(staff, fielditem); fielditem.Add(iconRoot); // 仕事の確認 DataWork.WorkCheck(); GameMain.Instance.HeaderRefresh(); GameMain.ListRefresh = true; GameMain.Instance.m_iCostNokori -= iStaffCost; } else if (m_buttonYesNo.IsNo()) { m_bIsEnd = true; } else { ; // } m_iSelectingCageSerial = m_dispOffice.SelectingCageSerial; if (m_iSelectingCageSerialPre != m_iSelectingCageSerial) { if (0 < m_iSelectingCageSerialPre) { CtrlFieldItem script = GameMain.ParkRoot.GetFieldItem(m_iSelectingCageSerialPre); script.SetColor(Color.white); } if (0 < m_iSelectingCageSerial) { m_buttonYesNo.EnableButtonYes(true); CtrlFieldItem script = GameMain.ParkRoot.GetFieldItem(m_iSelectingCageSerial); script.SetColor(Color.red); m_iSelectingCageSerialPre = m_iSelectingCageSerial; } } }