Ejemplo n.º 1
0
        static void SocialShare(SLServiceType type, Action onSuccess, Action onFailure, string text, Texture2D image = null)
        {
            if (IGUtils.IsIosCheck())
            {
                return;
            }

            if (!IsAvailableForServiceType(type))
            {
                Debug.LogError("Social share for " + type + " is not available on the current device");
            }

            if (image != null)
            {
                var imageBuffer = image.EncodeToPNG();
                var handle      = GCHandle.Alloc(imageBuffer, GCHandleType.Pinned);
                _goodiesSocialShare((int)type, text, handle.AddrOfPinnedObject(), imageBuffer.Length,
                                    IGUtils.ActionVoidCallback, onSuccess.GetPointer(), onFailure.GetPointer());
                handle.Free();
                return;
            }

            // Just text
            _goodiesSocialShare((int)type, text, EmptyByteArray.GetPointer(), EmptyByteArray.Length,
                                IGUtils.ActionVoidCallback, onSuccess.GetPointer(), onFailure.GetPointer());
        }
Ejemplo n.º 2
0
 static bool IsAvailableForServiceType(SLServiceType serviceType)
 {
     return(_isAvailableForServiceType((int)serviceType));
 }