Skip to content
Stanislav Osipov edited this page Mar 31, 2020 · 6 revisions

Welcome to Stan's Assets Scripting Reference!

The scripting reference is organized according to the available plugins. You can find plugins list as well as useful resources link below:

Foundation Library

Foundation lib is a free open source product that contains lots of useful APIs, Utilities and Extension methods. We do not provide any articles or tutorials for these plugins. But we do try to keep every public API documented and self-explanatory.

API Reference | Get From Github

Ultimate Mobile Pro

This is a bundle that contains Stan's Assets best mobile native plugins inside wrapped with powerful unified API. Our goal is to cover all your native feature needs for Mobile development with Unity. If you miss something, never hesitate to get in touch with us.

API Reference | Get From The Asset Store | Tutorials & Documentation | Forum

IOS Native Pro

The plugin contains all kinds of native APIs for the iOS platform you can think of and even more :). I do not want you to learn "another 3rd party plugin" API, that's why iOS Native plugin API is mirroring the Apple official Objective-C API in a CSharp-ish manner. As an example see the sample how to share the first image from the photo gallery to Instagram

With the Objective-C

PHFetchOptions *fetchOptions = [PHFetchOptions new];
fetchOptions.sortDescriptors = @[[NSSortDescriptor sortDescriptorWithKey:@"creationDate" ascending:false]];
PHFetchResult *result = [PHAsset fetchAssetsWithMediaType:PHAssetMediaTypeImage options:fetchOptions];

 NSString *localIdentifier = assetToShare.localIdentifier;
NSString *urlString = [NSString stringWithFormat:@"instagram://library?LocalIdentifier=%@",localIdentifier];
NSURL *instagramURL = [NSURL URLWithString:urlString];
if ([[UIApplication sharedApplication] canOpenURL: instagramURL])
{
    [[UIApplication sharedApplication] openURL:instagramURL options:@{} completionHandler:nil];
} else
{
	NSLog(@"Instagram application is not installed!");
}

With IOS Native plugin (C#)

using SA.iOS.Photos;
using SA.iOS.UIKit;
...

var fetchOptions = new ISN_PHFetchOptions();
fetchOptions.SortDescriptor = new ISN_NSSortDescriptor("creationDate", false);
fetchOptions.FetchLimit = 1;

var fetchResult = ISN_PHAsset.FetchAssetsWithOptions(fetchOptions);

var lastAsset = fetchResult.FirstObject;
var url = "instagram://library?LocalIdentifier=" + lastAsset.LocalIdentifier;

if (ISN_UIApplication.CanOpenURL(url))
   ISN_UIApplication.OpenURL(url);
else
   Debug.LogError("Instagram application is not installed!");

Clone this wiki locally