/*
 * This is an example on how to use construction scripts
 * for angelscript classes. This class creates a root component
 * for itself using a construction script instead of a DefaultComponent,
 * and calculates a derived property.
 */
class AExampleConstructionScript : AHazeActor
{
	UPROPERTY(NotVisible)
	UBillboardComponent Billboard;

	UPROPERTY(Category = "Calculation")
	int ValueA = 3;

	UPROPERTY(Category = "Calculation")
	int ValueB = 3;

	/* This will be set by the construction script to the value of (ValueA * ValueB) */
	UPROPERTY(BlueprintReadOnly, NotEditable, Category = "Calculation")
	int Product;

	/* The overridden construction script will run when needed. */
	UFUNCTION(BlueprintOverride)
	void ConstructionScript()
	{
		// Create a component dynamically from construction script
		Billboard = UBillboardComponent(this, n"Billboard");
		Billboard.SetHiddenInGame(false);

		// Set the derived property
		Product = ValueA * ValueB;
	}
};
