Exemplo n.º 1
0
            public void ConfigureWithModule(ProfilerModule module)
            {
                bool isActive = module.active;

                SetActive(isActive);

                m_Label.text = module.DisplayName;
            }
Exemplo n.º 2
0
        static ModuleData CreateWithProfilerModule(ProfilerModule module)
        {
            var isEditable = module is DynamicProfilerModule;
            var moduleData = new ModuleData(module.Identifier, module.DisplayName, isEditable);

            var chartCounters = new List <ProfilerCounterData>(ProfilerCounterDataUtility.ConvertToLegacyCounterDatas(module.ChartCounters));

            moduleData.m_ChartCounters = chartCounters;

            return(moduleData);
        }
Exemplo n.º 3
0
        bool ValidateChanges(out string localizedErrorDescription)
        {
            localizedErrorDescription = null;

            var identifiers = new List <string>(m_Modules.Count);

            foreach (var module in m_Modules)
            {
                // Is there a duplicate identifier? Because dynamic modules use their user-typed name as their identifier, we are checking that none of the other user-created dynamic modules have the same name. Type-defined Profiler modules will never clash because they use their assembly-qualified type name as identifier (which the user cannot type in here due to character limits). This is why we then use the module's name in the error message below.
                var moduleIdentifier = module.identifier;
                if (!identifiers.Contains(moduleIdentifier))
                {
                    identifiers.Add(moduleIdentifier);
                }
                else
                {
                    localizedErrorDescription = LocalizationDatabase.GetLocalizedString($"There are two modules called '{module.name}'. Module names must be unique.");
                    break;
                }

                // Is the name valid?
                if (!ProfilerModule.IsValidDisplayName(module.name))
                {
                    localizedErrorDescription = LocalizationDatabase.GetLocalizedString($"All modules must have a name.");
                    break;
                }

                // Does the module have at least one counter?
                if (module.chartCounters.Count == 0)
                {
                    localizedErrorDescription = LocalizationDatabase.GetLocalizedString($"The module '{module.name}' has no counters. All modules must have at least one counter.");
                }
            }

            return(localizedErrorDescription == null);
        }