Search Unity

Sudden Unity Class UnitPortDefinition and Class ValuePortDefinition ERRORS

Discussion in 'Editor & General Support' started by warxfour, Jun 29, 2022.

  1. warxfour

    warxfour

    Joined:
    Jun 24, 2022
    Posts:
    5
    [SOLVED... sort of] I imported a terrain package (through the Unity Store) and then started having these errors (in the attached image). I have no idea how to fix this... It opens on every project now and won't let me proceed. I uninstalled Unity. Uninstalled again and cleaned the registry, and it persists! Please Help!!
     

    Attached Files:

    Last edited: Jul 1, 2022
  2. warxfour

    warxfour

    Joined:
    Jun 24, 2022
    Posts:
    5
    Here is the contents of one of the error files ("Visual Input Definition")...

    Code (CSharp):
    1. using System;
    2.  
    3. namespace Unity.VisualScripting
    4. {
    5.     public sealed class ValueInputDefinition : ValuePortDefinition, IUnitInputPortDefinition
    6.     {
    7.         [SerializeAs(nameof(defaultValue))]
    8.         private object _defaultvalue;
    9.  
    10.         [Inspectable]
    11.         [DoNotSerialize]
    12.         public override Type type
    13.         {
    14.             get
    15.             {
    16.                 return base.type;
    17.             }
    18.             set
    19.             {
    20.                 base.type = value;
    21.  
    22.                 if (!type.IsAssignableFrom(defaultValue))
    23.                 {
    24.                     if (ValueInput.SupportsDefaultValue(type))
    25.                     {
    26.                         _defaultvalue = type.PseudoDefault();
    27.                     }
    28.                     else
    29.                     {
    30.                         hasDefaultValue = false;
    31.                         _defaultvalue = null;
    32.                     }
    33.                 }
    34.             }
    35.         }
    36.  
    37.         [Serialize]
    38.         [Inspectable]
    39.         public bool hasDefaultValue { get; set; }
    40.  
    41.         [DoNotSerialize]
    42.         [Inspectable]
    43.         public object defaultValue
    44.         {
    45.             get
    46.             {
    47.                 return _defaultvalue;
    48.             }
    49.             set
    50.             {
    51.                 if (type == null)
    52.                 {
    53.                     throw new InvalidOperationException("A type must be defined before setting the default value.");
    54.                 }
    55.  
    56.                 if (!ValueInput.SupportsDefaultValue(type))
    57.                 {
    58.                     throw new InvalidOperationException("The selected type does not support default values.");
    59.                 }
    60.  
    61.                 Ensure.That(nameof(value)).IsOfType(value, type);
    62.  
    63.                 _defaultvalue = value;
    64.             }
    65.         }
    66.     }
    67. }
    68.  
     
  3. warxfour

    warxfour

    Joined:
    Jun 24, 2022
    Posts:
    5
    This is the contents of the second error file (called "Visual Output Definition")...

    Code (CSharp):
    1. namespace Unity.VisualScripting
    2. {
    3.     public sealed class ValueOutputDefinition : ValuePortDefinition, IUnitOutputPortDefinition { }
    4. }
    5.  
     
  4. warxfour

    warxfour

    Joined:
    Jun 24, 2022
    Posts:
    5
    UPDATE:

    No resolution. However, I discovered that those errors in the original post only occur within one version of unity (2021.3.5.F1). I can run new projects on 2020.3.36f1 with no errors. Unfortunately my 2021 projects fail to switch to the earlier version, so fixing what is causing the errors remains unsolved.
     
  5. warxfour

    warxfour

    Joined:
    Jun 24, 2022
    Posts:
    5
    I guess you can say I "solved" the problem... Complete system reimage.