示例#1
0
        public override void OnInspectorGUI()
        {
            ECSProfiler             taskProfilerBehaviour = (ECSProfiler)target;
            IEntityDatabaseProfiled database = taskProfilerBehaviour.entityDatabase as IEntityDatabaseProfiled;

            EditorGUILayout.BeginVertical(GUI.skin.box);
            {
                EditorGUILayout.LabelField("Components", EditorStyles.boldLabel);
                EditorGUI.indentLevel++;
                if (database != null)
                {
                    DrawComponents(database.componentList);
                }
                EditorGUI.indentLevel--;
            }
            EditorGUILayout.EndVertical();

            EditorGUILayout.BeginVertical(GUI.skin.box);
            {
                EditorGUILayout.LabelField("Entities", EditorStyles.boldLabel);
                EditorGUI.indentLevel++;
                if (database != null)
                {
                    DrawEntities(database.entities);
                }
                EditorGUI.indentLevel--;
            }
            EditorGUILayout.EndVertical();

            EditorUtility.SetDirty(target);
        }
示例#2
0
        private static void ActivateProfile(IEntityDatabaseProfiled entityDatabase)
        {
#if ECS_PROFILER_ENABLED && UNITY_EDITOR
            GameObject  debugObject = new GameObject("ECSProfiler");
            ECSProfiler profiler    = debugObject.AddComponent <ECSProfiler>();
            profiler.entityDatabase = entityDatabase;
            GameObject.DontDestroyOnLoad(debugObject);
#endif
        }