#Comparing Types

1 messages · Page 1 of 1 (latest)

snow vale
#
var types = TypeCache.GetTypesDerivedFrom<NodeData>();

foreach (var type in types)
{
    if (type.GetType() == typeof(RootNode)) return;

    evt.menu.AppendAction("Create " + type.Name, (a) => CreateNode(type));
}

im trying to omit the root type from being added as an action but it just doesnt work does anyone know how to correctly compare these

short raptor
#

Shouldn't you just be doing type == ?

#

Anyway Debug.Log could have told you this

snow vale
#

do you know the correct way to do this?

#

@short raptor

short raptor
snow vale
#

tried that

short raptor
#

Debug.Log

#

Start printing things

#

Figure out what's going wrong