public ItemsInformationcs() { InitializeComponent(); FormBorderStyle = FormBorderStyle.FixedDialog; MaximizeBox = false; StartPosition = FormStartPosition.CenterScreen; try { SQLItemsControl = new SQLDataControl(); } catch (MySqlException) { MessageBox.Show("Database connection problem"); } foreach (string productitem in SQLItemsControl.GetBuyProducts()) { cbProducts.Items.Add(productitem).ToString(); } foreach (string productitem in SQLItemsControl.GetLoanProducts()) { cbLoanProducts.Items.Add(productitem).ToString(); } ItemTimer.Start(); }
public void SpawnTimer(Sprite s, Color c, float length) { ItemTimer new_timer = Instantiate(timer_prefab, transform).GetComponent <ItemTimer>(); new_timer.Init(s, c); StartCoroutine(TimerRoutine(new_timer, length)); }
IEnumerator TimerRoutine(ItemTimer t, float length) { float start_time = length; while (length > 0) { length -= Time.deltaTime; t.SetFill(length / start_time); yield return(null); } Destroy(t.gameObject); }
public void ActivateMagnet() { if (magnetTimer.activeSelf) { ItemTimer itemTimer = magnetTimer.GetComponent <ItemTimer>(); itemTimer.Init(); } else { magnetTimer.SetActive(true); } magnet.SetActive(true); magnetOn = true; magnetOnTime = StoreItemIniter.GetMagnetDataTime(); }
public void ShieldActivate() { if (shieldTimer.activeSelf) { ItemTimer itemTimer = shieldTimer.GetComponent <ItemTimer>(); itemTimer.Init(); } else { shieldTimer.SetActive(true); } shield.SetActive(true); shielded = true; shieldOnTime = StoreItemIniter.GetShieldDataTime(); }
void OnEnbale() { editorTarget = target as ItemTimer; }