-
Notifications
You must be signed in to change notification settings - Fork 24
Closed
Labels
questionFurther information is requestedFurther information is requested
Description
I am not able to send the texture to unity. It needs to render the texture in unity and we get data of texture in iOS.
How to return the texture from iOS to unity ? I have data in NSData format. I can as per suggestion convert to other format as well.
But I don't know how to return the texture from ios to unity using extern methods.
if (event == kUnityRenderingExtEventUpdateTextureBeginV2)
{
// UpdateTextureBegin: Generate and return texture image data.
auto params = reinterpret_cast<UnityRenderingExtTextureUpdateParamsV2*>(data);
auto frame = params->userData;
IOS_Class *shared = [IOS_Class sharedInstance];
params->texData = (uint8_t *)(__bridge void*)[shared getData]; // Not able to rendered image to Unity texture.
}
-(NSData*) getData {
UIImage *logoImage = [UIImage imageNamed:@"logo.png"
inBundle:[NSBundle bundleForClass:self.class]
compatibleWithTraitCollection:nil];
NSLog(@"Image -- %@",logoImage);
NSData *imageData = UIImagePNGRepresentation(logoImage);
return imageData;
}
Metadata
Metadata
Assignees
Labels
questionFurther information is requestedFurther information is requested