public static void AddPerformanceNotification(PerformanceNotificationCollection collection, PerformanceNotification notification) { if (Array.Find(collection.items, i => i.name == notification.name) != null) { return; } var newList = new List <PerformanceNotification>(collection.items) { notification }; collection.items = newList.ToArray(); }
public static PerformanceNotificationCollection GetDefaultNotifications() { var collection = new PerformanceNotificationCollection(); collection.items = new[] { new PerformanceNotification { enabled = true, name = "Application.Tick", threshold = 500 }, new PerformanceNotification { enabled = true, name = "Application.Reload", threshold = 500 }, }; return(collection); }
public static void SavePerformanceNotificationCollection(PerformanceNotificationCollection collection) { EditorPrefs.SetString(GetKeyName(nameof(notifications)), JsonUtility.ToJson(collection)); }