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)); } }
private void OnMouseDown() { if (_lootCrate.IsOpeningOrClosing()) { return; } if (_lootCrate.IsOpen()) { _lootCrate.Close(); } else { _lootCrate.Open(); } }
private void Update() { if (_lootCrate.IsOpeningOrClosing()) { return; } if (Input.GetKeyDown(openKey) && _lootCrate.IsClosed()) { _lootCrate.Open(); } if (Input.GetKeyDown(closeKey) && _lootCrate.IsOpen()) { _lootCrate.Close(); } }