初始化提交
This commit is contained in:
		
							
								
								
									
										24
									
								
								Content/Lua/GamePlay/LuaBusyPlayerController.lua
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										24
									
								
								Content/Lua/GamePlay/LuaBusyPlayerController.lua
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,24 @@ | ||||
| local PlayerController = {} | ||||
| local KismetSystemLibrary = import("KismetSystemLibrary") | ||||
|  | ||||
|  | ||||
|  | ||||
| function PlayerController:convertCursorToWorldPosition() | ||||
|     -- 将当前鼠标的位置转化为世界的位置 | ||||
|     local FVector = import("Vector") | ||||
|     local WorldOrigin, WorldDirection = FVector(), FVector() | ||||
|     local _, MouseX, MouseY = self:GetMousePosition(nil, nil) | ||||
|     if self:DeprojectScreenPositionToWorld( | ||||
|         MouseX, MouseY, WorldOrigin, WorldDirection | ||||
|     )then | ||||
|         return WorldOrigin.X, WorldOrigin.Y | ||||
|     else | ||||
|         return nil, nil | ||||
|     end | ||||
| end | ||||
|  | ||||
| function PlayerController:QuitGame() | ||||
|     KismetSystemLibrary.QuitGame(self, self, 0, false) | ||||
| end | ||||
|  | ||||
| return Class(nil, nil, PlayerController) | ||||
		Reference in New Issue
	
	Block a user