Beispiel #1
0
        //-------------------------------------------------------------------------------------------------------------
        private void Initialization(string sMessage, ShowMyAppShareOnCompleteBlock sCompleteBlock = null)
        {
#if UNITY_EDITOR
            bool tReturn = EditorUtility.DisplayDialog("Share not working in editor", sMessage, "OK", "NOK");
            if (tReturn == true)
            {
                sCompleteBlock?.Invoke(ShowMyAppState.OK);
            }
            else
            {
                sCompleteBlock?.Invoke(ShowMyAppState.NOK);
            }
#else
    #if UNITY_IPHONE
            ShowMyAppShareIOS.Create(sMessage, sCompleteBlock);
    #elif UNITY_ANDROID
            ShowMyAppShareAndroid.Create(sMessage, sCompleteBlock);
    #elif UNITY_STANDALONE_OSX
            ShowMyAppShareOSX.Create(sMessage, sCompleteBlock);
    #elif UNITY_STANDALONE_WIN
            Debug.Log("ALERT " + sTitle + " " + sMessage);
    #elif UNITY_STANDALONE_LINUX
            Debug.Log("ALERT " + sTitle + " " + sMessage);
    #else
            Debug.Log("ALERT " + sTitle + " " + sMessage);
    #endif
#endif
        }
 //-------------------------------------------------------------------------------------------------------------
 public static ShowMyAppShareIOS Create(string sMessage, ShowMyAppShareOnCompleteBlock sCompleteBlock)
 {
     ShowMyAppShareIOS tDialog = new GameObject("ShowMyAppIOS_GameObject").AddComponent<ShowMyAppShareIOS>();
     tDialog.Message = sMessage;
     tDialog.CompleteBlock = sCompleteBlock;
     tDialog.Initialization(tDialog.name, "OnShareCompletedCallback");
     return tDialog;
 }
Beispiel #3
0
 public void ShareFull(ShowMyAppShareOnCompleteBlock sCompleteBlock)
 {
     GetFullURL(delegate(string sURL)
     {
         ShowMyAppShare.Share(Message + "\n" + sURL, sCompleteBlock);
     }
                );
 }
        //-------------------------------------------------------------------------------------------------------------
        public static ShowMyAppShareAndroid Create(string sMessage, ShowMyAppShareOnCompleteBlock sCompleteBlock)
        {
            Debug.Log("ShowMyAppShareAndroid Create()");
            ShowMyAppShareAndroid tDialog = new GameObject("ShowMyAppAndroid_GameObject").AddComponent <ShowMyAppShareAndroid>();

            tDialog.Message       = sMessage;
            tDialog.CompleteBlock = sCompleteBlock;
            tDialog.Initialization(tDialog.name, "OnShareCompletedCallback");
            return(tDialog);
        }
Beispiel #5
0
 public void Share(ShowMyAppShareOnCompleteBlock sCompleteBlock = null)
 {
     if (Tiny == true)
     {
         ShareTiny(sCompleteBlock);
     }
     else
     {
         ShareFull(sCompleteBlock);
     }
 }
Beispiel #6
0
        //-------------------------------------------------------------------------------------------------------------
        public static ShowMyAppShareOSX Create(string sTitle, string sMessage, string sOK, ShowMyAppShareOnCompleteBlock sCompleteBlock)
        {
            ShowMyAppShareOSX tDialog = new GameObject("ShowMyAppOSX_GameObject").AddComponent <ShowMyAppShareOSX>();

            tDialog.Message       = sMessage;
            tDialog.CompleteBlock = sCompleteBlock;
            tDialog.Initialization(tDialog.name, "OnShareCompletedCallback");
            return(tDialog);
        }
Beispiel #7
0
 //-------------------------------------------------------------------------------------------------------------
 public ShowMyAppShare(string sMessage, ShowMyAppShareOnCompleteBlock sCompleteBlock)
 {
     Initialization(sMessage, sCompleteBlock);
 }
Beispiel #8
0
        //-------------------------------------------------------------------------------------------------------------
        public static ShowMyAppShare Share(string sMessage, ShowMyAppShareOnCompleteBlock sCompleteBlock)
        {
            ShowMyAppShare rReturn = new ShowMyAppShare(sMessage, sCompleteBlock);

            return(rReturn);
        }