Beispiel #1
0
        static void TogglePlayMaker()
        {
            bool enabled = false;
            bool fail    = false;

            string searchText  = "#if false";
            string replaceText = "#if true";

            string[] _files = new string[] {
                "/GameAnalytics/Plugins/Playmaker/GAInitialize.cs",
                "/GameAnalytics/Plugins/Playmaker/GetCommandCenterValueAsString.cs",
                "/GameAnalytics/Plugins/Playmaker/IsCommandCenterReady.cs",
                "/GameAnalytics/Plugins/Playmaker/SendBusinessEvent.cs",
                "/GameAnalytics/Plugins/Playmaker/SendDesignEvent.cs",
                "/GameAnalytics/Plugins/Playmaker/SendErrorEvent.cs",
                "/GameAnalytics/Plugins/Playmaker/SendProgressionEvent.cs",
                "/GameAnalytics/Plugins/Playmaker/SendResourceEvent.cs",
                "/GameAnalytics/Plugins/Playmaker/SetBirthYear.cs",
                "/GameAnalytics/Plugins/Playmaker/SetFacebookID.cs",
                "/GameAnalytics/Plugins/Playmaker/SetGender.cs",
                "/GameAnalytics/Plugins/Playmaker/SetCustomDimension.cs",
                "/GameAnalytics/Plugins/Playmaker/Editor/SendProgressionEventActionEditor.cs",
                "/GameAnalytics/Plugins/Playmaker/Editor/SendResourceEventActionEditor.cs",
                "/GameAnalytics/Plugins/Playmaker/Editor/SetGenderActionEditor.cs"
            };

            foreach (string _file in _files)
            {
                try {
                    enabled = ReplaceInFile(Application.dataPath + _file, searchText, replaceText);
                } catch {
                    Debug.Log("Failed to toggle " + _file);
                    fail = true;
                }
            }

            AssetDatabase.Refresh();

            if (fail)
            {
                PlayMakerPresenceCheck.ResetPrefs();
                Debug.Log("Failed to toggle PlayMaker Scripts.");
            }
            else if (enabled)
            {
                Debug.Log("Enabled PlayMaker Scripts.");
            }
            else
            {
                PlayMakerPresenceCheck.ResetPrefs();
                Debug.Log("Disabled PlayMaker Scripts.");
            }
        }
Beispiel #2
0
        static void TogglePlayMaker()
        {
            bool enabled = false;
            bool fail    = false;

            string searchText  = "#if false";
            string replaceText = "#if true";

            string[] _files = new string[] {
                "GAInitialize.cs",
                "GetABTestingId.cs",
                "GetABTestingVariantId.cs",
                "GetRemoteConfigsValueAsString.cs",
                "IsRemoteConfigsReady.cs",
                "SendAdEvent.cs",
                "SendBusinessEvent.cs",
                "SendDesignEvent.cs",
                "SendErrorEvent.cs",
                "SendProgressionEvent.cs",
                "SendResourceEvent.cs",
                "SetCustomDimension.cs",
                "SendProgressionEventActionEditor.cs",
                "SendResourceEventActionEditor.cs"
            };

            foreach (string _file in _files)
            {
                try {
                    enabled = ReplaceInFile(GameAnalytics.WhereIs(_file, "Script"), searchText, replaceText);
                } catch {
                    Debug.Log("Failed to toggle " + _file);
                    fail = true;
                }
            }

            AssetDatabase.Refresh();

            if (fail)
            {
                PlayMakerPresenceCheck.ResetPrefs();
                Debug.Log("Failed to toggle PlayMaker Scripts.");
            }
            else if (enabled)
            {
                Debug.Log("Enabled PlayMaker Scripts.");
            }
            else
            {
                PlayMakerPresenceCheck.ResetPrefs();
                Debug.Log("Disabled PlayMaker Scripts.");
            }
        }
Beispiel #3
0
    static void TogglePlayMaker()
    {
        bool enabled = false;
        bool fail    = false;

        string searchText  = "#if false";
        string replaceText = "#if true";

        string[] _files = new string[] {
            "/GameAnalytics/Plugins/Playmaker/SendBusinessEvent.cs",
            "/GameAnalytics/Plugins/Playmaker/SendDesignEvent.cs",
            "/GameAnalytics/Plugins/Playmaker/SendErrorEvent.cs",
            "/GameAnalytics/Plugins/Playmaker/SendUserEvent.cs",
            "/GameAnalytics/Plugins/Playmaker/Editor/SendUserEventActionEditor.cs",
            "/GameAnalytics/Plugins/Playmaker/QueueEndSubmit.cs",
            "/GameAnalytics/Plugins/Playmaker/QueueForceSubmit.cs",
            "/GameAnalytics/Plugins/Playmaker/ConvertFloatToLowestCurrencyUnit.cs",
            "/GameAnalytics/Plugins/Playmaker/SetCustomUserID.cs",
            "/GameAnalytics/Plugins/Playmaker/SetCustomArea.cs"
        };

        foreach (string _file in _files)
        {
            try {
                enabled = ReplaceInFile(Application.dataPath + _file, searchText, replaceText);
            } catch {
                Debug.Log("Failed to toggle " + _file);
                fail = true;
            }
        }

        AssetDatabase.Refresh();

        if (fail)
        {
            PlayMakerPresenceCheck.ResetPrefs();
            Debug.Log("Failed to toggle PlayMaker Scripts.");
        }
        else if (enabled)
        {
            Debug.Log("Enabled PlayMaker Scripts.");
        }
        else
        {
            PlayMakerPresenceCheck.ResetPrefs();
            Debug.Log("Disabled PlayMaker Scripts.");
        }
    }