Example #1
0
 public static int constructor(IntPtr l)
 {
     try {
         CUtils o;
         o=new CUtils();
         pushValue(l,true);
         pushValue(l,o);
         return 2;
     }
     catch(Exception e) {
         return error(l,e);
     }
 }
Example #2
0
 public static int constructor(IntPtr l)
 {
     try {
         CUtils o;
         o=new CUtils();
         pushValue(l,o);
         return 1;
     }
     catch(Exception e) {
         LuaDLL.luaL_error(l, e.ToString());
         return 0;
     }
 }
        public ActionResult Update(string usercode = "")
        {
            if (CUtils.IsNullOrEmpty(usercode))
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            var sysUser = Sys_UserManager.Get(new Sys_User()
            {
                UserCode = usercode
            });

            if (sysUser != null)
            {
                return(View(sysUser));
            }
            else
            {
                return(HttpNotFound());
            }
        }
Example #4
0
 public static void CopyFolder(string sourceFolder, string destFolder)
 {
     if (!Directory.Exists(destFolder))
     {
         Directory.CreateDirectory(destFolder);
     }
     foreach (string file in Directory.GetFiles(sourceFolder))
     {
         string fileName     = Path.GetFileName(file);
         string destFileName = Path.Combine(destFolder, fileName);
         int    num          = 1;
         System.IO.File.Copy(file, destFileName, num != 0);
     }
     foreach (string directory in Directory.GetDirectories(sourceFolder))
     {
         string fileName    = Path.GetFileName(directory);
         string destFolder1 = Path.Combine(destFolder, fileName);
         CUtils.CopyFolder(directory, destFolder1);
     }
 }
Example #5
0
        internal void AddReferCount()
        {
            if (string.IsNullOrEmpty(assetbundle))
            {
                assetbundle = CUtils.GetRightFileName(this.name.Replace("(Clone)", "") + Common.CHECK_ASSETBUNDLE_SUFFIX);
            }
            assetHashCode = LuaHelper.StringToHash(assetbundle);
            int addre = CountMananger.Add(this.assetHashCode);

            if (addre == -1)
            {
                Debug.LogWarningFormat("AddReferCount: name({0}) abName({1}) assetHashCode({2},count={3})refer add error ", GetPathName(this.transform), assetbundle, assetHashCode, addre);
            }
#if HUGULA_CACHE_DEBUG
            else
            {
                HugulaDebug.FilterLogFormat(assetbundle, "<color=green>AddReferCount: name({0}) abName({1}) assetHashCode({2}) referCount={3} </color> ", GetPathName(this.transform), assetbundle, assetHashCode, addre);
            }
#endif
        }
Example #6
0
 private void SendingPredictableEvents(PlayerState playerState)
 {
     if (playerState.entityEventSequence < playerState.eventSequence)
     {
         int seq      = playerState.entityEventSequence & (CConstVar.MAX_PS_EVENTS - 1);
         int evt      = playerState.events[seq] | ((playerState.entityEventSequence & 3) << 8);
         int extEvent = playerState.externalEvent;
         playerState.externalEvent = 0;
         GameEntity t   = TempEntity(playerState.origin, evt);
         int        idx = t.sEnt.s.entityIndex;
         CUtils.PlayerStateToEntityState(playerState, ref t.sEnt.s, true);
         t.sEnt.s.entityIndex      = idx;
         t.sEnt.s.entityType       = EntityType.EVENTS_COUNT + evt;
         t.sEnt.s.entityFlags     |= EntityType.PLAYER;
         t.sEnt.s.otherEntityIdx   = playerState.clientIndex;
         t.sEnt.r.svFlags         |= SVFlags.NOTSINGLE_CLIENT;
         playerState.externalEvent = extEvent;
         // int t =
     }
 }
