示例#1
0
    private void UpdateErrorLabel()
    {
        if (Time.frameCount % 60 == 0)
        {
            if (VCEditor.s_Scene != null)
            {
                VCIsoData isodata = VCEditor.s_Scene.m_IsoData;
                attr.m_Errors.Clear();
                attr.m_Warnings.Clear();
                CreationData.CalcCreationType(isodata, attr);

                string errortext = "";
                if (isodata.m_Voxels.Count + isodata.m_Components.Count == 0)
                {
                    errortext = "";
                }
                else
                {
                    if (attr.m_Errors.Count + attr.m_Warnings.Count > 0)
                    {
                        errortext += "You must fix the issue(s) before you can export".ToLocalizationString();
                    }
                    else
                    {
                        errortext = "This ISO is ready to export".ToLocalizationString() + " !";
                        if (firstvalid)
                        {
                            firstvalid = false;
                            m_ExportTip.Show();
                        }
                    }

                    if (attr.m_Errors.Count > 0)
                    {
                        errortext += "\r\n[FF0000]\r\n";
                        foreach (string e in attr.m_Errors)
                        {
                            errortext += (" -  " + e + "\r\n");
                        }
                        errortext += "[-]";
                    }
                    if (attr.m_Warnings.Count > 0)
                    {
                        errortext += "\r\n[FFFF00]\r\n";
                        foreach (string w in attr.m_Warnings)
                        {
                            errortext += (" -  " + w + "\r\n");
                        }
                        errortext += "[-]";
                    }
                }
                m_ErrorLabel.text = errortext;
            }
        }
    }