Beispiel #1
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 ();
                //}
            }
        }
Beispiel #2
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();
         }
     }
 }
Beispiel #3
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();
                }
            }
        }