예제 #1
0
        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();
        }
예제 #2
0
            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);
            }
예제 #3
0
 public static void SavePerformanceNotificationCollection(PerformanceNotificationCollection collection)
 {
     EditorPrefs.SetString(GetKeyName(nameof(notifications)), JsonUtility.ToJson(collection));
 }