Example #1
0
        static ReminderCheck()
        {
            string lastDate = EditorPrefs.GetString(EditorConstants.KEY_REMINDER_DATE);
            string date     = System.DateTime.Now.ToString("yyyyMMdd"); // every day

            //string date = System.DateTime.Now.ToString("yyyyMMddHHmm"); // every minute (for tests)

            if (!date.Equals(lastDate))
            {
                int count = EditorPrefs.GetInt(EditorConstants.KEY_REMINDER_COUNT) + 1;

                if (Util.Constants.DEV_DEBUG)
                {
                    Debug.Log("Current count: " + count);
                }

                //if (count % 1 == 0) // for testing only
                if (count % 13 == 0 && EditorConfig.REMINDER_CHECK)
                {
                    if (Util.Config.DEBUG)
                    {
                        Debug.Log("Reminder active...");
                    }

                    int option = EditorUtility.DisplayDialogComplex(Util.Constants.ASSET_NAME + " - Reminder",
                                                                    "Please don't forget to rate " + Util.Constants.ASSET_NAME + " or even better write a little review – it would be very much appreciated!",
                                                                    "Yes, let's do it!",
                                                                    "Not right now",
                                                                    "Don't ask again!");

                    if (option == 0)
                    {
                        Application.OpenURL(EditorConstants.ASSET_URL);
                        EditorConfig.REMINDER_CHECK = false;

                        Debug.LogWarning("+++ Thank you for rating " + Util.Constants.ASSET_NAME + "! +++");
                    }
                    else if (option == 1)
                    {
                        // do nothing!
                    }
                    else
                    {
                        EditorConfig.REMINDER_CHECK = false;
                    }

                    EditorConfig.Save();
                }
                else
                {
                    if (Util.Config.DEBUG)
                    {
                        Debug.Log("No reminder needed.");
                    }
                }

                EditorPrefs.SetString(EditorConstants.KEY_REMINDER_DATE, date);
                EditorPrefs.SetInt(EditorConstants.KEY_REMINDER_COUNT, count);
            }
        }
Example #2
0
        protected static void save()
        {
            Util.Config.Save();
            EditorConfig.Save();

            if (Util.Config.DEBUG)
            {
                Debug.Log("Config data saved");
            }
        }
Example #3
0
        static ReminderCT()
        {
#if !CT_RTV && !CT_RADIO && !CT_BWF && !CT_TR && !CT_OC && !CT_DJ && !CT_TPS && !CT_TB && !CT_TPB && !CT_SKY3D
            if (!Util.Constants.isPro)
            {
                string lastDate = EditorPrefs.GetString(EditorConstants.KEY_CT_REMINDER_DATE);
                string date     = System.DateTime.Now.ToString("yyyyMMdd"); // every day
                //string date = System.DateTime.Now.ToString("yyyyMMddHHmm"); // every minute (for tests)

                if (!date.Equals(lastDate))
                {
                    int count = EditorPrefs.GetInt(EditorConstants.KEY_CT_REMINDER_COUNT) + 1;

                    //if (count % 1 == 0) // for testing only
                    if (count % 9 == 0 && EditorConfig.CT_REMINDER_CHECK)
                    {
                        int option = EditorUtility.DisplayDialogComplex(Util.Constants.ASSET_NAME + " - Our other assets",
                                                                        "Thank you for using '" + Util.Constants.ASSET_NAME + "'!" + System.Environment.NewLine + System.Environment.NewLine + "Please take a look at our other assets.",
                                                                        "Yes, show me!",
                                                                        "Not right now",
                                                                        "Don't ask again!");

                        if (option == 0)
                        {
                            Application.OpenURL(Common.Util.BaseConstants.ASSET_CT_URL);
                            EditorConfig.CT_REMINDER_CHECK = false;

                            Debug.LogWarning("<color=red>" + Common.Util.BaseHelper.CreateString("❤", 500) + "</color>");
                            Debug.LogWarning("<b>+++ Thank you for visiting our assets! +++</b>");
                            Debug.LogWarning("<color=red>" + Common.Util.BaseHelper.CreateString("❤", 500) + "</color>");
                        }
                        else if (option == 1)
                        {
                            // do nothing!
                        }
                        else
                        {
                            EditorConfig.CT_REMINDER_CHECK = false;
                        }

                        EditorConfig.Save();
                    }

                    EditorPrefs.SetString(EditorConstants.KEY_CT_REMINDER_DATE, date);
                    EditorPrefs.SetInt(EditorConstants.KEY_CT_REMINDER_COUNT, count);
                }
            }
#endif
        }
