Inheritance: UnityEngine.ScriptableObject
Example #1
0
 public static void OnPostprocessBuild(BuildTarget target, string pathToBuiltProject)
 {
     preference = Asset.Load <DeployGatePreference> ();
     if (target == BuildTarget.Android && pathToBuiltProject.Contains(preference.temp.directryPath))
     {
         AndroidPostprocessBuild(pathToBuiltProject);
     }
 }
        private static WWWForm GetForm(DeployGatePreference preference, int role, string name)
        {
            WWWForm form = new WWWForm();

            form.AddField("token", preference.user.token);
            form.AddField("role", role);
            form.AddField("users", "[" + name + "]");
            return(form);
        }
        private static WWWForm GetForm(DeployGatePreference preference, string pathToBuiltProject)
        {
            WWWForm form = new WWWForm();

            form.AddField("token", preference.user.token);
            if (!string.IsNullOrEmpty(preference.temp.messagePath))
            {
                form.AddField("message", GetMessage(preference.temp.messagePath) ?? "");
            }
            form.AddBinaryData("file", GetAPKBytes(pathToBuiltProject));
            return(form);
        }
        public static MembersInfo AddMember(int role, string name)
        {
            DeployGatePreference preference = Asset.Load <DeployGatePreference>();
            string url   = string.Format(INVITE_API, preference.user.username, PlayerSettings.bundleIdentifier);
            var    bytes = GetForm(preference, role, name).data;
            WWW    www   = new WWW(url, bytes);

            while (!www.isDone)
            {
                Thread.Sleep(1);
            }
            return(GetMembers());
        }
        public static MembersInfo DeleteMember(Member member)
        {
            DeployGatePreference preference = Asset.Load <DeployGatePreference>();
            string url = string.Format(INVITE_API, preference.user.username, PlayerSettings.bundleIdentifier);

#if UNITY_EDITOR_OSX
            Process process = new Process();
            process.StartInfo.FileName  = "curl";
            process.StartInfo.Arguments = string.Format("-X DELETE -F \"users=[{0}]\" -F \"token={1}\" {2}", member.name, preference.user.token, url);
            process.Start();
            process.WaitForExit();
#elif
            Debug.LogException(new NotImplementedException());
#endif
            return(GetMembers());
        }
        public static void OnGUI_PreferenceWindow(DeployGatePreference preference)
        {
            DeployGatePreferenceWindow.preference = preference;
            GUILayout.Label ("Settings", sectionHeader);
            ///================================

            DrawAccount ();

            ///================================
            EditorGUILayout.Space ();
            DrawPermissions ();

            ///================================

            OnGUI_DeployGateInfo ();
        }
