Exemplo n.º 1
0
void UHydraComponent::OnRegister()
{
    Super::OnRegister();

    //Attach the delegate pointer automatically to the owner of the component
    ValidSelfPointer = this;
    SetInterfaceDelegate(GetOwner());
    HydraStartup();
}
Exemplo n.º 2
0
void ULeapController::OnRegister()
{
	Super::OnRegister();

	//Attach the delegate pointer automatically
	SetInterfaceDelegate(GetOwner());

	//Track and warn users about multiple components.
	controllerCount++;
	if (controllerCount>1)
		UE_LOG(LeapPluginLog, Warning, TEXT("Warning! More than one (%d) Leap Controller Component detected! Duplication of work and output may result (inefficiency warning)."), controllerCount);

	//UE_LOG(LeapPluginLog, Log, TEXT("Registered Leap Component(%d)."), controllerCount);
}
Exemplo n.º 3
0
void MyoDelegateBlueprint::MyoStartup()
{
	MyoDelegate::MyoStartup();

	//Setup our Controller BP array
	
	for (int i = 0; i < MyoMaxId(); i++)
	{
		InternalAddController(i+1);
	}

	UObject* validUObject = NULL;
	validUObject = Cast<UObject>(ValidSelfPointer);

	//Set self as interface delegate by default
	if (!_interfaceDelegate && validUObject)
		SetInterfaceDelegate(validUObject);
}
//Startup
void HydraBlueprintDelegate::HydraStartup()
{
	HydraDelegate::HydraStartup();

	UObject* validUObject = NULL;
	validUObject = Cast<UObject>(ValidSelfPointer);

	//Setup our Controller BP array
	for (int i = 0; i < MAX_CONTROLLERS_SUPPORTED; i++)
	{
		UHydraSingleController* controller;
		if (validUObject)
			controller = NewObject<UHydraSingleController>(validUObject, UHydraSingleController::StaticClass());
		else
			controller = NewObject<UHydraSingleController>(UHydraSingleController::StaticClass());	//no ownership
		_latestFrame.Add(controller);
	}

	//Set self as interface delegate by default
	if (!_interfaceDelegate && validUObject)
		SetInterfaceDelegate(validUObject);
}