Example #4
0
        static ReminderCT()
        {
#if !CT_RTV && !CT_RADIO && !CT_BWF && !CT_TR && !CT_OC && !CT_DJ && !CT_TPS && !CT_TB
            string lastDate = EditorPrefs.GetString(EditorConstants.KEY_CT_REMINDER_DATE);
            string date     = System.DateTime.Now.ToString("yyyyMMdd"); // every day
            //string date = System.DateTime.Now.ToString("yyyyMMddHHmm"); // every minute (for tests)

            if (!date.Equals(lastDate))
            {
                int count = EditorPrefs.GetInt(EditorConstants.KEY_CT_REMINDER_COUNT) + 1;

                //if (count % 1 == 0) // for testing only
                if (count % 11 == 0 && EditorConfig.CT_REMINDER_CHECK)
                {
                    int option = EditorUtility.DisplayDialogComplex(Util.Constants.ASSET_NAME + " - Our other assets",
                                                                    "Thank you for using '" + Util.Constants.ASSET_NAME + "'!" + System.Environment.NewLine + System.Environment.NewLine + "Please take a look at our other assets.",
                                                                    "Yes, show me!",
                                                                    "Not right now",
                                                                    "Don't ask again!");

                    if (option == 0)
                    {
                        Application.OpenURL(Util.Constants.ASSET_CT_URL);
                        EditorConfig.CT_REMINDER_CHECK = false;

                        Debug.LogWarning("+++ Thank you for visiting our assets! +++");

                        GAApi.Event(typeof(ReminderCT).Name, "view", "count", count);
                    }
                    else if (option == 1)
                    {
                        // do nothing!
                        GAApi.Event(typeof(ReminderCT).Name, "later", "count", count);
                    }
                    else
                    {
                        EditorConfig.CT_REMINDER_CHECK = false;
                        GAApi.Event(typeof(ReminderCT).Name, "never", "count", count);
                    }

                    EditorConfig.Save();
                }

                EditorPrefs.SetString(EditorConstants.KEY_CT_REMINDER_DATE, date);
                EditorPrefs.SetInt(EditorConstants.KEY_CT_REMINDER_COUNT, count);
            }
#endif
        }
Example #5
0
        static ReminderCheck()
        {
            string lastDate = EditorPrefs.GetString(EditorConstants.KEY_REMINDER_DATE);
            int    count    = EditorPrefs.GetInt(EditorConstants.KEY_REMINDER_COUNT) + 1;
            string date     = System.DateTime.Now.ToString("yyyyMMdd"); // every day

            //string date = System.DateTime.Now.ToString("yyyyMMddHHmm"); // every minute (for tests)

            if (maxDays <= count && !date.Equals(lastDate))
            {
                //if (count % 1 == 0) // for testing only
                if (count % numberOfDays == 0)// && EditorConfig.REMINDER_CHECK)
                {
                    int option = EditorUtility.DisplayDialogComplex(Util.Constants.ASSET_NAME + " - Reminder",
                                                                    "Please don't forget to rate " + Util.Constants.ASSET_NAME + " or even better write a little review – it would be very much appreciated!",
                                                                    "Yes, let's do it!",
                                                                    "Not right now",
                                                                    "Don't ask again!");

                    if (option == 0)
                    {
                        Application.OpenURL(EditorConstants.ASSET_URL);
                        //EditorConfig.REMINDER_CHECK = false;
                        count = 9999;

                        Debug.LogWarning("<color=red>" + Common.Util.BaseHelper.CreateString("❤", 500) + "</color>");
                        Debug.LogWarning("<b>+++ Thank you for rating <color=blue>" + Util.Constants.ASSET_NAME + "</color>! +++</b>");
                        Debug.LogWarning("<color=red>" + Common.Util.BaseHelper.CreateString("❤", 500) + "</color>");
                    }
                    else if (option == 1)
                    {
                        // do nothing!
                    }
                    else
                    {
                        count = 9999;
                        //EditorConfig.REMINDER_CHECK = false;
                    }

                    EditorConfig.Save();
                }

                EditorPrefs.SetString(EditorConstants.KEY_REMINDER_DATE, date);
                EditorPrefs.SetInt(EditorConstants.KEY_REMINDER_COUNT, count);
            }
        }
