public static void StartGeneration(string gameId, string publicKey, Constants.Environment env, Action onComplete)
        {
            m_Loader = new Loader(new AppConfig
            {
                ApiGameId   = gameId,
                PublicKey   = publicKey,
                Environment = env
            }, true);

            m_Coroutine = m_Loader.GetClasses(res =>
            {
                AssetDatabase.Refresh();

                var response = JsonUtility.FromJson <GeneratedCode>(res);
                if (response.Success)
                {
                    ParseResponse(response);
                    if (onComplete != null)
                    {
                        onComplete();
                    }
                }
                else
                {
                    EditorUtility.DisplayDialog("Error", response.Error.Message, "Ok");
                    onComplete();
                }
            });

            EditorCoroutineHelper.Execute(m_Coroutine);
        }
Esempio n. 2
0
        public static void LoadDocs(AppConfig settings, Action <ResponseData> onCompleted, Action <string, float> onProgress)
        {
            m_Loader = new Loader(settings, true);

            var helper = EditorCoroutineHelper.Create();

            m_Coroutine = m_Loader.Load(helper, responseData =>
            {
                AssetDatabase.Refresh();
                if (onCompleted != null)
                {
                    onCompleted(responseData);
                }
            }, onProgress);

            helper.LaunchCoroutine(m_Coroutine);
        }