internal void SetVrikReferences()
        {
            //Debug.Log($"Setting VRIK references on '{name}'");

            foreach (FieldInfo sourceField in GetType().GetFields())
            {
                string[] parts  = sourceField.Name.Split('_');
                object   target = vrik;

                try
                {
                    for (int i = 0; i < parts.Length - 1; i++)
                    {
                        target = target.GetType().GetField(parts[i])?.GetValue(target);

                        if (target == null)
                        {
                            //Plugin.logger.Warn($"Target {parts[i]} is null");
                            break;
                        }
                    }

                    if (target == null)
                    {
                        break;
                    }

                    FieldInfo targetField = target.GetType().GetField(parts[parts.Length - 1]);
                    object    value       = sourceField.GetValue(this);

                    //Plugin.logger.Debug($"Set {string.Join(".", parts)} = {value}");

                    if (targetField.FieldType.IsEnum && sourceField.FieldType != targetField.FieldType)
                    {
                        Type sourceType = Enum.GetUnderlyingType(sourceField.FieldType);
                        Type targetType = Enum.GetUnderlyingType(targetField.FieldType);

                        if (sourceType != targetType)
                        {
                            //Plugin.logger.Warn($"Underlying types for {sourceField.Name} ({sourceType}) and {targetField.Name} ({targetType}) are not the same");
                        }

                        //Plugin.logger.Debug($"Converting enum value {sourceField.FieldType} ({sourceType}) -> {targetField.FieldType} ({targetType})");
                        targetField.SetValue(target, Convert.ChangeType(value, targetType));
                    }
                    else
                    {
                        if (sourceField.FieldType != targetField.FieldType)
                        {
                            //Plugin.logger.Warn($"Types for {sourceField.Name} ({sourceField.FieldType}) and {targetField.Name} ({targetField.FieldType}) are not the same");
                        }

                        targetField.SetValue(target, value);
                    }
                }
                catch (Exception ex)
                {
                    //Plugin.logger.Error(ex);
                }
            }

            if (!vrik.references.isFilled)
            {
                //Plugin.logger.Warn("Some required references are missing; auto detecting references");
                vrik.AutoDetectReferences();
            }

            referencesUpdated?.Invoke();
        }
        #pragma warning restore IDE0051
        #endregion

        private void SetVrikFields()
        {
            _logger.Info($"Setting VRIK references on '{name}'");

            foreach (FieldInfo sourceField in GetType().GetFields())
            {
                string[] parts  = sourceField.Name.Split('_');
                object   target = vrik;

                try
                {
                    for (int i = 0; i < parts.Length - 1; i++)
                    {
                        target = target.GetType().GetField(parts[i])?.GetValue(target);

                        if (target == null)
                        {
                            _logger.Warning($"Target {parts[i]} is null");
                            break;
                        }
                    }

                    if (target == null)
                    {
                        continue;
                    }

                    FieldInfo targetField = target.GetType().GetField(parts[parts.Length - 1]);
                    object    value       = sourceField.GetValue(this);

                    Type sourceType = sourceField.FieldType;
                    Type targetType = targetField.FieldType;

                    _logger.Trace($"Set {string.Join(".", parts)} = {value}");

                    if (value == null && targetType.IsValueType && Nullable.GetUnderlyingType(targetType) == null)
                    {
                        _logger.Warning($"Tried setting non-nullable type {targetType.FullName} to null");
                        continue;
                    }

                    if (sourceType != targetType)
                    {
                        _logger.Warning($"Converting value from {sourceType.FullName} to {targetType.FullName}");
                    }

                    if (sourceType.IsEnum)
                    {
                        Type sourceUnderlyingType = Enum.GetUnderlyingType(sourceType);
                        _logger.Trace($"Underlying type for source {sourceType.FullName} is {sourceUnderlyingType.FullName}");
                    }

                    if (targetType.IsEnum)
                    {
                        Type targetUnderlyingType = Enum.GetUnderlyingType(targetType);
                        _logger.Trace($"Underlying type for target {targetType.FullName} is {targetUnderlyingType.FullName}");

                        targetType = targetUnderlyingType;
                    }

                    targetField.SetValue(target, Convert.ChangeType(value, targetType));
                }
                catch (Exception ex)
                {
                    _logger.Error(ex);
                }
            }

            if (!vrik.references.isFilled)
            {
                _logger.Warning("Some required references are missing; auto detecting references");
                vrik.AutoDetectReferences();
            }
        }