Example #6
0
        private static void updateCheck()
        {
            string[] data = readData();

            updateStatus(data);

            if (status == UpdateStatus.UPDATE)
            {
                int option = EditorUtility.DisplayDialogComplex(Util.Constants.ASSET_NAME + " - Update available",
                                                                updateText(data),
                                                                "Yes, let's do it!",
                                                                "Not right now",
                                                                "Don't check again!");

                if (option == 0)
                {
                    Application.OpenURL(EditorConstants.ASSET_URL);
                }
                else if (option == 1)
                {
                    // do nothing!
                }
                else
                {
                    EditorConfig.UPDATE_CHECK = false;

                    EditorConfig.Save();
                }
            }
            else if (status == UpdateStatus.UPDATE_PRO)
            {
                int option = EditorUtility.DisplayDialogComplex(Util.Constants.ASSET_NAME + " - Upgrade needed",
                                                                updateProText(data),
                                                                "Yes, let's do it!",
                                                                "Not right now",
                                                                "Don't ask again!");

                if (option == 0)
                {
                    Application.OpenURL(Util.Constants.ASSET_PRO_URL);
                }
                else if (option == 1)
                {
                    // do nothing!
                }
                else
                {
                    EditorConfig.UPDATE_CHECK = false;

                    EditorConfig.Save();
                }
            }
            else if (status == UpdateStatus.UPDATE_VERSION)
            {
                int option = EditorUtility.DisplayDialogComplex(Util.Constants.ASSET_NAME + " - Upgrade needed",
                                                                updateVersionText(data),
                                                                "Yes, let's do it!",
                                                                "Not right now",
                                                                "Don't ask again!");

                if (option == 0)
                {
                    Application.OpenURL(EditorConstants.ASSET_URL);
                }
                else if (option == 1)
                {
                    // do nothing!
                }
                else
                {
                    EditorConfig.UPDATE_CHECK = false;

                    EditorConfig.Save();
                }
            }
            else if (status == UpdateStatus.DEPRECATED)
            {
                int option = EditorUtility.DisplayDialogComplex(Util.Constants.ASSET_NAME + " - Upgrade needed",
                                                                deprecatedText(data),
                                                                "Learn more",
                                                                "Not right now",
                                                                "Don't bother me again!");

                if (option == 0)
                {
                    Application.OpenURL(Common.Util.BaseConstants.ASSET_AUTHOR_URL);
                }
                else if (option == 1)
                {
                    // do nothing!
                }
                else
                {
                    EditorConfig.UPDATE_CHECK = false;

                    EditorConfig.Save();
                }
            }
            else
            {
                if (Util.Config.DEBUG)
                {
                    Debug.Log("Asset is up-to-date.");
                }
            }
        }
Example #7
0
        private static void updateCheck()
        {
            string[] data = readData();

            updateStatus(data);

            switch (status)
            {
            case UpdateStatus.UPDATE:
            {
                int option = EditorUtility.DisplayDialogComplex($"{Util.Constants.ASSET_NAME} - Update available",
                                                                updateText(data),
                                                                "Yes, let's do it!",
                                                                "Not right now",
                                                                "Don't check again!");

                switch (option)
                {
                case 0:
                    Util.Helper.OpenURL(EditorConstants.ASSET_URL);
                    break;

                case 1:
                    // do nothing!
                    break;

                default:
                    EditorConfig.UPDATE_CHECK = false;

                    EditorConfig.Save();
                    break;
                }

                break;
            }

            case UpdateStatus.UPDATE_VERSION:
            {
                int option = EditorUtility.DisplayDialogComplex($"{Util.Constants.ASSET_NAME} - Upgrade needed",
                                                                updateVersionText(data),
                                                                "Yes, let's do it!",
                                                                "Not right now",
                                                                "Don't ask again!");

                switch (option)
                {
                case 0:
                    Util.Helper.OpenURL(EditorConstants.ASSET_URL);
                    break;

                case 1:
                    // do nothing!
                    break;

                default:
                    EditorConfig.UPDATE_CHECK = false;

                    EditorConfig.Save();
                    break;
                }

                break;
            }

            case UpdateStatus.DEPRECATED:
            {
                int option = EditorUtility.DisplayDialogComplex($"{Util.Constants.ASSET_NAME} - Upgrade needed",
                                                                deprecatedText(data),
                                                                "Learn more",
                                                                "Not right now",
                                                                "Don't bother me again!");

                switch (option)
                {
                case 0:
                    Util.Helper.OpenURL(Common.Util.BaseConstants.ASSET_AUTHOR_URL);
                    break;

                case 1:
                    // do nothing!
                    break;

                default:
                    EditorConfig.UPDATE_CHECK = false;

                    EditorConfig.Save();
                    break;
                }

                break;
            }

            default:
            {
                if (Util.Config.DEBUG)
                {
                    Debug.Log("Asset is up-to-date.");
                }
                break;
            }
            }
        }
