void UHydraComponent::OnRegister() { Super::OnRegister(); //Attach the delegate pointer automatically to the owner of the component ValidSelfPointer = this; SetInterfaceDelegate(GetOwner()); HydraStartup(); }
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); }
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); }