Exemple #1
0
        void Awake()
        {
            if (Instance != null)
            {
                if (Instance != this)
                {
                    Destroy(gameObject);
                }
                return;                             // return is my addition so that the inspector in unity still updates
            }

            // Here we save our singleton instance
            Instance = this;

            DontDestroyOnLoad(gameObject);
        }
Exemple #2
0
        public bool ShareDialog(Uri contentURL            = null,
                                Uri photoURL              = null,
                                string contentTitle       = null,
                                string contentDescription = null,
                                Action doneCallback       = null)
        {
            this.doneCallback = doneCallback;

            FacebookDelegate <IShareResult> callback = ShareMessengerCallback;

            MessengerShare.ShareMessenger(this.AddCallback(callback),
                                          contentURL != null ? contentURL.AbsoluteUrlOrEmptyString() : null,
                                          contentTitle,
                                          contentDescription,
                                          photoURL != null ? photoURL.AbsoluteUrlOrEmptyString() : null);

            return(true);
        }
Exemple #3
0
        public static bool ShareMessenger(int requestId, string contentURL, string contentTitle, string contentDescription, string photoURL)
        {
            MessengerShare.IOSShareMessenger(requestId, contentURL, contentTitle, contentDescription, photoURL);

            return(true);
        }