반응형

c++ 코드에서 함소 호출 시  인자와 같이 넘길 수 있는 방법은


함수명뒤에 인자를 같이 붙여주면 된다 아래처럼 단위 함수로 만들면 유용


https://answers.unrealengine.com/questions/116529/call-blueprint-functions-from-c.html?sort=oldest



Another bit of useful code....

  1. char funcCallBuf[1024];
  2. void UTDLSurvivorFastCache::CallActorFunc(AActor * c, FString funcName)
  3. {
  4. FOutputDeviceNull ar;
  5. c->CallFunctionByNameWithArguments(*funcName, ar, NULL, true);
  6. }
  7. void UTDLSurvivorFastCache::CallActorFuncIntParam(AActor * c, FString funcName, int32 f)
  8. {
  9. _snprintf(funcCallBuf, sizeof(funcCallBuf), "%s %d", *funcName, f);
  10. FOutputDeviceNull ar;
  11. c->CallFunctionByNameWithArguments(ANSI_TO_TCHAR(funcCallBuf), ar, NULL, true);
  12. }
  13. void UTDLSurvivorFastCache::CallActorFuncFloatParam(AActor * c, FString funcName, float f)
  14. {
  15. _snprintf(funcCallBuf, sizeof(funcCallBuf), "%s %f", *funcName, f);
  16. FOutputDeviceNull ar;
  17. c->CallFunctionByNameWithArguments(ANSI_TO_TCHAR(funcCallBuf), ar, NULL, true);
  18. }
  19. void UTDLSurvivorFastCache::CallActorFuncFloatIntParam(AActor * c, FString funcName, float f, int32 n)
  20. {
  21. _snprintf(funcCallBuf, sizeof(funcCallBuf), "%s %f %d", *funcName, f, n);
  22. FOutputDeviceNull ar;
  23. c->CallFunctionByNameWithArguments(ANSI_TO_TCHAR(funcCallBuf), ar, NULL, true);
  24. }

xlar8or gravatar image xlar8or Dec 22 '15 at 10:33 PM Newest

Is there a way to do this for a AActor parameter?



C++에서 블루프린트 함수 호출하기 .1


http://3dmpengines.tistory.com/1615

반응형

+ Recent posts