Beispiel #1
0
    private void OnMouseDown()
    {
        if (_lootCrate.IsOpeningOrClosing())
        {
            return;
        }

        if (_lootCrate.IsOpen())
        {
            _lootCrate.Close();
        }
        else
        {
            _lootCrate.Open();
        }
    }
Beispiel #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();
        }
    }
Beispiel #3
0
    private void Update()
    {
        //update the status if required
        if (statusText != null)
        {
            string status = "Status:";

            if (lootCrate.IsOpen())
            {
                status += "OPEN";
            }
            else if (lootCrate.IsClosed())
            {
                status += "CLOSED";
            }
            else
            {
                status += " - ";
            }

            status += " / ";

            if (lootCrate.IsOpening())
            {
                status += "OPENING";
            }
            else if (lootCrate.IsClosing())
            {
                status += "CLOSING";
            }
            else
            {
                status += "-";
            }

            statusText.text = status;
        }
        //update the material info if required
        if (materialText != null)
        {
            if (materials.Length == 0)
            {
                materialText.text = "-";
            }
            else
            {
                if (_currentMaterialIndex >= 0)
                {
                    materialText.text = "" + (_currentMaterialIndex + 1) + "/" + materials.Length;
                }
                else
                {
                    materialText.text = "R";
                }
            }
        }

        if (steamText != null)
        {
            steamText.text = "Steam mode:" + lootCrate.GetSteamMode();
        }
    }