Esempio n. 1
0
        public FUSharpLatentAction()
        {
            CallbackFunc = Callback;

            latentActions.Add(this);
            index = latentActions.Count - 1;
        }
Esempio n. 2
0
        private static void RegisterCallback(string classPath, ManagedLatentCallbackRegisterDel registerCallbackFunc)
        {
            Runtime.UClass unrealClass = Runtime.UClass.GetClass(classPath);
            Debug.Assert(unrealClass != null);
            Type type = Runtime.UClass.GetType(unrealClass);

            Debug.Assert(type != null);

            BindingFlags bindingFlags   = BindingFlags.DeclaredOnly | BindingFlags.Static | BindingFlags.NonPublic;
            MethodInfo   callbackMethod = type.GetMethod("Callback", bindingFlags);

            Debug.Assert(callbackMethod != null);


            ManagedLatentCallbackDel callback = (ManagedLatentCallbackDel)callbackMethod.CreateDelegate(typeof(ManagedLatentCallbackDel));

            callbacks.Add(callback);
            registerCallbackFunc(callback);
            registerFuncs.Add(registerCallbackFunc);
        }