예제 #1
0
        /// <summary>
        /// Gets the address of the UEnum for the given enum type
        /// </summary>
        /// <param name="type">The type of the enum</param>
        /// <returns>The address of the UEnum for the given type</returns>
        public static IntPtr GetEnumAddress(Type type)
        {
            UUnrealTypePathAttribute pathAttribute = UnrealTypes.GetPathAttribute(type);

            if (pathAttribute != null)
            {
                if (pathAttribute.IsManagedType)
                {
                    return(ManagedUnrealTypes.GetEnumAddress(type));
                }
                else
                {
                    return(GetEnumAddress(pathAttribute.Path));
                }
            }
            return(IntPtr.Zero);
        }
예제 #2
0
        /// <summary>
        /// Loads the address of the UEnum for the given enum type
        /// </summary>
        /// <param name="type">The type of the enum</param>
        /// <returns>The address of the UEnum for the given type</returns>
        public static IntPtr LoadEnumAddress(Type type)
        {
            UUnrealTypePathAttribute pathAttribute = UnrealTypes.GetPathAttribute(type);

            if (pathAttribute != null)
            {
                if (pathAttribute.IsManagedType)
                {
                    // TODO: Support dynamic loading of managed types
                    return(ManagedUnrealTypes.GetEnumAddress(type));
                }
                else
                {
                    return(LoadEnumAddress(pathAttribute.Path));
                }
            }
            return(IntPtr.Zero);
        }