Unity API——Application类的详解(一):列举属性和方法
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Unity API——Application类的详解(一):列举属性和方法相关的知识,希望对你有一定的参考价值。
参考技术A Application类位于UnityEngine下,用于访问应用程序在运行时的一些数据。这个类不包含实例属性和实例方法,这就意味着在脚本中我们直接通过Application类来调用其静态的属性静态方法来控制程序运行时的数据。虽然以上罗列的属性和方法官网API都有详细的介绍,但这里我用表格的形式展现出这些方法和属性,阅读起来更直观,同时我将常用的放在前面,功能相似的属性和方法放在一块,这样好做一个区分和比较。
第一篇文章就这样写完了,虽然没有写什么实质性的内容,但还是感觉蛮有成就感的,最重要的是已经迈出了第一步,敢写敢做,立马行动,以前知道写博客文章很重要,但是迟迟没有行动,所以说路在脚下,要敢于往前走。还有就是学会了使用markdown,一开始用的时候感觉挺不适应的,但慢慢写下来,熟悉了语法,觉得还是挺好用的,好处不用说,谁用谁知道。
今天只是一个开始,坚持!继续加油!
WPF——Application
Application类处于WPF应用程序的最顶端,main函数就在这个类中。
Application类的作用:
截图连接 https://docs.microsoft.com/zh-cn/dotnet/api/system.windows.application?view=netframework-4.8
https://docs.microsoft.com/zh-cn/dotnet/framework/wpf/app-development/application-management-overview
#region Assembly PresentationFramework, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
// C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.5\\PresentationFramework.dll
#endregion
using System.Collections;
using System.Reflection;
using System.Security;
using System.Windows.Markup;
using System.Windows.Navigation;
using System.Windows.Resources;
using System.Windows.Threading;
namespace System.Windows
public class Application : DispatcherObject, IHaveResources, IQueryAmbient
[SecurityCritical]
public Application();
public static Assembly ResourceAssembly get; set;
public static Application Current get;
public WindowCollection Windows get;
public Window MainWindow get; set;
public ShutdownMode ShutdownMode get; set;
[Ambient]
public ResourceDictionary Resources get; set;
public Uri StartupUri get; set;
public IDictionary Properties get;
public event StartupEventHandler Startup;
public event ExitEventHandler Exit;
public event EventHandler Deactivated;
public event SessionEndingCancelEventHandler SessionEnding;
public event DispatcherUnhandledExceptionEventHandler DispatcherUnhandledException;
public event NavigatingCancelEventHandler Navigating;
public event NavigatedEventHandler Navigated;
public event NavigationProgressEventHandler NavigationProgress;
public event NavigationFailedEventHandler NavigationFailed;
public event LoadCompletedEventHandler LoadCompleted;
public event EventHandler Activated;
public event NavigationStoppedEventHandler NavigationStopped;
public event FragmentNavigationEventHandler FragmentNavigation;
[SecurityCritical]
public static StreamResourceInfo GetContentStream(Uri uriContent);
public static string GetCookie(Uri uri);
[SecurityCritical]
public static StreamResourceInfo GetRemoteStream(Uri uriRemote);
[SecurityCritical]
public static StreamResourceInfo GetResourceStream(Uri uriResource);
public static object LoadComponent(Uri resourceLocator);
[SecurityCritical]
public static void LoadComponent(object component, Uri resourceLocator);
public static void SetCookie(Uri uri, string value);
public object FindResource(object resourceKey);
[SecurityCritical]
public int Run(Window window);
public int Run();
public void Shutdown();
[SecurityCritical]
public void Shutdown(int exitCode);
public object TryFindResource(object resourceKey);
protected virtual void OnActivated(EventArgs e);
protected virtual void OnDeactivated(EventArgs e);
protected virtual void OnExit(ExitEventArgs e);
protected virtual void OnFragmentNavigation(FragmentNavigationEventArgs e);
protected virtual void OnLoadCompleted(NavigationEventArgs e);
protected virtual void OnNavigated(NavigationEventArgs e);
protected virtual void OnNavigating(NavigatingCancelEventArgs e);
protected virtual void OnNavigationFailed(NavigationFailedEventArgs e);
protected virtual void OnNavigationProgress(NavigationProgressEventArgs e);
protected virtual void OnNavigationStopped(NavigationEventArgs e);
protected virtual void OnSessionEnding(SessionEndingCancelEventArgs e);
protected virtual void OnStartup(StartupEventArgs e);
在xml文件中指定启动的Page或者Windows就可启动窗体。
以上是关于Unity API——Application类的详解(一):列举属性和方法的主要内容,如果未能解决你的问题,请参考以下文章