Esempio n. 1
0
    private IEnumerator autoPlay()
    {
        yield return(new WaitForSeconds(2));

        while (true)
        {
            lootCrate.Open();
            yield return(new WaitForSeconds(4f));

            lootCrate.Close();
            yield return(new WaitForSeconds(1f));

            NextMaterial();
            yield return(new WaitForSeconds(2f));
        }
    }
Esempio n. 2
0
    private void OnMouseDown()
    {
        if (_lootCrate.IsOpeningOrClosing())
        {
            return;
        }

        if (_lootCrate.IsOpen())
        {
            _lootCrate.Close();
        }
        else
        {
            _lootCrate.Open();
        }
    }
Esempio n. 3
0
    private void Update()
    {
        if (_lootCrate.IsOpeningOrClosing())
        {
            return;
        }

        if (Input.GetKeyDown(openKey) && _lootCrate.IsClosed())
        {
            _lootCrate.Open();
        }
        if (Input.GetKeyDown(closeKey) && _lootCrate.IsOpen())
        {
            _lootCrate.Close();
        }
    }