Example #7
0
        public static void OnGUI_PreferenceWindow(DeployGatePreference preference)
        {
            DeployGatePreferenceWindow.preference = preference;
            GUILayout.Label("Settings", sectionHeader);
            ///================================

            DrawAccount();

            ///================================
            EditorGUILayout.Space();
            DrawPermissions();

            ///================================

            OnGUI_DeployGateInfo();
        }
        public static MembersInfo GetMembers()
        {
            if (req != null)
            {
                return(null);
            }
            DeployGatePreference preference = Asset.Load <DeployGatePreference>();
            string url = string.Format(INVITE_API, preference.user.username, PlayerSettings.bundleIdentifier) +
                         "?token=" + preference.user.token;

            req = new WWW(url);
            while (!req.isDone)
            {
                Thread.Sleep(1);
            }
            string text = req.text;

            req = null;
            return(MiniJSON.Json.Deserialize <MembersInfo>(text));
        }
        public static void Push(string pathToBuiltProject)
        {
            DeployGatePreference preference = Asset.Load <DeployGatePreference>();

            EditorUtility.DisplayProgressBar("Upload to DeployGate", "", 0);
            {
                WWWForm form = GetForm(preference, pathToBuiltProject);

                WWW www = new WWW(string.Format(PUSH_URL, preference.user.username), form);

                while (!www.isDone)
                {
                    EditorUtility.DisplayProgressBar("Upload to DeployGate",
                                                     string.Format("Uploading... {0}%", Mathf.FloorToInt(www.uploadProgress * 100)), www.uploadProgress);
                    System.Threading.Thread.Sleep(1);
                }
            }

            EditorUtility.ClearProgressBar();
            SaveMessage(pathToBuiltProject);
        }
 void OnEnable()
 {
     preference = Asset.Load<DeployGatePreference>();
     DeployGateBuildWindow.Reset();
     EditorUtility.UnloadUnusedAssets();
 }
        public static void OnGUI_BuildWindow(DeployGatePreference preference)
        {
            DeployGateBuildWindow.preference = preference;

            if (displayOptions.Length == 0)
            {
                GetMessages();
            }

            /// ====================
            /// Header
            /// ====================
            GUILayout.Label("Build & Upload", sectionHeader);


            Headline("Identification");
            GUILayout.BeginHorizontal();
            {
                GUILayout.Label("Version", GUILayout.Width(50));
                PlayerSettings.bundleVersion = GUILayout.TextField(PlayerSettings.bundleVersion, GUILayout.Width(50));
                GUILayout.Label("Version Code", GUILayout.Width(80));
                PlayerSettings.Android.bundleVersionCode = int.Parse(GUILayout.TextField(PlayerSettings.Android.bundleVersionCode.ToString(), GUILayout.Width(50)));
            }
            GUILayout.EndHorizontal();

            Headline("Message");
            ///================================
            GUILayout.BeginHorizontal();
            {
                EditorGUI.BeginChangeCheck();

                selectedMessage = EditorGUILayout.Popup(selectedMessage, displayOptions);
                if (EditorGUI.EndChangeCheck())
                {
                    _Repaint();
                }

                if (GUILayout.Button("Delete"))
                {
                    if (selectedMessage == 0)
                    {
                        messages[0].text = string.Empty;
                        _Repaint();
                    }
                    else
                    {
                        File.Delete(DeployGateUtility.messageLogFolderPath + DeployGateUtility.SEPARATOR + messages[selectedMessage].date.Replace(":", "-") + ".json");
                        Reset();
                    }
                }
            }
            GUILayout.EndHorizontal();

            if (selectedMessage != 0)
            {
                GUILayout.BeginVertical("box");
                GUILayout.TextArea(messages[selectedMessage].text, GUI.skin.label, GUILayout.Height(Screen.height * 0.4f));
                GUILayout.EndVertical();
            }
            else
            {
                messages[0].text = EditorGUILayout.TextArea(messages[0].text, GUILayout.Height(Screen.height * 0.4f));
            }

            ///================================

            DrawBuildType();

            ///================================

            DrawBuildButton();

            ///================================

            OnGUI_DeployGateInfo();
        }
 private static WWWForm GetForm(DeployGatePreference preference, string pathToBuiltProject)
 {
     WWWForm form = new WWWForm();
     form.AddField("token", preference.user.token);
     if (!string.IsNullOrEmpty(preference.temp.messagePath))
         form.AddField("message", GetMessage(preference.temp.messagePath) ?? "");
     form.AddBinaryData("file", GetAPKBytes(pathToBuiltProject));
     return form;
 }
 private static WWWForm GetForm(DeployGatePreference preference, int role, string name)
 {
     WWWForm form = new WWWForm();
     form.AddField("token", preference.user.token);
     form.AddField("role", role);
     form.AddField("users", "[" + name + "]");
     return form;
 }
 public static void OnPostprocessBuild(BuildTarget target, string pathToBuiltProject)
 {
     preference = Asset.Load<DeployGatePreference> ();
     if (target == BuildTarget.Android && pathToBuiltProject.Contains (preference.temp.directryPath))
         AndroidPostprocessBuild(pathToBuiltProject);
 }
 void OnEnable()
 {
     preference = Asset.Load <DeployGatePreference>();
     DeployGateBuildWindow.Reset();
     EditorUtility.UnloadUnusedAssets();
 }
        public static void OnGUI_BuildWindow(DeployGatePreference preference)
        {
            DeployGateBuildWindow.preference = preference;

            if (displayOptions.Length == 0)
                GetMessages();

            /// ====================
            /// Header
            /// ====================
            GUILayout.Label("Build & Upload", sectionHeader);

            Headline("Identification");
            GUILayout.BeginHorizontal();
            {
                GUILayout.Label("Version", GUILayout.Width(50));
                PlayerSettings.bundleVersion = GUILayout.TextField(PlayerSettings.bundleVersion, GUILayout.Width(50));
                GUILayout.Label("Version Code", GUILayout.Width(80));
                PlayerSettings.Android.bundleVersionCode = int.Parse(GUILayout.TextField(PlayerSettings.Android.bundleVersionCode.ToString(), GUILayout.Width(50)));
            }
            GUILayout.EndHorizontal();

            Headline("Message");
            ///================================
            GUILayout.BeginHorizontal();
            {
                EditorGUI.BeginChangeCheck();

                selectedMessage = EditorGUILayout.Popup(selectedMessage, displayOptions);
                if (EditorGUI.EndChangeCheck())
                {
                    _Repaint();
                }

                if (GUILayout.Button("Delete"))
                {
                    if (selectedMessage == 0)
                    {
                        messages[0].text = string.Empty;
                        _Repaint();
                    }
                    else
                    {
                        File.Delete(DeployGateUtility.messageLogFolderPath + DeployGateUtility.SEPARATOR + messages[selectedMessage].date.Replace(":", "-") + ".json");
                        Reset();
                    }
                }
            }
            GUILayout.EndHorizontal();

            if (selectedMessage != 0)
            {
                GUILayout.BeginVertical("box");
                GUILayout.TextArea(messages[selectedMessage].text, GUI.skin.label, GUILayout.Height(Screen.height * 0.4f));
                GUILayout.EndVertical();
            }
            else
                messages[0].text = EditorGUILayout.TextArea(messages[0].text, GUILayout.Height(Screen.height * 0.4f));

            ///================================

            DrawBuildType();

            ///================================

            DrawBuildButton();

            ///================================

            OnGUI_DeployGateInfo();
        }