public void Awake() { _instance = this; Debuger.EnableLog = false; Application.targetFrameRate = 50; isOpenMicrophone = true; Screen.sleepTimeout = SleepTimeout.NeverSleep; //保留主程序 GameObject.DontDestroyOnLoad(gameObject); VersionManager.localVersion = Application.version; //Bugly、友盟等对接 SDKManager.SetupBugly(); // LayerManager.Setup(); AssetPathUtil.Setup(); LoaderManager.Setup(); AlertUI.Setup(); PopManager.Setup(); /** * _loadingView = GameObject.Find("UI_Loading").AddComponent<SceneLoadingPanel>(); * m_NOTICEUI = LayerManager.topUILayer.Find("NoticeUI").gameObject.AddComponent<NoticeUI>(); * m_NOTICEUI.Online(); * _loadingView.SetTitle("正在检查游戏版本..."); */ }
public override void OnActivityCreated(Bundle p0) { base.OnActivityCreated(p0); // Give some text to display if there is no data. In a real // application this would come from a resource. SetEmptyText("No phone numbers"); // We have a menu item to show in action bar. HasOptionsMenu = true; // Create an empty adapter we will use to display the loaded data. _adapter = new SimpleCursorAdapter(Activity, Android.Resource.Layout.SimpleListItem1, null, new string[] { Android.Provider.Contacts.People.InterfaceConsts.DisplayName }, new int[] { Android.Resource.Id.Text1 }); ListAdapter = _adapter; // Start out with a progress indicator. SetListShown(false); // Prepare the loader. Either re-connect with an existing one, // or start a new one. LoaderManager.InitLoader(0, null, this); }
public LoaderCreatObject(LoaderManager _lmanager, string objkey, string _assetsKey, string _resname, System.Action <string, object> _callback) : base(_lmanager) { mObjectKey = objkey; mAssetsKey = _assetsKey; mResname = _resname; mDelgate = _callback; }
void TextLoader() { int loadingVal = (int)(LoaderManager.Get().loadingProgress * 100); loadingText.text = loadingVal.ToString() + "%"; if (LoaderManager.Get().loadingProgress >= 1) SetVisible(false); }
private void InitManagers() { this._loader = LoaderManager.Instance; this._loader.LoadFiles(); this._mapLoader = new MapLoader(); var initInfo = new MapInitInfo(); initInfo.Biome = EBiome.Grassland; var lParty = new PartyBuildParams(); var rParty = new PartyBuildParams(); lParty.AIControlled = true; lParty.Culture = ECulture.Orcish; lParty.Difficulty = 2000; lParty.Name = "Ween Herders"; rParty.AIControlled = true; rParty.Culture = ECulture.Goblin; rParty.Difficulty = 2000; rParty.Name = "Battle Party"; initInfo.LParties.Add(lParty); initInfo.RParties.Add(rParty); initInfo.Cols = 20; initInfo.Rows = 20; var map = this._mapLoader.GetCombatMap(initInfo); CombatManager.Instance.Init(map); }
void Start() { BirdController.getInstance().onDead += RestartWindow_onDead; restartButton.onClick.AddListener(() => { LoaderManager.Load(LoaderManager.Scenes.MainScene); }); }
private void Awake() { Instance = this; // 1. 先加载 AssetBundleManifest 文件 // StartCoroutine(LoadManifest.Instance.LoadAssetBundleManifest()); }
public static void Run(string ipcPortName, Guid linkId) { LoaderManager.InitializeAndSetupRuntimeIfNeeded(); // note: after this point we can reference Gallio types. ShimWithRuntime.Run(ipcPortName, linkId); }
private async void DeleteNoteExecute(object o) { LoaderManager.ShowLoader(); await Task.Run(() => { if (SelectedNote == null) { return; } StationManager.CurrentUser.Notes.RemoveAll(uwr => uwr.Guid == SelectedNote.Guid); App.Current.Dispatcher.Invoke((Action) delegate { DBManager.DeleteNote(SelectedNote.Note); FillNotes(); if (Notes.Count < 1) { SelectedNote = null; } OnPropertyChanged(nameof(SelectedNote)); OnPropertyChanged(nameof(Notes)); }); }); LoaderManager.HideLoader(); }
IEnumerator ChangeScene(string sceneName) { AudioSource.PlayClipAtPoint(audioSelect, CameraController.Get().transform.position, 1f); yield return(new WaitForSeconds(2)); LoaderManager.Get().LoadScene(sceneName); }
public override void Load() { base.Load(); mPathName = LoaderManager.GetFullPath(mAssetName); mAssetsBundle = AssetBundle.LoadFromFile(mPathName); if (mAssetsBundle != null) { if (((AssetBundle)mAssetsBundle).isStreamedSceneAssetBundle) { mAsset = ((AssetBundle)mAssetsBundle).LoadAllAssets(); } else { mAsset = ((AssetBundle)mAssetsBundle).LoadAsset(mAssetName); } OptAssetShow(); } else { UnityEngine.Debug.LogError("AssetsBundleFromFile打开文件失败,请检查资源是否存在-" + mPathName); } LoadEnd(); }
public void Search(object sender, SearchView.QueryTextChangeEventArgs e) { if (e.NewText == "") { query = null; isInEditMode = item.HasWritePermission && item.LocalID != 0; } else { query = e.NewText.ToLower(); isInEditMode = false; } if (item.LocalID != -1) { LoaderManager.GetInstance(this).RestartLoader(0, null, this); } else { if (query == null) { adapter.tracks.SetFilter(x => true); } else { adapter.tracks.SetFilter(x => x.Title.ToLower().Contains(query) || x.Artist.ToLower().Contains(query)); } adapter.NotifyDataSetChanged(); } }
public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { // Use this to return your custom view for this Fragment // return inflater.Inflate(Resource.Layout.YourFragment, container, false); View view = inflater.Inflate(Resource.Layout.MainUserListFragment, container, false); User user = ((MainUserActivity)Activity).LoggedIn; UserCollection = DBHandler.Instance.GetUserCollection(user.ID); TextView listNameText = view.FindViewById <TextView>(Resource.Id.listNameText); listNameText.Text = UserCollection[0].Name; collectionItemRecyclerAdapter = new CollectionItemRecyclerAdapter(); collectionItemRecyclerAdapter.ItemClick += OnListClicked; RecyclerView collectionList = view.FindViewById <RecyclerView>(Resource.Id.collectionItemRecyclerView); LinearLayoutManager layout = new LinearLayoutManager(Activity); collectionList.SetLayoutManager(layout); collectionList.SetAdapter(collectionItemRecyclerAdapter); LoaderManager.InitLoader(COLLECTIONITEMLIST_LOADER_ID, null, this); return(view); }
private async void LoginCommandImpl(object arg) { var passBox = arg as PasswordBox; if (passBox == null) { return; } LoaderManager.ShowLoader(); var isLoggedIn = await AccountManager.SignIn(Login, passBox.Password); LoaderManager.HideLoader(); // If user exists and password is correct if (isLoggedIn) { NavigationManager.Navigate(Managers.Screens.Main); // Clear fields if success Login = ""; passBox.Password = ""; } else { MessageBox.Show("Can't login to account."); } }
public override void Load(LoaderManager _loader) { mPathName = _loader.GetFullPath(mAssetName); mCreat = AssetBundle.LoadFromFileAsync(mPathName); mStep = StepState.BundleLoad; base.Load(_loader); }
public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { // Use this to return your custom view for this Fragment // return inflater.Inflate(Resource.Layout.YourFragment, container, false); View view = inflater.Inflate(Resource.Layout.MainUserFeedFragment, container, false); nowShowingAdapter = new NowShowingListAdapter(Activity); ListView nowShowingList = view.FindViewById <ListView>(Resource.Id.nowShowingListView); nowShowingList.Adapter = nowShowingAdapter; nowShowingList.ItemClick += OnListClicked; SetupListViews(nowShowingList); comingSoonAdapter = new ComingSoonListAdapter(Activity); ListView comingSoonList = view.FindViewById <ListView>(Resource.Id.comingSoonListView); comingSoonList.Adapter = comingSoonAdapter; comingSoonList.ItemClick += OnListClicked; SetupListViews(comingSoonList); LoaderManager.InitLoader(NOWSHOWING_LOADER_ID, null, this); LoaderManager.InitLoader(COMINGSOON_LOADER_ID, null, this); return(view); }
} // selectedItems (data & type), serialize json { type: "Type", book: Object }, write in file private void BtnDeserialize_Click(object sender, RoutedEventArgs e) { GroupBox gr = GetMainGroupBox(sender); Grid g = (Grid)gr.Parent; ListView bookListForm = g.Children.OfType <ListView>().First(x => x.Name == "BookListForm"); OpenFileDialog dlg = new OpenFileDialog() { Filter = "JSON files | *.json" }; if (dlg.ShowDialog() == true) { StreamReader reader = new StreamReader(dlg.OpenFile()); string item; while ((item = reader.ReadLine()) != null) { // indexof(':')? string[] words = item.Split(':'); item = item.Substring(words[0].Length + 1, item.Length - words[0].Length - 1); var loader = LoaderManager.GetLoader(words[0]); Book book = loader.Deserialize(item); bookListForm.Items.Add(new ItemInList { Type = words[0], Name = book.Name, Author = book.Author, Data = book }); } reader.Dispose(); reader.Close(); } }
private void Update() { if (LoaderManager.Get().OnLevel()) { time += Time.deltaTime; } }
// Start is called before the first frame update void Start() { BaseLoader loader = LoaderManager.Load(ELoaderType.ResourceLoader, "Cube"); loader.onCompleted += (type, obj) => { Instantiate <GameObject>(obj as GameObject); }; loader = LoaderManager.Load(ELoaderType.ResourceLoader, "Sphere"); loader.onCompleted += (type, obj) => { Instantiate <GameObject>(obj as GameObject); }; for (int i = 0; i < 40; i++) { loader = LoaderManager.Load(ELoaderType.ResourceLoader, "Cylinder"); loader.onCompleted += (type, obj) => { GameObject go = Instantiate <GameObject>(obj as GameObject); go.name = string.Format("Cylinder{0}", i); }; } }
void BarLoader() { int loadingVal = (int)(LoaderManager.Get().loadingProgress * 100); Debug.Log(loadingVal * 0.01); loadingBar.fillAmount = (loadingVal*0.01f); if (LoaderManager.Get().loadingProgress >= 1) SetVisible(false); }
private async void RemoveReminding(ReminderData data) { LoaderManager.ShowLoader(); await AccountManager.DeleteReminding(data); FillNotifications(); LoaderManager.HideLoader(); EditorVisibility = Visibility.Hidden; }
public void ForcedChangeScene() { if (SceneManager.GetActiveScene().name == "Gameplay") { Destroy(GameManager.Get().gameObject); Destroy(WaveSystem.Get().gameObject); Destroy(TurretSpawner.Get().gameObject); Destroy(Highscore.Get().gameObject); Destroy(MilestoneManager.Get().gameObject); UpgradeSystem upgrades = UpgradeSystem.Get(); if (upgrades) { upgrades.CleanList(); } } else if (SceneManager.GetActiveScene().name == "Upgrade Screen") { AkSoundEngine.StopAll(); } if (sceneName == "Gameplay") { AkSoundEngine.StopAll(); UpgradeSystem upgrades = UpgradeSystem.Get(); if (upgrades) { upgrades.CleanList(); } LoaderManager.Get().LoadScene(sceneName); UILoadingScreen.Get().SetVisible(true); } else if (sceneName == "Upgrade Screen") { AkSoundEngine.StopAll(); UpgradeSystem upgrades = UpgradeSystem.Get(); if (upgrades) { upgrades.CleanList(); } SceneManager.LoadScene(sceneName); } else { SceneManager.LoadScene(sceneName); } Time.timeScale = 1; }
public virtual void OnCreate(FragmentActivity context, GridView gridView, SelectedUriCollection mCollection, SelectionSpec selectionSpec) { mContext = new System.WeakReference <Context>(context); mLoaderManager = context.SupportLoaderManager; this.selectionSpec = selectionSpec; albumPhotoAdapter = new PictureAdapter(context, null, mCollection); mCollection.Engine.Scrolling(gridView); gridView.Adapter = albumPhotoAdapter; }
private void PopulateAutoComplete() { if (!MayRequestContacts()) { return; } LoaderManager.InitLoader(0, null, this); }
private static void StartLoad(LoadTask task) { string abName = task.abName; //先加载依赖AB string[] dependenciesAB = _manifest.GetAllDependencies(abName); foreach (string dpdAB in dependenciesAB) { if (_abDic.ContainsKey(dpdAB)) { continue; } task.dependencies.Add(dpdAB); if (_loadingABCountDic.ContainsKey(dpdAB)) { _loadingABCountDic[dpdAB]++; continue; } _loadingABCountDic.Add(dpdAB, 1); string relativePath = AssetPathUtil.PlatformString + "/" + dpdAB; string dpdUrl; if (VersionManager.HasCache(relativePath)) { dpdUrl = VersionManager.GetPath(relativePath); } else { dpdUrl = AssetPathUtil.GetAssetBundlePath(dpdAB); } LoaderManager.Load(dpdUrl, EnumResouceType.ASSETBUNDLE, OnABLoadComplete); } if (task.IsDependenciesLoadComplete()) { if (!_loadingABCountDic.ContainsKey(abName)) { _loadingABCountDic.Add(abName, 1); string relativePath = AssetPathUtil.PlatformString + "/" + abName; string abUrl; if (VersionManager.HasCache(relativePath)) { abUrl = VersionManager.GetPath(relativePath); } else { abUrl = AssetPathUtil.GetAssetBundlePath(abName); } LoaderManager.Load(abUrl, EnumResouceType.ASSETBUNDLE, OnABLoadComplete); } else { _loadingABCountDic[task.abName]++; } } }
public void NextLvl() { level++; LoaderManager.Get().LoadScene("GameScene"); UILoadingScreen.Get().SetVisible(true); landingScreen.SetActive(false); winText.gameObject.SetActive(false); loseText.gameObject.SetActive(false); next.onClick.RemoveAllListeners(); }
public void Update() { int loadingVal = (int)(LoaderManager.Get().loadingProgress * 100); loadingText.text = "Loading " + loadingVal; if (LoaderManager.Get().loadingProgress >= 1) { Destroy(this.gameObject); } }
public void Update() { int loadingVal = (int)(LoaderManager.Get().loadingProgress * 100); loadingText.text = loadingVal + "%"; if (LoaderManager.Get().loadingProgress >= 1) { SetVisible(false); } }
public override void Load(LoaderManager _loader) { mPathName = mAssetName; if (!mPathName.Contains("file://")) { mPathName = "file://" + mPathName; } mCreat = new WWW(mPathName); base.Load(_loader); }
public virtual void OnCreate(FragmentActivity activity, IOnDirectorySelectListener directorySelectListener, SelectionSpec selectionSpec, ListView listView) { mContext = new WeakReference <Context>(activity); mLoaderManager = activity.SupportLoaderManager; this.directorySelectListener = directorySelectListener; this.selectionSpec = selectionSpec; albumAdapter = new AlbumAdapter(activity, null); listView.Adapter = albumAdapter; listView.OnItemClickListener = this; }