void Awake() { #if !UNITY_EDITOR && UNITY_ANDROID ApplicationUtility.instance.GetAppName(); #endif if (mOnlyInstance == null) { mOnlyInstance = this; //初始化系统信息 AppSystemInfo.InitSysInfos(); OnLoad(); } else { GameObject.Destroy(this.gameObject); } }
protected override void OnInitialize() { _stopwatch = Stopwatch.StartNew(); Application.Idle += Application_Idle; var parentForm = FindParentForm(); if (parentForm != null) { parentForm.Activated += ParentForm_Activated; parentForm.Deactivate += ParentForm_Deactivated; _parentForm = parentForm; } GameInitialize?.Invoke(this, EventArgs.Empty); OnLoadContents(); }