Example #7
0
    // [MenuItem("Hugula/IOS Publish  ", false, 16)]
    static void BuildForIOS()
    {
        CUtils.DebugCastTime("Time BuildForIOS Begin");

        string path = "../Release/iOS";

        path = Path.GetFullPath(path);
        IOSSettings();
        EditorUtils.DirectoryDelete(path);
        EditorUtils.CheckDirectory(path);
        if (setting.ToLower().Contains("development"))
        {
            GenericBuild(GetBuildScenes(), path, BuildTarget.iOS, BuildOptions.Development);
        }
        else
        {
            GenericBuild(GetBuildScenes(), path, BuildTarget.iOS, BuildOptions.None);
        }
        CUtils.DebugCastTime("Time BuildForIOS End");
    }
        public void Add(Sys_User item)
        {
            var comm = this.GetCommand("Sp_Sys_User_Create");

            comm.AddParameter <string>(this.Factory, "userCode", (item != null && !CUtils.IsNullOrEmpty(item.UserCode)) ? CUtils.StrToUpper(item.UserCode) : null);
            comm.AddParameter <string>(this.Factory, "fullName", (item != null && !CUtils.IsNullOrEmpty(item.FullName)) ? CUtils.StrTrim(item.FullName) : null);
            comm.AddParameter <string>(this.Factory, "password", (item != null && !CUtils.IsNullOrEmpty(item.Password)) ? CUtils.StrTrim(item.Password) : null);
            comm.AddParameter <string>(this.Factory, "passwordSalt", (item != null && !CUtils.IsNullOrEmpty(item.PasswordSalt)) ? CUtils.StrTrim(item.PasswordSalt) : null);
            comm.AddParameter <string>(this.Factory, "phoneNo", (item != null && !CUtils.IsNullOrEmpty(item.PhoneNo)) ? CUtils.StrTrim(item.PhoneNo) : null);
            comm.AddParameter <string>(this.Factory, "email", (item != null && !CUtils.IsNullOrEmpty(item.Email)) ? CUtils.StrTrim(item.Email) : null);
            comm.AddParameter <string>(this.Factory, "sex", (item != null && !CUtils.IsNullOrEmpty(item.Sex)) ? CUtils.StrTrim(item.Sex) : null);
            comm.AddParameter <string>(this.Factory, "avatar", (item != null && !CUtils.IsNullOrEmpty(item.Avatar)) ? CUtils.StrTrim(item.Avatar) : null);
            //comm.AddParameter<DateTime>(this.Factory, "birthDay", (item != null && item.BirthDay != DateTime.MinValue && item.BirthDay.ToString(CultureInfo.InvariantCulture).Trim().Length > 0) ? item.BirthDay : DateTime.Now); //???
            comm.AddParameter <DateTime>(this.Factory, "birthDay", (item != null && CUtils.IsDateTime(item.BirthDay)) ? item.BirthDay : DateTime.MinValue);
            //comm.AddParameter<bool>(this.Factory, "flagActive", item != null && item.FlagActive); // đã mặc định trong StoredProcedure
            comm.AddParameter <bool>(this.Factory, "isSysAdmin", item != null && item.IsSysAdmin);
            comm.AddParameter <string>(this.Factory, "createBy", (item != null && !CUtils.IsNullOrEmpty(item.CreateBy)) ? CUtils.StrToUpper(item.CreateBy) : null);

            this.SafeExecuteNonQuery(comm);
        }
Example #9
0
        private static int GetAssetbundleSize(string abName)
        {
            FileInfo finfo  = new FileInfo(CUtils.PathCombine(CUtils.realStreamingAssetsPath, abName));
            int      abSize = 0;

            if (finfo.Exists)
            {
                abSize = (int)finfo.Length;
            }
            else
            {
                finfo = new FileInfo(EditorUtils.GetLuaBytesResourcesPath() + "/" + abName);
                if (finfo.Exists)
                {
                    abSize = (int)finfo.Length;
                }
            }

            return(abSize);
        }
Example #10
0
        public ActionResult Update(int ManufacterId)
        {
            if (CUtils.IsNullOrEmpty(ManufacterId))
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            var manu = ManufactersManager.Get(new Manufacters()
            {
                ManufactId = ManufacterId
            });

            if (manu != null)
            {
                return(View(manu));
            }
            else
            {
                return(HttpNotFound());
            }
        }
        public ActionResult Update(int locationdiscountid)
        {
            if (CUtils.IsNullOrEmpty(locationdiscountid))
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            var locate = LocationDiscountManager.Get(new LocationDiscount()
            {
                LocationDiscountId = locationdiscountid
            });

            if (locate != null)
            {
                return(View(locate));
            }
            else
            {
                return(HttpNotFound());
            }
        }