Example #8
0
        private static void updateCheck()
        {
            string[] data = readData();

            updateStatus(data);

            switch (status)
            {
            case UpdateStatus.UPDATE:
            {
                int option = EditorUtility.DisplayDialogComplex(Util.Constants.ASSET_NAME + " - Update available",
                                                                updateText(data),
                                                                "Yes, let's do it!",
                                                                "Not right now",
                                                                "Don't check again!");

                switch (option)
                {
                case 0:
                    Application.OpenURL(EditorConstants.ASSET_URL);
                    //UnityEditorInternal.AssetStore.Open("content/" + EditorConstants.ASSET_ID);
                    break;

                case 1:
                    // do nothing!
                    break;

                default:
                    EditorConfig.UPDATE_CHECK = false;

                    EditorConfig.Save();
                    break;
                }

                break;
            }

            case UpdateStatus.UPDATE_PRO:
            {
                int option = EditorUtility.DisplayDialogComplex(Util.Constants.ASSET_NAME + " - Upgrade needed",
                                                                updateProText(data),
                                                                "Yes, let's do it!",
                                                                "Not right now",
                                                                "Don't ask again!");

                switch (option)
                {
                case 0:
                    Application.OpenURL(Util.Constants.ASSET_PRO_URL);
                    break;

                case 1:
                    // do nothing!
                    break;

                default:
                    EditorConfig.UPDATE_CHECK = false;

                    EditorConfig.Save();
                    break;
                }

                break;
            }

            case UpdateStatus.V2019:
            {
                int option = EditorUtility.DisplayDialogComplex(Util.Constants.ASSET_NAME + " - Upgrade needed",
                                                                update2019(data),
                                                                "Yes, let's do it!",
                                                                "Not right now",
                                                                "Don't ask again!");

                switch (option)
                {
                case 0:
                    Application.OpenURL(Util.Constants.ASSET_2019_URL);
                    break;

                case 1:
                    // do nothing!
                    break;

                default:
                    EditorConfig.UPDATE_CHECK = false;

                    EditorConfig.Save();
                    break;
                }

                break;
            }

            case UpdateStatus.UPDATE_VERSION:
            {
                int option = EditorUtility.DisplayDialogComplex(Util.Constants.ASSET_NAME + " - Upgrade needed",
                                                                updateVersionText(data),
                                                                "Yes, let's do it!",
                                                                "Not right now",
                                                                "Don't ask again!");

                switch (option)
                {
                case 0:
                    Application.OpenURL(EditorConstants.ASSET_URL);
                    break;

                case 1:
                    // do nothing!
                    break;

                default:
                    EditorConfig.UPDATE_CHECK = false;

                    EditorConfig.Save();
                    break;
                }

                break;
            }

            case UpdateStatus.DEPRECATED:
            {
                int option = EditorUtility.DisplayDialogComplex(Util.Constants.ASSET_NAME + " - Upgrade needed",
                                                                deprecatedText(data),
                                                                "Learn more",
                                                                "Not right now",
                                                                "Don't bother me again!");

                switch (option)
                {
                case 0:
                    Application.OpenURL(Util.Constants.ASSET_AUTHOR_URL);
                    break;

                case 1:
                    // do nothing!
                    break;

                default:
                    EditorConfig.UPDATE_CHECK = false;

                    EditorConfig.Save();
                    break;
                }

                break;
            }

            default:
            {
                if (Util.Config.DEBUG)
                {
                    Debug.Log("Asset is up-to-date.");
                }
                break;
            }
            }
        }