Game Development Community

Delegates not being exposed to TXB

by Matthew Shapiro · in Torque X 2D · 04/05/2008 (12:29 pm) · 0 replies

Was the method for exposing delegates to TXB changed somehow, because I did this in my TX 1.0 project without problem.

Here's the issue. I have a component with a property:

public ProjectileInitializationDelegate ProjectileInit
        {
            get { return _projectileInit; }
            set { _projectileInit = value; }
        }

The code defining the delegate is:

[TorqueXmlSchemaType]
public delegate bool ProjectileInitializationDelegate(int powerLevel, out FireProjectileDelegate fireFunction,
                                                       params TorqueObjectType[] enemyTypes);

In my missile class I have the following function

public static bool initializeMissileSystem(int powerLevel, out FireProjectileDelegate fireFunction,
                                              params TorqueObjectType [] enemyTypes)
{ 
...
}

However, TXB isn't populating the ProjectileInit property's drop down with this. I know this delegate system works because I set _projectileInit manually and everything works. What else do I need to do to expose that delegate to TXB (note: I did try adding [TorqueXmlSchemaType] before the initializeMissileSystem() with no effect)?