Add Interactable Actor Component
This commit is contained in:
		
							parent
							
								
									8ffda269b7
								
							
						
					
					
						commit
						a8adf8abfb
					
				
							
								
								
									
										25
									
								
								Source/Nakatomi/InteractableComponent.cpp
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										25
									
								
								Source/Nakatomi/InteractableComponent.cpp
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,25 @@ | |||||||
|  | // Fill out your copyright notice in the Description page of Project Settings.
 | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  | #include "InteractableComponent.h" | ||||||
|  | 
 | ||||||
|  | // Sets default values for this component's properties
 | ||||||
|  | UInteractableComponent::UInteractableComponent() | ||||||
|  | { | ||||||
|  | 	// Set this component to be initialized when the game starts, and to be ticked every frame.  You can turn these features
 | ||||||
|  | 	// off to improve performance if you don't need them.
 | ||||||
|  | 	PrimaryComponentTick.bCanEverTick = false; | ||||||
|  | 
 | ||||||
|  | 	// ...
 | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  | // Called when the game starts
 | ||||||
|  | void UInteractableComponent::BeginPlay() | ||||||
|  | { | ||||||
|  | 	Super::BeginPlay(); | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | void UInteractableComponent::Interact() | ||||||
|  | { | ||||||
|  | } | ||||||
							
								
								
									
										26
									
								
								Source/Nakatomi/InteractableComponent.h
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										26
									
								
								Source/Nakatomi/InteractableComponent.h
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,26 @@ | |||||||
|  | // Fill out your copyright notice in the Description page of Project Settings.
 | ||||||
|  | 
 | ||||||
|  | #pragma once | ||||||
|  | 
 | ||||||
|  | #include "CoreMinimal.h" | ||||||
|  | #include "Components/ActorComponent.h" | ||||||
|  | #include "InteractableComponent.generated.h" | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  | UCLASS( ClassGroup=(Custom), meta=(BlueprintSpawnableComponent) ) | ||||||
|  | class NAKATOMI_API UInteractableComponent : public UActorComponent | ||||||
|  | { | ||||||
|  | 	GENERATED_BODY() | ||||||
|  | 
 | ||||||
|  | public:	 | ||||||
|  | 	// Sets default values for this component's properties
 | ||||||
|  | 	UInteractableComponent(); | ||||||
|  | 
 | ||||||
|  | protected: | ||||||
|  | 	// Called when the game starts
 | ||||||
|  | 	virtual void BeginPlay() override; | ||||||
|  | 	 | ||||||
|  | public: | ||||||
|  | 	UFUNCTION() | ||||||
|  | 	void Interact(); | ||||||
|  | }; | ||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user