public static T CreateMelon <T>(this WrapperData creationData) where T : MelonBase
        {
            MelonBase baseMelon = CreateMelon(creationData);

            if (baseMelon == null)
            {
                return(default);
예제 #2
0
    private void LoadData()
    {
#if DOT_NET
        string prefix   = string.IsNullOrEmpty(WrapperName) ? "" : WrapperName + ".";
        string fileName = prefix + WrapperData.FileName;

        IsolatedStorageFile isoStore = IsolatedStorageFile.GetStore(IsolatedStorageScope.User | IsolatedStorageScope.Assembly, null, null);

        if (isoStore.FileExists(fileName))
        {
            string file;

            using (IsolatedStorageFileStream isoStream = new IsolatedStorageFileStream(fileName, FileMode.Open, isoStore))
            {
                using (StreamReader reader = new StreamReader(isoStream))
                {
                    file = reader.ReadToEnd();
                }
            }

            //parse
            _wrapperData = JsonReader.Deserialize <WrapperData>(file);
        }
#else
        string prefix = string.IsNullOrEmpty(WrapperName) ? "" : WrapperName + ".";
        _wrapperData.ProfileId          = PlayerPrefs.GetString(prefix + PREFS_PROFILE_ID);
        _wrapperData.AnonymousId        = PlayerPrefs.GetString(prefix + PREFS_ANONYMOUS_ID);
        _wrapperData.AuthenticationType = PlayerPrefs.GetString(prefix + PREFS_AUTHENTICATION_TYPE);
#endif
    }
예제 #3
0
            private static Vector2 RedimGif(WrapperData data, float maxWidth)
            {
                if (data.IsNull())
                {
                    throw new ArgumentNullException(nameof(data));
                }

                return(new Vector2(maxWidth, data.height * (maxWidth / data.width)));
            }
예제 #4
0
        private static IEnumerator LoadGifFromFile(string path, MonoBehaviour mono, WrapperData wrapperData = null)
        {
            byte[] bytes = null;

            yield return(Ninja.JumpBack);

            bytes = File.ReadAllBytes(path);
            yield return(Ninja.JumpToUnity);

            yield return(InternalCallback(bytes, wrapperData, path, mono));
        }
예제 #5
0
            private void _Draw(Rect r, WrapperData data)
            {
                if (!IsReady)
                {
                    return;
                }

                if (data?.list != null && data.list.Count > 0)
                {
                    GUI.DrawTexture(r, data.NextFrame());
                }
            }
예제 #6
0
        private void btnOk_Click(object sender, EventArgs e)
        {
            Dictionary <string, string> dict = new Dictionary <string, string>();

            dict["MsCode"]            = edtMS_CODE.Text;
            dict["Model"]             = edtMODEL.Text;
            dict["ProdNo"]            = edtPROD_NO.Text;
            dict["ProdNoSfix"]        = edtPROD_NO_SFX.Text;
            dict["LineNoSfix"]        = edtLN_NO.Text;
            dict["CrpGrNo"]           = edtCRP_GR_NO.Text;
            dict["ProdCareer"]        = edtPROD_CAREER.Text;
            dict["IndexNo"]           = edtINDEX_NO.Text;
            dict["TestCertSighn"]     = edtTEST_CERT_SIGN.Text;
            dict["DocLangType"]       = edtDOC_LANG_TYPE.Text;
            dict["InstFinishD"]       = edtINST_FINISH_D.Text;
            dict["TestCertYn"]        = edtTEST_CERT_YN.Text;
            dict["EndUserCust"]       = edtEND_USER_CUST_N_J.Text;
            dict["OrderNo"]           = edtORDER_NO.Text;
            dict["ItemNo"]            = edtITEM_NO.Text;
            dict["ProdItemRevNo"]     = edtPROD_ITEM_REV_NO.Text;
            dict["ProdInstRevNo"]     = edtPROD_INST_REV_NO.Text;
            dict["CompNo"]            = edtCOMP_NO.Text;
            dict["StartSch"]          = edtSTART_SCHDULE_D.Text;
            dict["FinishSch"]         = edtFINISH_SCHDULE_D.Text;
            dict["StartNo"]           = edtSTART_NO.Text;
            dict["SerialNo"]          = edtSERIAL_NO.Text;
            dict["AllowanceSign"]     = edtALLOWANCE_SIGN.Text;
            dict["ProdNJ"]            = edtPROD_N_J.Text;
            dict["ProdNE"]            = edtPROD_N_E.Text;
            dict["TokuchuSpec"]       = edtTOKUCHU_SPEC_SIGN.Text;
            dict["SapLinkNo"]         = edtSAP_LINKAGE_NO.Text;
            dict["RangeInstSign500"]  = edtRANGE_INST_SIGN_500.Text;
            dict["OrdInstMax500"]     = edtORD_INST_MAX_500.Text;
            dict["OrdInstMin500"]     = edtORD_INST_MIN_500.Text;
            dict["Unit500"]           = edtUNIT_500.Text;
            dict["Features500"]       = edtFEATURES_500.Text;
            dict["RangeInstSign502"]  = edtRANGE_INST_SIGN_502.Text;
            dict["OrdInstMax502"]     = edtRANGE_INST_SIGN_502.Text;
            dict["OrdInstMin502"]     = edtORD_INST_MIN_502.Text;
            dict["Unit502"]           = edtUNIT_502.Text;
            dict["OrdInstContectW69"] = edtORD_INST_CONT_W69.Text;
            dict["OrdInstContectX72"] = edtORD_INST_CONTECT1_X72.Text;
            dict["OrdInstContectX91"] = edtORD_INST_CONTECT1_X91.Text;
            dict["OrdInstContectZ30"] = edtORD_INST_CONTECT1_Z30.Text;
            dict["TagNo525"]          = edtTAG_NO_525.Text;
            dict["NifudaCode"]        = editNIFUDA.Text;

            WrapData     = new WrapperData(dict);
            DialogResult = DialogResult.OK;
            Close();
        }
예제 #7
0
        private static bool Draw(Rect r, WrapperData data)
        {
            if (data == null)
            {
                // Debug.LogError("Gif data is null!");
                return(false);
            }

            if (data?.list != null && data.list.Count > 0)
            {
                GUI.DrawTexture(r, data.NextFrame());
            }

            return(true);
        }
예제 #8
0
                void ContextCallback(object obj)
                {
                    Type    type = obj as Type;
                    Vector2 pos  = mousePos + scrollPos;


                    NodeEditor node = typeof(DecoratorEditor).IsAssignableFrom(type) ||
                                      typeof(CompositeEditor).IsAssignableFrom(type)
                        ? (NodeEditor)Activator.CreateInstance(type, new object[] { PrettyTitle(type.ToString()), pos })
                        : WrapperData.CreateLeafNode(PrettyTitle(type.ToString()), pos, type);

                    if (node != null)
                    {
                        nodes.Add(node);
                    }
                }
예제 #9
0
        private static IEnumerator LoadGifFromUrl(string path, MonoBehaviour mono, WrapperData wrapperData = null)
        {
            using (var request = UnityWebRequest.Get(path))
            {
                yield return(request.SendWebRequest());

                if (request.isNetworkError || request.isHttpError)
                {
                    Debug.LogError("File load error.\n" + request.error);
                }
                else
                {
                    gifTexDict.Clear();

                    var textureData = ((DownloadHandlerTexture)request.downloadHandler).data;
                    yield return(InternalCallback(textureData, wrapperData, path, mono));
                }
            }
        }
예제 #10
0
        private static IEnumerator InternalCallback(byte[] bytes, WrapperData wrapperData, string path,
                                                    MonoBehaviour mono)
        {
            if (wrapperData == null)
            {
                var name = Path.GetFileNameWithoutExtension(path);
                wrapperData = new WrapperData {
                    name = name
                };
            }

            yield return(GetTextureListCoroutine(bytes, (gtList, loop, w, h) =>
            {
                wrapperData.list = gtList;
                wrapperData.width = w;
                wrapperData.height = h;

                gifTexDict.Add(path, wrapperData);
            },
                                                 mono, null, wrapperData.filterMode, wrapperData.wrapMode, wrapperData.outputDebugLog));
        }
예제 #11
0
            private IEnumerator MainRoutine(string name, byte[] bytes, object thisReference,
                                            Action <WrapperData> callback)
            {
                if (callback == null)
                {
                    throw new ArgumentNullException(nameof(callback));
                }

                var wrapperData = new WrapperData {
                    name = name
                };

                yield return(GetTextureListCoroutine(bytes, (gtList, loop, w, h) =>
                {
                    // ThreadedDebug.Log($"Is null?: {gtList.IsNullOrEmpty()}");

                    wrapperData.list = gtList;
                    wrapperData.width = w;
                    wrapperData.height = h;
                }, thisReference, mono, wrapperData.filterMode, wrapperData.wrapMode, wrapperData.outputDebugLog)
                             .CreateSmartCorotine(thisReference, mono));

                callback(wrapperData);
            }
예제 #12
0
                public static List <NodeEditor> GetNodes(string json)
                {
                    var data = JsonUtility.FromJson <PackedNodeData>(json);

                    return(WrapperData.UnpackData(data));
                }
예제 #13
0
 public static string GetJsonData(List <NodeEditor> nodes)
 {
     return(JsonUtility.ToJson(WrapperData.PackData(nodes)));
 }
예제 #14
0
 private static IEnumerator LoadGifFromResources(string path, byte[] bytes, MonoBehaviour mono,
                                                 WrapperData wrapperData = null)
 {
     yield return(InternalCallback(bytes, wrapperData, path, mono));
 }