Example #12
0
        /// <summary>
        /// Builds the asset bundles update A.
        /// </summary>
        public static void buildAssetBundlesUpdateAB()
        {
            EditorUtility.DisplayProgressBar("Generate FileList", "loading bundle manifest", 1 / 2);
            AssetDatabase.Refresh();
            string readPath = BuildScript.GetFileStreamingOutAssetsPath();//+"\\";
            var    u3dList  = getAllChildFiles(readPath, @"\.meta$|\.manifest$|\.DS_Store$", null, false);

            Debug.Log("all ab count = " + u3dList.Count);
            List <string> assets = new List <string>();

            foreach (var s in u3dList)
            {
                string ab = CUtils.GetAssetBundleName(s); //s.Replace(readPath, "").Replace("/", "").Replace("\\", "");
                //            Debug.Log(ab);
                assets.Add(ab);
            }

            EditorUtility.ClearProgressBar();
            BuildScript.GenerateAssetBundlesUpdateFile(assets.ToArray());
        }
Example #13
0
 private IVimService _LoginVimService(string server, string user, string pass, int port)
 {
     this._Logger.Information("Logging on to ESX server: : " + server);
     Trace.Assert(!string.IsNullOrEmpty(server), "Server cannot be null or empty");
     Trace.Assert(!string.IsNullOrEmpty(user), "User cannot be null or empty");
     lock (this)
     {
         try
         {
             IVimService vs = VimServiceFactory.CreateVimService(this._Logger, server, user, pass, 5, port);
             CUtils.RetryIf(5, 5000, (CUtils.Workload)(() => vs.Logon()), (Func <Exception, bool>)(ex => ex is WebException));
             return(vs);
         }
         catch (Exception exception_0)
         {
             this._Logger.Error(exception_0, "Failed to log on to the ESX server due to the exception:  ");
             throw new TerodoViewServiceServiceException(0, "Failed to log on to the ESX server due to the exception:  " + exception_0.Message, exception_0);
         }
     }
 }
Example #14
0
 private void OnItemPurchased(IAPItem item, int index)
 {
     // A consumable product has been purchased by this user.
     if (item.productType == ProductType.Consumable)
     {
         CurrencyController.CreditBalance(item.value);
         Toast.instance.ShowMessage("Your purchase is successful");
         CUtils.SetBuyItem();
     }
     // Or ... a non-consumable product has been purchased by this user.
     else if (item.productType == ProductType.NonConsumable)
     {
         // TODO: The non-consumable item has been successfully purchased, grant this item to the player.
     }
     // Or ... a subscription product has been purchased by this user.
     else if (item.productType == ProductType.Subscription)
     {
         // TODO: The subscription item has been successfully purchased, grant this to the player.
     }
 }
Example #15
0
    private void Test_2()
    {
        for (int world = 0; world < 6; world++)
        {
            for (int sub = 0; sub < 5; sub++)
            {
                int num = dotMob.Utils.GetNumLevels(world, sub);
                for (int level = 0; level < num; level++)
                {
                    var gameLevel = Resources.Load <GameLevel>("World_" + world + "/SubWorld_" + sub + "/Level_" + level);

                    var answers = CUtils.BuildListFromString <string>(gameLevel.answers);
                    if (gameLevel.word.Contains("a") && gameLevel.word.Contains("m") && answers[0].Length == 2)
                    {
                        print(world + "|" + sub + "|" + level);
                    }
                }
            }
        }
    }
Example #16
0
    // [MenuItem("Hugula/Android iL2CPP publish ", false, 16)]
    static void BuildForAndroidIL2CPP()
    {
        string path = "hugula.apk";

        path = Path.GetFullPath(path);
        exportingAndroidProject = false;
        //copy android plugins
        AndroidSettings();
        PlayerSettings.SetPropertyInt("ScriptingBackend", (int)ScriptingImplementation.IL2CPP, BuildTargetGroup.Android);
        if (setting.ToLower().Contains("development"))
        {
            GenericBuild(GetBuildScenes(), path, BuildTarget.Android, BuildOptions.Development);
        }
        else
        {
            GenericBuild(GetBuildScenes(), path, BuildTarget.Android, BuildOptions.None);
        }
        PlayerSettings.SetPropertyInt("ScriptingBackend", (int)ScriptingImplementation.Mono2x, BuildTargetGroup.Android);
        CUtils.DebugCastTime("Time BuildForAndroid iL2CPP End");
    }
