Пример #1
0
        private void SetupNotificationUI()
        {
            NotificationSettings settings = this.settings.NotificationSettings;

            EditorGUILayout.BeginHorizontal();
            EditorGUILayout.LabelField("Notification Settings", EditorStyles.boldLabel);
            EditorGUILayout.EndHorizontal();

            EditorGUILayout.BeginHorizontal();
            EditorGUILayout.LabelField("Pool Size", EditorStyles.label);
            settings.PoolSize = EditorGUILayout.IntSlider(settings.PoolSize, 1, 20);
            EditorGUILayout.EndHorizontal();

            EditorGUILayout.BeginHorizontal();
            EditorGUILayout.LabelField("Duration", EditorStyles.label);
            settings.Duration = EditorGUILayout.Slider(settings.Duration, 0.1f, 10f);
            EditorGUILayout.EndHorizontal();

            EditorGUILayout.BeginHorizontal();
            EditorGUILayout.LabelField("Message Color", EditorStyles.label);
            settings.MessageColor = EditorGUILayout.ColorField(settings.MessageColor);
            EditorGUILayout.EndHorizontal();

            EditorGUILayout.BeginHorizontal();
            EditorGUILayout.LabelField("Success Color", EditorStyles.label);
            settings.SuccessColor = EditorGUILayout.ColorField(settings.SuccessColor);
            EditorGUILayout.EndHorizontal();

            EditorGUILayout.BeginHorizontal();
            EditorGUILayout.LabelField("Error Color", EditorStyles.label);
            settings.ErrorColor = EditorGUILayout.ColorField(settings.ErrorColor);
            EditorGUILayout.EndHorizontal();

            EditorGUILayout.BeginHorizontal();
            EditorGUILayout.LabelField("Warning Color", EditorStyles.label);
            settings.WarningColor = EditorGUILayout.ColorField(settings.WarningColor);
            EditorGUILayout.EndHorizontal();

            if (GUILayout.Button("Edit Prefab"))
            {
                Selection.activeObject = notificationElement;
            }
        }
Пример #2
0
 private void Init()
 {
     settings = Settings.Instance.NotificationSettings;
     pool     = new NotificationPool(transform, settings.PoolSize);
 }