remove Awake.
This commit is contained in:
Родитель
607e006b72
Коммит
80b91380a7
|
@ -92,8 +92,7 @@ UIWidgets应用是用**C#脚本**来编写的。 请按照以下步骤创建
|
|||
|
||||
namespace UIWidgetsSample {
|
||||
public class UIWidgetsExample : UIWidgetsPanel {
|
||||
protected override void Awake() {
|
||||
base.Awake();
|
||||
protected override void OnEnable() {
|
||||
// Application.targetFrameRate = 60; // or higher if you want a smoother scrolling experience.
|
||||
|
||||
// if you want to use your own font or font icons.
|
||||
|
@ -106,6 +105,8 @@ UIWidgets应用是用**C#脚本**来编写的。 请按照以下步骤创建
|
|||
|
||||
// add material icons, familyName must be "Material Icons"
|
||||
// FontManager.instance.addFont(Resources.Load<Font>(path: "path to material icons"), "Material Icons");
|
||||
|
||||
base.OnEnable();
|
||||
}
|
||||
|
||||
protected override Widget createWidget() {
|
||||
|
|
|
@ -102,8 +102,7 @@ in Unity Editor.
|
|||
|
||||
namespace UIWidgetsSample {
|
||||
public class UIWidgetsExample : UIWidgetsPanel {
|
||||
protected override void Awake() {
|
||||
base.Awake();
|
||||
protected override void OnEnable() {
|
||||
// Application.targetFrameRate = 60; // or higher if you want a smoother scrolling experience.
|
||||
|
||||
// if you want to use your own font or font icons.
|
||||
|
@ -116,6 +115,8 @@ in Unity Editor.
|
|||
|
||||
// add material icons, familyName must be "Material Icons"
|
||||
// FontManager.instance.addFont(Resources.Load<Font>(path: "path to material icons"), "Material Icons");
|
||||
|
||||
base.OnEnable();
|
||||
}
|
||||
|
||||
protected override Widget createWidget() {
|
||||
|
|
|
@ -21,9 +21,6 @@ namespace Unity.UIWidgets.editor {
|
|||
this.wantsMouseEnterLeaveWindow = true;
|
||||
}
|
||||
|
||||
protected virtual void Awake() {
|
||||
}
|
||||
|
||||
protected virtual void OnEnable() {
|
||||
if (this._windowAdapter == null) {
|
||||
this._windowAdapter = new EditorWindowAdapter(this);
|
||||
|
|
|
@ -30,9 +30,9 @@ namespace UIWidgetsSample {
|
|||
home: this.testCases[this.testCaseId]);
|
||||
}
|
||||
|
||||
protected override void Awake() {
|
||||
base.Awake();
|
||||
protected override void OnEnable() {
|
||||
FontManager.instance.addFont(Resources.Load<Font>(path: "MaterialIcons-Regular"), "Material Icons");
|
||||
base.OnEnable();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -8,8 +8,7 @@ using TextStyle = Unity.UIWidgets.painting.TextStyle;
|
|||
|
||||
namespace UIWidgetsSample {
|
||||
public class FontWeightStyle : UIWidgetsSamplePanel {
|
||||
protected override void Awake() {
|
||||
base.Awake();
|
||||
protected override void OnEnable() {
|
||||
// To run this sample, you need to download Roboto fonts and place them under Resources/Fonts folder
|
||||
// Roboto fonts could be downloaded from google website
|
||||
// https://fonts.google.com/specimen/Roboto?selection.family=Roboto
|
||||
|
@ -38,6 +37,8 @@ namespace UIWidgetsSample {
|
|||
FontWeight.w100);
|
||||
FontManager.instance.addFont(Resources.Load<Font>(path: "Fonts/Roboto-ThinItalic"), "Roboto",
|
||||
FontWeight.w100, FontStyle.italic);
|
||||
|
||||
base.OnEnable();
|
||||
}
|
||||
|
||||
protected override Widget createWidget() {
|
||||
|
|
|
@ -17,10 +17,10 @@ namespace UIWidgetsGallery {
|
|||
return new GalleryApp();
|
||||
}
|
||||
|
||||
protected override void Awake() {
|
||||
base.Awake();
|
||||
protected override void OnEnable() {
|
||||
FontManager.instance.addFont(Resources.Load<Font>("MaterialIcons-Regular"), "Material Icons");
|
||||
FontManager.instance.addFont(Resources.Load<Font>("GalleryIcons"), "GalleryIcons");
|
||||
base.OnEnable();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -11,10 +11,11 @@ namespace UIWidgetsGallery {
|
|||
return new GalleryApp();
|
||||
}
|
||||
|
||||
protected override void Awake() {
|
||||
base.Awake();
|
||||
protected override void OnEnable() {
|
||||
FontManager.instance.addFont(Resources.Load<Font>("MaterialIcons-Regular"), "Material Icons");
|
||||
FontManager.instance.addFont(Resources.Load<Font>("GalleryIcons"), "GalleryIcons");
|
||||
|
||||
base.OnEnable();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -48,10 +48,10 @@ namespace UIWidgetsTheatre {
|
|||
home: entries[this.testCaseId].entryWidget);
|
||||
}
|
||||
|
||||
protected override void Awake() {
|
||||
base.Awake();
|
||||
protected override void OnEnable() {
|
||||
FontManager.instance.addFont(Resources.Load<Font>("MaterialIcons-Regular"), "Material Icons");
|
||||
FontManager.instance.addFont(Resources.Load<Font>("GalleryIcons"), "GalleryIcons");
|
||||
base.OnEnable();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -107,11 +107,9 @@ namespace UIWidgets.Tests {
|
|||
this.windowAdapter.Update();
|
||||
}
|
||||
|
||||
void Awake() {
|
||||
FontManager.instance.addFont(Resources.Load<Font>("MaterialIcons-Regular"), "Material Icons");
|
||||
}
|
||||
|
||||
void OnEnable() {
|
||||
FontManager.instance.addFont(Resources.Load<Font>("MaterialIcons-Regular"), "Material Icons");
|
||||
|
||||
this.windowAdapter = new EditorWindowAdapter(this);
|
||||
this.windowAdapter.OnEnable();
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче