Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Question Upgrading to newest version

Discussion in 'Entity Component System' started by Cell-i-Zenit, Sep 23, 2022.

  1. Cell-i-Zenit

    Cell-i-Zenit

    Joined:
    Mar 11, 2016
    Posts:
    288
    Hi,

    i upgraded from version 0.13 or something, this to the newest 0.51.

    I got alot of errors, but the error messages were pretty helpful to fix each issue, except for one:

    Code (CSharp):
    1.  error CS0103: The name 'ComponentType' does not exist in the current context
    I am not really sure on how to fix this.

    The error itself points to the type "FixedString4096Bytes":

    Code (CSharp):
    1. public struct ToastMessage : IMessage
    2.   {
    3.     public ToastType Type;
    4.     public FixedString4096Bytes Message; //<<< here is the error according to compiler
    5.  
    6.     public FixedString64Bytes SystemName { get; set; }
    7.  
    8.     public static ToastMessage Of(string message)
    9.     {
    10.       return new ToastMessage()
    11.       {
    12.         Type = ToastType.Panel,
    13.         Message = message
    14.       };
    15.     }
    16.   }
    Unity Version: 2021.3.1.0f1
    Module versions are in the screenshot below

    versions.PNG
     
  2. DreamingImLatios

    DreamingImLatios

    Joined:
    Jun 3, 2017
    Posts:
    3,983
    I think you need Unity 2021.3.4 or higher if using 2021 versions.
     
  3. Cell-i-Zenit

    Cell-i-Zenit

    Joined:
    Mar 11, 2016
    Posts:
    288
    Thanks for your answer, i upgraded to 2021.3.4f1 and i still have the same error.

    EDIT: i looked around it and the error message just points to a wrong line.

    The actual error is in a code generated partial class:

    Code (CSharp):
    1.             __query_0 = GetEntityQuery(new Unity.Entities.EntityQueryDesc{All = new Unity.Entities.ComponentType[]{ComponentType.ReadOnly<Modules.RaceMode.Systems.Race>()}, Any = new Unity.Entities.ComponentType[]{}, None = new Unity.Entities.ComponentType[]{}, Options = Unity.Entities.EntityQueryOptions.Default});
    2.  
    the issue lies in:

    Code (CSharp):
    1. ComponentType.ReadOnly<Modules.RaceMode.Systems.Race>()
    If i comment out the GetSingleton<Race>() method, it works as expected
     
    Last edited: Sep 24, 2022