3
0

LuaScriptUtilities.cpp 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. /*
  2. * Copyright (c) Contributors to the Open 3D Engine Project.
  3. * For complete copyright and license terms please see the LICENSE at the root of this distribution.
  4. *
  5. * SPDX-License-Identifier: Apache-2.0 OR MIT
  6. *
  7. */
  8. #include <Atom/RPI.Reflect/Material/LuaScriptUtilities.h>
  9. #include <AzCore/RTTI/BehaviorContext.h>
  10. namespace AZ
  11. {
  12. namespace RPI
  13. {
  14. void LuaScriptUtilities::Reflect(AZ::BehaviorContext* behaviorContext)
  15. {
  16. behaviorContext->Method("Error", &Error);
  17. behaviorContext->Method("Warning", &Warning);
  18. behaviorContext->Method("Print", &Print);
  19. }
  20. void LuaScriptUtilities::Error([[maybe_unused]] const AZStd::string& message)
  21. {
  22. AZ_Error(DebugName, false, "Lua script: %s", message.c_str());
  23. }
  24. void LuaScriptUtilities::Warning([[maybe_unused]] const AZStd::string& message)
  25. {
  26. AZ_Warning(DebugName, false, "Lua script: %s", message.c_str());
  27. }
  28. void LuaScriptUtilities::Print([[maybe_unused]] const AZStd::string& message)
  29. {
  30. AZ_TracePrintf(DebugName, "Lua script: %s\n", message.c_str());
  31. }
  32. } // namespace RPI
  33. } // namespace AZ