Ejemplo n.º 1
0
 public static void Init()
 {
     if (Instance == null)
     {
         Instance = new RollbarNotifier();
     }
 }
Ejemplo n.º 2
0
        private static void BuildAndUpload()
        {
            RollbarNotifier.Init();
            if (CheckSelectedObjectIsPrefab())
            {
                bool isError = false;
                // 選択中のPrefabアセットパス, アセット名を取得
//                foreach(var selectObject in Selection.objects)
                for (int i = Selection.objects.Length - 1; i >= 0; i--)
                {
                    var       selectObject = Selection.objects[i];
                    Converter converter    = new Converter(selectObject);
                    if (converter.BuildAsset() == false && converter.error != null)
                    {
                        isError = true;
                        converter.error.ShowDialog();
                        Debug.LogError(selectObject.name + " Upload Failed!");
                        break;
                    }
                    else
                    {
                        Debug.Log(selectObject.name + " Upload Success!");
                        var list = new List <UnityEngine.Object>();
                        list.AddRange(Selection.objects);
                        list.Remove(selectObject);
                        Selection.objects = list.ToArray();
                    }
                }
                if (isError)
                {
                }
                else
                {
                    Editor.ShowUploadSucessDialog();
                }

                //Converter converter = new Converter (Selection.objects [0]);
                //if (converter.BuildAsset () == false && converter.error != null) {
                //	//RollbarNotifier.Instance.SendError (converter.error);
                //	converter.error.ShowDialog ();
                //} else {
                //	Editor.ShowUploadSucessDialog ();
                //}
            }
        }
Ejemplo n.º 3
0
 private static void BuildAndUpload()
 {
     RollbarNotifier.Init();
     if (CheckSelectedObjectIsPrefab())
     {
         // 選択中のPrefabアセットパス, アセット名を取得
         Converter converter = new Converter(Selection.objects [0]);
         if (converter.BuildAsset() == false && converter.error != null)
         {
             RollbarNotifier.Instance.SendError(converter.error);
             converter.error.ShowDialog();
         }
         else
         {
             Editor.ShowUploadSucessDialog();
         }
     }
 }
Ejemplo n.º 4
0
        private static void BuildAndUpload()
        {
            RollbarNotifier.Init();
            if (CheckSelectedObjectIsPrefab())
            {
                bool isError = false;
                // 選択中のPrefabアセットパス, アセット名を取得
                var assetList = new List <UnityEngine.Object>();
                assetList.AddRange(Selection.objects);
                var unprocessedAssetList = new List <UnityEngine.Object>();
                unprocessedAssetList.AddRange(Selection.objects);
                string errorMessages = "";

                int count        = 0;
                int selectLength = Selection.objects.Length;
                for (count = 0; count < selectLength; count++)
                {
                    var       selectObject = assetList[count];
                    Converter converter    = new Converter(selectObject);

                    if (converter.BuildAsset() == false && converter.error != null)
                    {
                        isError        = true;
                        errorMessages += selectObject.name + ":" + converter.error.message + "\r\n";
                    }
                    else
                    {
                        Debug.Log(selectObject.name + " Upload Success!");
                        unprocessedAssetList.Remove(selectObject);
                    }
                }

                if (isError)
                {
                    // エラーが発生した場合、処理されていないオブジェクトを選択する。
                    Selection.objects = unprocessedAssetList.ToArray();
                    Editor.ShowErrorDialog(errorMessages);
                }
                else
                {
                    Editor.ShowUploadSucessDialog();
                }
            }
        }
Ejemplo n.º 5
0
        public bool BuildAsset()
        {
            RollbarNotifier.SetUserID(this.email);

            CheckError();
            if (this.error != null)
            {
                return(false);
            }

            GetAzureSignedUrls();
            if (this.error != null)
            {
                return(false);
            }

            RenameAssetForBuild();

            //フォルダのクリーンアップ
            Delete(Config.OutputPath + "STYLY_ASSET");

            CopyPackage();

            MakeThumbnail();

            foreach (RuntimePlatform platform in Config.PlatformList)
            {
                bool result = Build(platform);
                if (result == false)
                {
                    AssetDatabase.MoveAsset(renamedAssetPath, assetPath);
                    return(false);
                }
            }

            UploadAssets();
            if (this.error != null)
            {
                return(false);
            }

            PostUploadComplete();
            if (this.error != null)
            {
                return(false);
            }

            // Prefab名を戻す
            AssetDatabase.MoveAsset(this.renamedAssetPath, assetPath);
            AssetDatabase.Refresh();

            string assetType = this.asset.GetType().ToString();

            if ((!isAdministrator) && (assetType == "UnityEngine.GameObject"))
            {
                UnityEngine.Object.DestroyImmediate(this.asset, true);
            }

            if (isAdministrator)
            {
                Debug.Log("[Admin]STYLY_GUID: " + this.stylyGuid);
            }

            DeleteCamera();

            return(true);
        }