public KIniFile(string url, LoadDataCompleteDelegate OnDataComplete, LoadDataCompleteDelegate OnDataComplete2) { this.m_url = URLUtil.GetIniFilePath(url); this.OnDataComplete = OnDataComplete; this.OnDataComplete2 = OnDataComplete2; AssetLoader.GetInstance().Load(m_url, LoadComplete, AssetType.BINARY); }
private void UpdateMissionSign(MissionInfo.MisssionStatus status) { if (missionStatus == status) { return; } missionStatus = status; if (Owner.BodyGo == null) { return; } RemoveSign(); switch (missionStatus) { case MissionInfo.MisssionStatus.Accept: AssetLoader.GetInstance().Load(URLUtil.GetEffectPath("effect_tanhao"), Sign_LoadComplete, AssetType.BUNDLER); break; case MissionInfo.MisssionStatus.BeenAccepted: AssetLoader.GetInstance().Load(URLUtil.GetEffectPath("effect_wenhao_hui"), Sign_LoadComplete, AssetType.BUNDLER); break; case MissionInfo.MisssionStatus.Finish: AssetLoader.GetInstance().Load(URLUtil.GetEffectPath("effect_wenhao"), Sign_LoadComplete, AssetType.BUNDLER); break; default: break; } }
/// <summary> /// 激活行为. /// </summary> public override void Active() { base.Active(); AssetInfo infor = AssetLoader.GetInstance().PreLoad(URLUtil.GetEffectPath("effect_guaiwusiwang2")); if (infor.isDone() && null != infor.bundle) { GameObject fx = GameObject.Instantiate(infor.bundle.mainAsset) as GameObject; fx.transform.position = hero.transform.position; fx.transform.rotation = hero.transform.rotation; float _scale = hero.heroSetting.Scale; /*float _scale = hero.property.characterController.radius * hero.transform.localScale.y/ 0.6f;*/ fx.transform.localScale = new Vector3(_scale, _scale, _scale); ParticleSystemScaleManager.instance.Scale(_scale, fx); if (null != hero.BodyGo) { hero.BodyGo.SetActive(false); } } else { ActionDie die = new ActionDie(hero); hero.ActiveAction = die; return; } hero.DispatchEvent(ControllerCommand.CLEAR_BUFF); }
public UIAtlas GetUIAtlas(string resourceName) { UIAtlas atlas = null; mDictionary.TryGetValue(URLUtil.GetResourceLibPath() + "Atlas/" + resourceName + ".res", out atlas); return(atlas); }
public void PlaySound3d(string res_path, Vector3 pos) { AudioClip clip = null; if (audios.TryGetValue(res_path, out clip)) { if (clip != null) { GameObject g = new GameObject("audio_" + res_path); //g.transform.position = pos; g.transform.position = Camera.main.transform.position; AudioSource _as = g.AddComponent <AudioSource>(); _as.volume = volume; _as.clip = clip; _as.Play(); DestoryObject dot = g.AddComponent <DestoryObject>(); dot.delta = 5f; } } else { AssetInfo infor = AssetLoader.GetInstance().Load( URLUtil.GetResourceLibPath() + "Audio/" + res_path, LoadAudioClipComplete, AssetType.BUNDLER, false, AssetLoaderLevel.IMMEDIATELY ); urls[infor] = res_path; } }
void SwitchWeapon(uint id) { if (id == 0) { id = Owner.heroSetting.DefaultWeapon; } if (equipInfor != null && equipInfor.ID == id) { return; } equipInfor = ItemLocator.GetInstance().GetEquip((int)id); if (equipInfor == null) { Debug.LogError("武器 " + id + "不存在"); return; } if (equipInfor.FBX.Length == 0) { Debug.LogError("武器 " + id + "没填写FBX数据"); return; } GameObject.Destroy(Owner.property.weapon[0]); GameObject.Destroy(Owner.property.weapon[1]); Owner.property.weapon[0] = null; Owner.property.weapon[1] = null; assetInfo = AssetLoader.GetInstance().Load(URLUtil.GetResourceLibPath() + equipInfor.FBX); if (equipInfor.Fx.Length > 0) { fxInfo = AssetLoader.GetInstance().Load(URLUtil.GetResourceLibPath() + equipInfor.Fx); } }
/// <summary> /// 激活行为. /// </summary> public override void Active() { //FxAsset assert = new FxAsset(); //assert.init(URLUtil.GetResourceLibPath() + buffInfor.BuffPath); base.Active(); KParams kParams = KConfigFileManager.GetInstance().GetParams(); outColor = KingSoftCommonFunction.StringToColor(kParams.MonsterOutColor); totalTime = kParams.MonsterOutTime; MonsterOutHeight = kParams.MonsterOutHeight; if (kParams.MonsterOutFx.Length > 0) { assert.init(URLUtil.GetResourceLibPath() + kParams.MonsterOutFx); GameObject fx = assert.CloneObj(); if (null != fx) { fx.transform.position = hero.Position; fx.transform.localScale = hero.transform.localScale * kParams.MonsterOutFxScale; DestoryObject d = fx.AddComponent <DestoryObject>(); d.delta = 1f; } } hero.DispatchEvent(ControllerCommand.CrossFadeAnimation, "idle1", AMIN_MODEL.ONCE, false); isFinish = false; hero.DispatchEvent(ControllerCommand.CLEAR_BUFF); beginTime = Time.realtimeSinceStartup; }
public static void Shake(string name, float _time, float scale, float speed) { AssetInfo infor = null; if (!assetList.TryGetValue(name, out infor)) { //"effect_zhenping_zuoyou" //"effect_zhenping_shangxia" //"effect_zhenping_yuanquan" assetList[name] = AssetLoader.GetInstance().PreLoad(URLUtil.GetEffectPath(name)); return; } if (infor.isDone()) { GameObject g = GameObject.Instantiate(infor.bundle.mainAsset) as GameObject; Animation anim = g.GetComponent <Animation>(); if (null == anim || anim.clip == null) { GameObject.Destroy(g); return; } anim[anim.clip.name].normalizedSpeed = speed; g.transform.localScale = new Vector3(scale, scale, scale); GameObject c = new GameObject("aim"); c.transform.parent = g.transform; DestoryObject dos = g.AddComponent <DestoryObject>(); dos.delta = _time; shakeObjects.Add(c); } }
public bool OnMenuItemClick(IMenuItem item) { if (string.IsNullOrEmpty(_itemExtra)) { return(false); } var fileName = _itemExtra.StartsWith("data:image") ? $"image.{DataImage.GetImageExtension(_itemExtra)}" : URLUtil.GuessFileName(_itemExtra, null, null); if (FileHelper.MediaExists(fileName)) { UserDialogs.Instance.ActionSheet(new ActionSheetConfig() .SetTitle("An image with the same name already exists") .SetMessage($"Do you want replace the existing {fileName} in download") .Add( "Replace file", () => new ImageDownloader().Execute(_itemExtra, fileName)) .Add( "Create new file", () => new ImageDownloader().Execute(_itemExtra, FileHelper.GenerateNewFileName(fileName))) .SetCancel() .SetUseBottomSheet(true)); } else { new ImageDownloader().Execute(_itemExtra, fileName); } return(true); }
private string GetURL(RestaurantsLocalFavoritesOptions options) { string url; if (this.environment == Environments.Environment.PRODUCTION) { url = PRODUCTION_URL; } else { url = SANDBOX_URL; } url = URLUtil.AddQueryParameter(url, "PageOffset", options.PageOffset.ToString(), false, null); url = URLUtil.AddQueryParameter(url, "PageLength", options.PageLength.ToString(), false, null); url = URLUtil.AddQueryParameter(url, "Category", options.Category, false, null); url = URLUtil.AddQueryParameter(url, "AddressLine1", options.AddressLine1, false, null); url = URLUtil.AddQueryParameter(url, "AddressLine2", options.AddressLine2, false, null); url = URLUtil.AddQueryParameter(url, "City", options.City, false, null); url = URLUtil.AddQueryParameter(url, "CountrySubdivision", options.CountrySubdivision, false, null); url = URLUtil.AddQueryParameter(url, "PostalCode", options.PostalCode, false, null); url = URLUtil.AddQueryParameter(url, "Country", options.Country, false, null); url = URLUtil.AddQueryParameter(url, "Latitude", options.Latitude == null ? options.Latitude.ToString() : null, false, null); url = URLUtil.AddQueryParameter(url, "Longitude", options.Longitude == null ? options.Longitude.ToString() : null, false, null); url = URLUtil.AddQueryParameter(url, "DistanceUnit", options.DistanceUnit, false, null); url = URLUtil.AddQueryParameter(url, "Radius", options.Radius == null ? options.Radius.ToString() : null, false, null); return(url); }
private object LoadResource(params object[] objs) { KHeroSetting heroSetting = KConfigFileManager.GetInstance().heroSetting.getData(Owner.TabID.ToString()); AssetLoader.GetInstance().Load(URLUtil.GetResourceLibPath() + "Hero/h_" + heroSetting.RepresentID.ToString() + ".hero", LoadResource_OnLoadComplete, AssetType.BUNDLER); return(null); }
private string GetURL(MerchantLocationsRequestOptions options) { string url = ""; if (this.environment == Environments.Environment.PRODUCTION) { url = PRODUCTION_URL; } else { url = SANDBOX_URL; } url = URLUtil.AddQueryParameter(url, "Details", options.GetDetails(), false, null); url = URLUtil.AddQueryParameter(url, "PageOffset", options.GetPageOffset().ToString(), false, null); url = URLUtil.AddQueryParameter(url, "PageLength", options.GetPageLength().ToString(), false, null); url = URLUtil.AddQueryParameter(url, "Category", options.Category, true, ""); url = URLUtil.AddQueryParameter(url, "AddressLine1", options.AddressLine1, true, ""); url = URLUtil.AddQueryParameter(url, "AddressLine2", options.AddressLine2, true, ""); url = URLUtil.AddQueryParameter(url, "City", options.City, true, ""); url = URLUtil.AddQueryParameter(url, "CountrySubdivision", options.CountrySubdivision, true, ""); url = URLUtil.AddQueryParameter(url, "PostalCode", options.PostalCode, true, ""); url = URLUtil.AddQueryParameter(url, "Country", options.Country, true, ""); url = URLUtil.AddQueryParameter(url, "Latitude", options.Latitude.ToString(), true, "0"); url = URLUtil.AddQueryParameter(url, "Longitude", options.Longitude.ToString(), true, "0"); url = URLUtil.AddQueryParameter(url, "DistanceUnit", options.DistanceUnit, true, ""); url = URLUtil.AddQueryParameter(url, "Radius", options.Radius.ToString(), true, "0"); url = URLUtil.AddQueryParameter(url, "OfferMerchantId", options.MerchantId.ToString(), true, "0"); url = URLUtil.AddQueryParameter(url, "InternationalMaestroAccepted", options.GetInternationalMaestroAccepted().ToString(), true, "-1"); return(url); }
private string GetURL(AtmLocationRequestOptions options) { string url; if (this.environment == Environments.Environment.PRODUCTION) { url = PRODUCTION_URL; } else { url = SANDBOX_URL; } url = URLUtil.AddQueryParameter(url, "PageOffset", options.getPageOffset().ToString(), false, null); url = URLUtil.AddQueryParameter(url, "PageLength", options.getPageLength().ToString(), false, null); url = URLUtil.AddQueryParameter(url, "AddressLine1", options.AddressLine1, true, ""); url = URLUtil.AddQueryParameter(url, "AddressLine2", options.AddressLine2, true, ""); url = URLUtil.AddQueryParameter(url, "City", options.City, true, ""); url = URLUtil.AddQueryParameter(url, "CountrySubdivision", options.CountrySubdivision, true, ""); url = URLUtil.AddQueryParameter(url, "PostalCode", options.PostalCode, true, ""); url = URLUtil.AddQueryParameter(url, "Country", options.Country, true, ""); url = URLUtil.AddQueryParameter(url, "Latitude", options.Latitude.ToString(), true, "0"); url = URLUtil.AddQueryParameter(url, "Longitude", options.Longitude.ToString(), true, "0"); url = URLUtil.AddQueryParameter(url, "DistanceUnit", options.DistanceUnit, true, ""); url = URLUtil.AddQueryParameter(url, "Radius", options.Radius.ToString(), true, "0"); url = URLUtil.AddQueryParameter(url, "SupportEMV", options.SupportEMV.ToString(), true, "-1"); return(url); }
private void LoadConfigCompleteHandler(AssetInfo info) { AssetBundleRequest request = null; if (info.url.Contains(".model")) { if (!roleBaseRequests.ContainsKey(curRole)) { request = info.bundle.LoadAsync("rolebase", typeof(GameObject)); roleBaseRequests.Add(curRole, request); } } else { string bundleName = info.url.Substring(URLUtil.url("/ResourceLib/Actor/").Length); string[] str = bundleName.Replace(".actorSkin", "").Split('/'); bundleName = str[0] + "_" + str[2] + "_" + str[1]; foreach (CharacterElement c in curConfiguration.Values) { if (c.bundleName == bundleName) { c.FillInfo(info.bundle); break; } } } configNum--; if (configNum == 0 && LoadConfigComplete != null) { LoadConfigComplete(); } }
private bool LoadEffects(string effects, int nLoadLevel) { if (effects == null) { return(true); } if (effects.Equals("")) { return(true); } string[] effectSplits = effects.Split(new char[] { '|' }); foreach (string effectSplit in effectSplits) { if (nLoadLevel == AssetLoaderLevel.IMMEDIATELY) { AssetLoader.GetInstance().Load(URLUtil.GetResourceLibPath() + effectSplit); } else if (nLoadLevel == AssetLoaderLevel.WAIT_A_MOMENT) { AssetLoader.GetInstance().PreLoad(URLUtil.GetResourceLibPath() + effectSplit); } else if (nLoadLevel == AssetLoaderLevel.ONLY_DOWNLOAD) { AssetLoader.GetInstance().PreLoadOnlyDownload(URLUtil.GetResourceLibPath() + effectSplit); } } return(true); }
protected override string RunInBackground(params string[] @params) { try { var markdown = ""; var url = @params[0]; this.cssFileUrl = @params[1]; if (URLUtil.IsNetworkUrl(url)) { HttpClient c = new HttpClient(); markdown = MyIssues.Util.AsyncHelpers.RunSync(() => c.GetStringAsync(new Uri(url))); } else if (URLUtil.IsAssetUrl(url)) { markdown = _parent.ReadFileFromAsset(url.Substring("file:///android_asset/".Length)); //throw new NotImplementedException(); } else { throw new ArgumentException("The URL string provided is not a network URL or Asset URL.", nameof(url)); } return(markdown); } catch (Exception ex) { Log.Debug(TAG, "Error Loading Markdown File.", ex); return(null); } }
public override void OnAttachToEntity(SceneEntity ety) { BaseInit(ety); AssetLoader.GetInstance().PreLoad(URLUtil.GetRootPath() + "/ResourceLib/Effect/effect_weapon_badao01.res"); Regist(ControllerCommand.WEAPON_TRAIL, OnWeaponTrailChange); Regist(ControllerCommand.EQUIP_CHANGE, OnEquipChange); }
// Use this for initialization void Start() { if (hitFx.Length > 0) { AssetLoader.GetInstance().PreLoad(URLUtil.GetResourceLibPath() + hitFx); } RefreadEndPosition(); }
public override bool ShouldOverrideUrlLoading(WebView view, IWebResourceRequest request) { if (URLUtil.IsNetworkUrl(request.Url.ToString())) { return(false); } _activity.StartActivity(new Intent(Intent.ActionView, request.Url)); return(true); }
public void Load() { loadCount = resources.Count; while (resources.Count > 0) { string resource = resources.Dequeue(); AssetLoader.GetInstance().Load(URLUtil.GetResourceLibPath() + "Atlas/" + resource + ".res", Atlas_OnLoadComplete, AssetType.BUNDLER); } }
public ViewScript(string _viewName, int Width, int Height) { this.Width = Width; this.Height = Height; log = LoggerFactory.GetInstance().GetLogger(this.GetType()); this.viewName = _viewName; log.Debug("加载UI地址" + URLUtil.GetUIPath(viewName)); AssetLoader.GetInstance().Load(URLUtil.GetUIPath(viewName), info_OnLoadComplete, AssetType.UI); }
private IMediaSource GetSource(string url) { var uri = Android.Net.Uri.Parse(url); var factory = URLUtil.IsHttpUrl(url) || URLUtil.IsHttpsUrl(url) ? GetHttpFactory() : new FileDataSourceFactory(); var extractorFactory = new DefaultExtractorsFactory(); return(new ExtractorMediaSource(uri , factory , extractorFactory, null, this)); }
private void InitCoreManager() { RegisterLog(); DontDestroyOnLoad(this.gameObject); log.Debug("Start game application..."); GameWorld.GetInstance(); LoggerView.GetInstance(); CameraLayerManager.GetInstance(); AssetLoader.GetInstance(); ViewCameraManager.GetInstance().Init(); LayerManager.GetInstance().Init(); RemoteCallLogic.GetInstance(); NGUIManager.GetInstance(); LoginController.GetInstance(); SceneLogic.GetInstance(); PlayerController.GetInstance(); BagLogic.GetInstance(); NpcLogic.GetInstance(); TimeManager.GetInstance(); ViewManager.GetInstance(); gameObject.AddComponent("CronJob"); LoadResource(); //ActiveRush.InitFx(); AssetLoader.GetInstance().PreLoad(URLUtil.GetEffectPath("effect_skill_badao03_xuanfengzhan_g2")); AssetLoader.GetInstance().PreLoad(URLUtil.GetEffectPath("effect_skill_badao01_lipihuashantexiao")); AssetLoader.GetInstance().PreLoad(URLUtil.GetEffectPath("effect_skill_badao03_xuanfengzhan")); AssetLoader.GetInstance().PreLoad(URLUtil.GetEffectPath("effect_skill_badao03_xuanfengzhan_mingzhong2")); AssetLoader.GetInstance().PreLoad(URLUtil.GetEffectPath("effect_skill_badao04_yuanyuewandao_mingzhong")); AssetLoader.GetInstance().PreLoad(URLUtil.GetEffectPath("effect_skill_badao04_yuanyuewandao_mingzhong_g")); AssetLoader.GetInstance().PreLoad(URLUtil.GetEffectPath("effect_skill_badao04_yuanyuewandao_wuqifeixing")); AssetLoader.GetInstance().PreLoad(URLUtil.GetEffectPath("effect_skill_badao04_yuanyuewandao")); AssetLoader.GetInstance().PreLoad(URLUtil.GetEffectPath("effect_skill_badao02_nuzhanbahuang_gongji")); AssetLoader.GetInstance().PreLoad(URLUtil.GetEffectPath("effect_skill_daobin_06_nuhou_shifa")); AssetLoader.GetInstance().PreLoad(URLUtil.GetEffectPath("effect_skill_daobin_05_zhenfei")); AssetLoader.GetInstance().PreLoad(URLUtil.GetEffectPath("effect_skill_daobin_04_chongfeng")); AssetLoader.GetInstance().PreLoad(URLUtil.GetEffectPath("effect_skill_daobin_04_chongfeng_mingzhong")); AssetLoader.GetInstance().PreLoad(URLUtil.GetEffectPath("effect_guaiwusiwang2")); AssetLoader.GetInstance().PreLoad(URLUtil.GetEffectPath("effect_levelup")); AssetLoader.GetInstance().Load(URLUtil.GetEffectPath("effect_guangquan_yellow"), PLAYER_SEL_LoadComplete, AssetType.BUNDLER); AssetLoader.GetInstance().Load(URLUtil.GetEffectPath("effect_guangquan2_red"), NPC_SEL_LoadComplete, AssetType.BUNDLER); PreLoad.GetInstance().OnEnterScene(); SelecterManager.GetInstance(); }
private void LoadResource() { if (Owner.property.dropType == KDropType.dtMoney) { AssetLoader.GetInstance().Load(URLUtil.GetResourceLibPath() + "Scene/Collect/baoxiang.obj", LoadResource_OnLoadComplete, AssetType.BUNDLER); } else { AssetLoader.GetInstance().Load(URLUtil.GetResourceLibPath() + "Scene/Collect/jingbi.obj", LoadResource_OnLoadComplete, AssetType.BUNDLER); } }
private async void ImportListAsync() { if ((URLUtil.IsValidUrl(URLImport) == false) || (URLImport == null)) { await _pageDialog.DisplayAlertAsync("ATENÇÃO", "Verifique a inserção da URL !", "OK"); } else { ImportAPIAsync(URLImport); } }
private async void CreatePayment(string token, UserToken userToken) { var securityUri = await CheckoutService.CreatePayment(token, userToken); if (securityUri == null) { return; } if (URLUtil.IsHttpsUrl(securityUri.AbsoluteUri) || URLUtil.IsAssetUrl(securityUri.AbsoluteUri)) { StartActivityForResult(Checkout.Create3dsIntent(this, securityUri.AbsoluteUri), RequestCode3Ds); } }
public void LoadEquipModel(int key, string equipModelName, GameObject panel) { this.equipName = equipModelName; this.equipModelKey = key; this.panel = panel; if (loadModelList.ContainsKey(equipModelKey)) { DestroyModel(); CreateView(loadModelList[equipModelKey]); return; } AssetLoader.GetInstance().Load(URLUtil.GetEquipModelPath(equipModelName), LoadModelComplete, AssetType.BUNDLER); }
public void LoadRoleAnimAndPlay(string character, string animName) { if (Owner.Anim && Owner.Anim.GetClip(animName) != null) { //Debug.LogWarning("CrossFade "+animName); Owner.Anim.CrossFade(animName); } else { string resFile = URLUtil.url("/ResourceLib/Actor/" + character + "/" + animName + ".actorAnim"); AssetLoader.GetInstance().Load(resFile, AnimLoadComplete, AssetType.BUNDLER); } }
public void LoadConfig(int num, LoadAssetComponent loader) { loader.Release(); configNum = num + 1; //加一个基础模型. loader.Load(URLUtil.url("/ResourceLib/Actor/" + curRole + "/rolebase.model") , LoadConfigCompleteHandler, AssetType.BUNDLER); foreach (CharacterElement c in curConfiguration.Values) { string[] a = c.bundleName.Split('_'); loader.Load(URLUtil.url("/ResourceLib/Actor/" + curRole + "/" + a[2] + "/" + a[1] + ".actorSkin") , LoadConfigCompleteHandler, AssetType.BUNDLER); } }
private void PlayMouseClickEffect(Vector3 position) { if (mouseClickEffect == null) { AssetLoader.GetInstance().Load(URLUtil.GetEffectPath("effect_shubiaodianjitexiao"), MouseClickEffect_LoadComplete, AssetType.BUNDLER); } else { TimeManager.GetInstance().AddOnce(MouseClickEffect_TimeOver, 1000); mouseClickEffect.transform.position = clickPosition; mouseClickEffect.transform.up = Vector3.up; mouseClickEffect.SetActive(true); } }