Exemplo n.º 1
0
        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();
        }
Exemplo n.º 2
0
    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));
    }
Exemplo n.º 3
0
    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);
    }
Exemplo n.º 4
0
 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();
 }
Exemplo n.º 5
0
 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();
 }
Exemplo n.º 6
0
 void OnEnbale()
 {
     editorTarget = target as ItemTimer;
 }