Example #17
0
    // [MenuItem("Hugula/Android Project publish ", false, 16)]
    static void BuildForAndroidProject()
    {
        string path = "../../release/android";

        path = Path.GetFullPath(path);
        exportingAndroidProject = true;
        AndroidSettings("mono");
        EditorUtils.DirectoryDelete(path);
        EditorUtils.CheckDirectory(path);
        if (setting.ToLower().Contains("development"))
        {
            GenericBuild(GetBuildScenes(), path, BuildTarget.Android, BuildOptions.Development | BuildOptions.AcceptExternalModificationsToPlayer);
        }
        else
        {
            GenericBuild(GetBuildScenes(), path, BuildTarget.Android, BuildOptions.AcceptExternalModificationsToPlayer);
        }

        CUtils.DebugCastTime("Time BuildForAndroidProject End");
    }
Example #18
0
 void GotoNext()
 {
     if (Prefs.ScratchCardTaskFinish == 0)
     {
         CardManager.Instance.CheckTask(6);
     }
     if (GameState.unlockNewLevel)
     {
         //删除数据
         CPlayerPrefs.DeleteKey("level_progress" + (GameState.currentLevel - 1).ToString());
         CUtils.LoadScene(Const.SCENE_MAP, true);
     }
     else
     {
         //删除数据
         CPlayerPrefs.DeleteKey("level_progress" + GameState.currentLevel);
         GameState.currentLevel = GameState.currentLevel + 1;
         CUtils.LoadScene(Const.SCENE_MAINGAME, true);
     }
 }
        public ActionResult Update(int SlideId)
        {
            if (CUtils.IsNullOrEmpty(SlideId))
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            var slide = SlideManager.Get(new Slide()
            {
                SlideBannerId = SlideId
            });

            if (slide != null)
            {
                return(View(slide));
            }
            else
            {
                return(HttpNotFound());
            }
        }
        void ControllerConfig_OnChangeOnlineBots(int iOnlineBots)
        {
            m_frmMain.Invoke((MethodInvoker) delegate()
            {
                CUtils.ReplaceRowCellValue(m_frmMain.gvStatistics, "Online Bots", "Value", iOnlineBots.ToString());

                m_frmMain.ccBotsonline.Series.Clear();

                Series series1 = new Series("Bots statistics", ViewType.Doughnut3D);
                series1.Points.Add(new SeriesPoint("Total Bots", Program.ControllerConfig.TotalBots));
                series1.Points.Add(new SeriesPoint("Online Bots", iOnlineBots));
                series1.Label.PointOptions.PointView = PointView.ArgumentAndValues;
                ((PiePointOptions)series1.Label.PointOptions).PercentOptions.ValueAsPercent = false;
                series1.Label.PointOptions.ValueNumericOptions.Format    = NumericFormat.Number;
                series1.Label.PointOptions.ValueNumericOptions.Precision = 0;
                series1.ShowInLegend = false;
                m_frmMain.ccBotsonline.Series.Add(series1);
                //m_frmMain.tpBotlist.Text = CUtils.SetOnlineBots(m_frmMain.tpBotlist.Text, iOnlineBots);
            });
        }
Example #21
0
        public static void doExportLua(string rootPath)
        {
            EditorUtils.CheckstreamingAssetsPath();
            string OutLuaBytesPath = EditorUtils.GetLuaBytesResourcesPath();

            AssetDatabase.DeleteAsset(OutLuaBytesPath);
            EditorUtils.GetLuaBytesResourcesPath();

            System.Text.StringBuilder sb = new System.Text.StringBuilder();

            var files = Directory.GetFiles(rootPath, "*.lua", SearchOption.AllDirectories);
            var dests = new string[files.Length];

            // var dests64 = new string[files.Length];

            for (int i = 0; i < files.Length; i++)
            {
                string xfile = files[i].Remove(0, rootPath.Length + 1);
                xfile = xfile.Replace("\\", "+").Replace("/", "+");
                string file     = files[i].Replace("\\", "/");
                string dest     = OutLuaBytesPath + "/" + CUtils.GetRightFileName(xfile);
                string destName = dest.Substring(0, dest.Length - 3) + "bytes";

                System.IO.File.Copy(file, destName, true);

                sb.AppendFormat("\r\n {0}   ({1}) ", file, destName);
            }

            string tmpPath = EditorUtils.GetAssetTmpPath();

            EditorUtils.CheckDirectory(tmpPath);
            string outPath = Path.Combine(tmpPath, "lua_export_log.txt");

            Debug.Log("write to path=" + outPath);
            using (StreamWriter sr = new StreamWriter(outPath, false))
            {
                sr.Write(sb.ToString());
            }

            EditorUtility.ClearProgressBar();
        }
Example #22
0
        private static void CopyFileToSplitFolder(Dictionary <string, uint[]> updateList)
        {
            string updateOutPath = Path.Combine(UpdateOutPath, ResFolderName);

            ExportResources.CheckDirectory(updateOutPath);

            int allLen = updateList.Count;
            int i      = 0;

            EditorUtility.DisplayProgressBar("Copy Change AssetBundle File", "copy file to " + updateOutPath, 0.09f);

            string sourcePath;
            string outfilePath;
            string key;
            uint   crc = 0;

            foreach (var k in updateList)
            {
                key        = k.Key;//CUtils.GetAssetBundleName(k.Key);
                sourcePath = Path.Combine(CUtils.GetRealStreamingAssetsPath(), k.Key);
                crc        = k.Value[0];
                if (crc != 0)
                {
                    if (key.Equals(CUtils.platformFloder))
                    {
                        key = key + "_" + crc.ToString() + "." + Common.ASSETBUNDLE_SUFFIX;
                    }
                    else
                    {
                        key = CUtils.InsertAssetBundleName(key, "_" + crc.ToString());//
                    }
                }
                outfilePath = Path.Combine(updateOutPath, key);
                FileHelper.CheckCreateFilePathDirectory(outfilePath);
                File.Copy(sourcePath, outfilePath, true);// source code copy
                EditorUtility.DisplayProgressBar("copy file to split folder " + updateOutPath, " copy file  =>" + i.ToString() + "/" + allLen.ToString(), i / allLen);
                i++;
            }
            Debug.Log(" copy  file complete!");
            EditorUtility.ClearProgressBar();
        }
Example #23
0
 public ActionResult JsonViewError(string viewname, object model, JsonResultEntry resultEntry)
 {
     if (CUtils.IsNullOrEmpty(viewname))
         viewname = (string)ControllerContext.RouteData.Values["action"];
     string html = "";
     try
     {
         html = RenderRazorViewToString(viewname, model);
         if (resultEntry.Success)
         {
             var data = new
             {
                 Success = true,
                 Html = html,
                 Title = resultEntry.Messages
             };
             return Json(data, JsonRequestBehavior.AllowGet);
         }
         else
         {
             var data = new
             {
                 Success = false,
                 Html = html,
                 Title = resultEntry.Messages,
                 Detail = resultEntry.Detail,
             };
             return Json(data, JsonRequestBehavior.AllowGet);
         }
     }
     catch (Exception e)
     {
         var data = new
         {
             Success = false,
             Message = e.Message,
             Detail = resultEntry.Detail
         };
         return Json(data, JsonRequestBehavior.AllowGet);
     }
 }
Example #24
0
        private void on_do_1s(ZoneLayer layer)
        {
            layer.AddTimeDelayMS(bot.Random.Next(1000, 10000), (t) =>
            {
                if (Enable)
                {
                    client.GameSocket.playerHandler.battleEventNotify(null);
                    client.GameSocket.rankHandler.getRankInfoRequest((err, rsp) => { });
                }
            });

            {
                var req_type = CUtils.GetRandomInArray <Type>(all_request, bot.Random);
                var req      = ReflectionUtil.CreateInstance(req_type);
                fill_random(req);
                log.Info("request : " + req_type);
                bot.Client.GameSocket.request(req, (err, rsp) =>
                {
                    log.Info("response : rsp=" + rsp + " : err=" + err);
                });
            }
            {
                var ntf_type = CUtils.GetRandomInArray <Type>(all_notify, bot.Random);
                var ntf      = ReflectionUtil.CreateInstance(ntf_type);
                fill_random(ntf);
                log.Info("notify : " + ntf_type);
                bot.Client.GameSocket.notify(ntf);
            }
            {
                var battleMessage = random_bytes();
                client.GameSocket.playerHandler.battleEventNotify(battleMessage);
            }
            {
                var req_type = CUtils.GetRandomInArray <Type>(all_request, bot.Random);
                socket_start_send(EventTypes.GetRequestKey(req_type), (uint)bot.Random.Next());
            }
            {
                var ntf_type = CUtils.GetRandomInArray <Type>(all_notify, bot.Random);
                socket_start_send(EventTypes.GetNotifyKey(ntf_type));
            }
        }
        public ActionResult Create(Sys_User model)
        {
            var resultEntry = new JsonResultEntry()
            {
                Success = false
            };

            var createBy = "";

            model.UserName = CUtils.StrValue(model.UserCode);
            if (UserState != null && !CUtils.IsNullOrEmpty(UserState.UserName))
            {
                createBy = CUtils.StrTrim(UserState.UserName);
            }
            model.CreateBy = createBy;
            Sys_UserManager.Add(model);
            resultEntry.Success = true;
            resultEntry.AddMessage("Tạo mới người dùng thành công!");

            return(Json(resultEntry));
        }
    public static void exportLanguage()
    {
        string        assetPath = "Assets/Lan/";
        string        path      = Application.dataPath + "/Lan/"; //AssetDatabase.GetAssetPath(obj).Replace("Assets","");
        List <string> files     = getAllChildFiles(path, "csv");

        string outPath = ExportAssetBundles.GetOutPath();

        CheckDirectory(Application.dataPath.Replace("Assets", "") + outPath);
        CheckDirectory(Application.dataPath.Replace("Assets", "") + outPath + "/Lan");

        foreach (string name in files)
        {
            string abPath = assetPath + name.Replace(path, "");
//            Debug.Log(abPath);
            string tarPath = outPath + "/Lan";
            string abName  = CUtils.GetURLFileName(name) + "." + Common.LANGUAGE_SUFFIX;
            ExportAssetBundles.BuildABs(new string[] { abPath }, tarPath, abName, BuildAssetBundleOptions.CompleteAssets);
            Debug.Log(tarPath + abName + " export");
        }
    }
Example #27
0
    // [MenuItem("Hugula/Android IL2CPP Project publish ", false, 16)]
    static void BuildForAndroidProjectIL2CPP()
    {
        string path = "../../release/android_il2cpp";

        path = Path.GetFullPath(path);
        exportingAndroidProject = true;
        AndroidSettings();
        ExportResources.DirectoryDelete(path);
        ExportResources.CheckDirectory(path);
        PlayerSettings.SetPropertyInt("ScriptingBackend", (int)ScriptingImplementation.IL2CPP, BuildTargetGroup.Android);
        if (setting.ToLower().Contains("development"))
        {
            GenericBuild(GetBuildScenes(), path, BuildTarget.Android, BuildOptions.Development | BuildOptions.AcceptExternalModificationsToPlayer);
        }
        else
        {
            GenericBuild(GetBuildScenes(), path, BuildTarget.Android, BuildOptions.AcceptExternalModificationsToPlayer);
        }
        PlayerSettings.SetPropertyInt("ScriptingBackend", (int)ScriptingImplementation.Mono2x, BuildTargetGroup.Android);
        CUtils.DebugCastTime("Time BuildForAndroidProjectIL2CPP End");
    }
Example #28
0
    public void OnClick(int index)
    {
        switch (index)
        {
        case PLAY:
            CUtils.LoadScene(1);
            break;

        case FACEBOOK:
            if (FB.IsLoggedIn || !ConfigController.Config.enableFacebookFeatures)
            {
                CUtils.LikeFacebookPage(ConfigController.Config.facebookPageID);
            }
            else
            {
                FacebookController.instance.LoginFacebook();
            }
            break;
        }
        Sound.instance.PlayButton();
    }
        public ActionResult Update(int locationId)
        {
            if (CUtils.IsNullOrEmpty(locationId))
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            var newsCate = LocationManager.Get(new Location()
            {
                LocationId = locationId
            });

            if (newsCate != null)
            {
                ViewBag.IsEdit = true;
                return(View(newsCate));
            }
            else
            {
                return(HttpNotFound());
            }
        }
