Skip to content
This repository has been archived by the owner on Nov 1, 2024. It is now read-only.

VaFogBlockingVolume SetLayer dynamically #117

Open
Tipnos opened this issue Nov 12, 2021 · 0 comments
Open

VaFogBlockingVolume SetLayer dynamically #117

Tipnos opened this issue Nov 12, 2021 · 0 comments

Comments

@Tipnos
Copy link

Tipnos commented Nov 12, 2021

Hi,

For gameplay reason I would like to be able to change layer of VaFogBlockingVolume. I added this peace of code locally:

AVaFogLayer* AVaFogBlockingVolume::SetLayer(AVaFogLayer* InLayer)
{
	Layer = InLayer;
	if (Layer)
	{
		Layer->AddFogBlockingVolume(this);
	}
	else
	{
		Layer->RemoveFogBlockingVolume(this);
	}

	return Layer;
}
class VAFOGOFWAR_API AVaFogBlockingVolume : public AVolume
{
	GENERATED_UCLASS_BODY()

	//~ Begin AActor Interface
	virtual void PostLoad() override;
	virtual void PostActorCreated() override;
	virtual void OnConstruction(const FTransform& Transform) override;
	virtual void Destroyed() override;
	//~ End AActor Interface

#if WITH_EDITOR
	virtual void PostEditChangeProperty(FPropertyChangedEvent& PropertyChangedEvent) override;
#endif

private:
#if WITH_EDITORONLY_DATA
	UPROPERTY()
	UBillboardComponent* SpriteComponent;
#endif

public:
	/** Set Layer dynamically */
	UFUNCTION(BlueprintCallable, Category = "VaFog Blocking Volume")
	AVaFogLayer* SetLayer(AVaFogLayer* InLayer);

	/** Height level where agent is standing */
	UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "VaFog Blocking Volume")
	EVaFogHeightLevel HeightLevel;

	/** Volumes will affect terrain level being sorted by Priority */
	UPROPERTY(BlueprintReadOnly, EditAnywhere, Category = "VaFog Blocking Volume")
	int32 Priority;

protected:
	/** Target layer to paint on */
	UPROPERTY(BlueprintReadOnly, EditAnywhere, Category = "VaFog Blocking Volume")
	AVaFogLayer* Layer;

	/** Process volume bounds and apply its influence into terrain map */
	void UpdateTargetLayer();

	//////////////////////////////////////////////////////////////////////////
	// Debug

public:
	/** Debug fog layer affect */
	UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "Debug")
	bool bDebugVolume;
};

Are you ok to add it ? If so I can make a pull request.

Thanks

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant