33 lines
		
	
	
		
			898 B
		
	
	
	
		
			C#
		
	
	
	
	
	
		
		
			
		
	
	
			33 lines
		
	
	
		
			898 B
		
	
	
	
		
			C#
		
	
	
	
	
	
|  | using UnrealSharp.Attributes; | ||
|  | using UnrealSharp.Engine; | ||
|  | 
 | ||
|  | namespace Level.GameSettings; | ||
|  | 
 | ||
|  | [UClass] | ||
|  | public class ABusyLevelGameMode : AGameMode | ||
|  | { | ||
|  |     [UProperty(PropertyFlags.EditDefaultsOnly)] | ||
|  |     public UnrealSharp.TSubclassOf<AActor> GameMapActorClass { get; set; } | ||
|  | 
 | ||
|  |     protected override void BeginPlay() | ||
|  |     { | ||
|  |         base.BeginPlay(); | ||
|  |         if (GameMapActorClass.Valid) | ||
|  |         { | ||
|  |             SpawnActor(GameMapActorClass); | ||
|  |         } | ||
|  |     } | ||
|  |      | ||
|  | } | ||
|  | 
 | ||
|  | // -- function LevelGameMode:K2_PostLogin(new_player_controller) | ||
|  | // --     local new_player_state = new_player_controller.PlayerState | ||
|  | // --     local role = new_player_state:CreateRoleRoster(new_player_controller) | ||
|  | // --     local new_pos = FVector() | ||
|  | // --     new_pos.X = 500 | ||
|  | // --     new_pos.Y = 500 | ||
|  | // --     new_pos.Z = 50 | ||
|  | // --     role:K2_SetActorLocation(new_pos, true, nil, false) | ||
|  | // --     new_player_controller:Possess(role) | ||
|  | // -- end |