Example #30
0
    public static void LoadManifest(string sceneAbName, string scenename)
    {
        sceneAssetBundleName = sceneAbName;
        sceneName            = scenename;
        var url = CUtils.GetPlatformFolderForAssetBundles();
        var req = LRequest.Get();

        req.relativeUrl = CUtils.GetRightFileName(url);
        req.assetType   = typeof(AssetBundleManifest);
        req.assetName   = "assetbundlemanifest";
        req.OnComplete  = (CRequest req1) =>
        {
            LResLoader.assetBundleManifest = req1.data as AssetBundleManifest;
            BeginLoadScene();
        };
        req.OnEnd         = (CRequest req1) => { BeginLoadScene(); };
        req.async         = true;
        req.isAssetBundle = true;
        LResLoader.instance.OnSharedComplete += OnSharedComplete;
        LResLoader.instance.LoadReq(req);
    }
Example #31
0
        private static IEnumerator LoadMessageBox(MessageBoxInfo m_messageBoxInfo)
        {
#if MESSAGEBOX_DEBUG
            Debug.LogFormat("LoadMessageBox .LoadAssetCoroutine {0} ,frame={1}  ", m_messageBoxInfo, Time.frameCount);
#endif
            var req = ResourcesLoader.LoadAssetCoroutine(CUtils.GetRightFileName(MESSAGEBOX_ABNAME), CUtils.GetAssetName(MESSAGEBOX_ABNAME), typeof(GameObject), int.MaxValue);
            yield return(req);

#if MESSAGEBOX_DEBUG
            Debug.LogFormat("LoadMessageBox LoadAssetCoroutine is done {0},frame={1}  ", req, Time.frameCount);
#endif
            var obj = (GameObject)req.data;
#if MESSAGEBOX_DEBUG
            Debug.LogFormat("LoadMessageBox obj req.GetAsset<GameObject> {0} ,frame={1}  ", obj, Time.frameCount);
#endif
            var ins = GameObject.Instantiate(obj);
            m_messageBox = ins.GetComponent <MessageBox> ();
            m_isloading  = false;
            DontDestroyOnLoad(ins);
            m_messageBox.ShowContent(m_messageBoxInfo.text, m_messageBoxInfo.caption, m_messageBoxInfo.btns);
        }
Example #32
0
        public static void exportLanguage()
        {
            var files = AssetDatabase.GetAllAssetPaths().Where(p =>
                                                               p.StartsWith("Assets/Config/Lan") &&
                                                               p.EndsWith(".csv")
                                                               ).ToArray();

            BuildScript.CheckstreamingAssetsPath();
            // BuildScript.ch
            foreach (string abPath in files)
            {
                string            name   = CUtils.GetAssetName(abPath);
                string            abName = CUtils.GetRightFileName(name + Common.CHECK_ASSETBUNDLE_SUFFIX);
                Hugula.BytesAsset bytes  = (Hugula.BytesAsset)ScriptableObject.CreateInstance(typeof(Hugula.BytesAsset));
                bytes.bytes = File.ReadAllBytes(abPath);
                string bytesPath = string.Format("Assets/Tmp/{0}.asset", name);
                AssetDatabase.CreateAsset(bytes, bytesPath);
                BuildScript.BuildABs(new string[] { bytesPath }, null, abName, SplitPackage.DefaultBuildAssetBundleOptions);
                Debug.Log(name + " " + abName + " export");
            }
        }
Example #33
0
    static int _CreateCUtils(IntPtr L)
    {
        int count = LuaDLL.lua_gettop(L);

        if (count == 0)
        {
            CUtils obj = new CUtils();
            LuaScriptMgr.PushObject(L, obj);
            return 1;
        }
        else
        {
            LuaDLL.luaL_error(L, "invalid arguments to method: CUtils.New");
        }

        return 0;
    }