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. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

System.Type on Windows Store (universal 10)

Discussion in 'Windows' started by AbstractionGames, Oct 13, 2015.

  1. AbstractionGames

    AbstractionGames

    Joined:
    Feb 12, 2014
    Posts:
    24
    Hello,

    I can't seem to find any references about this so I'm just wondering if there's a reason why a bunch of function from System.Type don't seem to be exported for Windows Store UAP ?

    error CS1061: 'Type' does not contain a definition for 'IsAssignableFrom'
    error CS1061: 'Type' does not contain a definition for 'IsEnum'
    error CS1061: 'Type' does not contain a definition for 'IsClass'

    Is there anything else to use instead ?
     
  2. Tomas1856

    Tomas1856

    Unity Technologies

    Joined:
    Sep 21, 2012
    Posts:
    3,673
    reflection API is different in .NET Core, you'll need to do something like this
    Code (csharp):
    1.  
    2. #if WINDOWS_UWP
    3. Type a;
    4. Type b;
    5. a.GetTypeInfo().IsAssignableFrom(b.GetTypeInfo());
    6. ... etc
    7. #endif
    8.  
     
  3. AbstractionGames

    AbstractionGames

    Joined:
    Feb 12, 2014
    Posts:
    24
    thanks Tomas. Is there any documentation on the TypeInfo stuff ? e.g. how do I know what's supported and what's not? because I have a lot of these and for instance GetInterface doesn't seem to be part of TypeInfo
     
  4. Tomas1856

    Tomas1856

    Unity Technologies

    Joined:
    Sep 21, 2012
    Posts:
    3,673