Пример #1
0
    private void OnMouseDown()
    {
        if (_lootCrate.IsOpeningOrClosing())
        {
            return;
        }

        if (_lootCrate.IsOpen())
        {
            _lootCrate.Close();
        }
        else
        {
            _lootCrate.Open();
        }
    }
Пример #2
0
    private void Update()
    {
        if (_lootCrate.IsOpeningOrClosing())
        {
            return;
        }

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