//********************************** Banshee Engine (www.banshee3d.com) **************************************************// //**************** Copyright (c) 2016 Marko Pintera (marko.pintera@gmail.com). All rights reserved. **********************// namespace BansheeEngine { /** @addtogroup Utility * @{ */ /// /// Determines type of data to display on the profiler overlay. /// public enum ProfilerOverlayType // Note: Must match the C++ enum ProfilerOverlayType { CPUSamples, GPUSamples }; /// /// Component that displays a profiler overlay on the main game window. /// [RunInEditor] public sealed class ProfilerOverlay : ManagedComponent { private ProfilerOverlayInternal impl; /// /// Controls whether the overlay is getting updated or not. /// public bool Paused { get; set; } /// /// Changes the type of data displayed by the overlay. /// /// Type that determines the type of data to display. public void SetType(ProfilerOverlayType type) { impl.SetType(type); } private void OnReset() { if (impl != null) impl.Destroy(); Camera cam = SceneObject.GetComponent(); impl = new ProfilerOverlayInternal(cam); } private void OnUpdate() { if(!Paused) impl.Update(); } private void OnDestroy() { impl.Destroy(); } } /** @} */ }