Exemplo n.º 1
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();
        }
    }