add
This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
using UnityEngine;
|
||||
using System.Collections;
|
||||
using UnityEditor;
|
||||
|
||||
[CustomEditor(typeof(HUDText))]
|
||||
public class HUDTextInspector:Editor {
|
||||
HUDText hud;
|
||||
public override void OnInspectorGUI ()
|
||||
{
|
||||
serializedObject.Update ();
|
||||
hud = target as HUDText;
|
||||
EditorGUILayout.BeginHorizontal ();{
|
||||
if (NGUIEditorTools.DrawPrefixButton ("Font", GUILayout.Width (64f))) {
|
||||
ComponentSelector.Show<UIFont> (OnNGUIFont);
|
||||
}
|
||||
NGUIEditorTools.DrawProperty ("Font Name", serializedObject, "fontName"); // add by chenbin
|
||||
}
|
||||
EditorGUILayout.EndHorizontal ();
|
||||
base.OnInspectorGUI ();
|
||||
|
||||
}
|
||||
|
||||
void OnNGUIFont (Object obj)
|
||||
{
|
||||
serializedObject.Update();
|
||||
SerializedProperty sp = serializedObject.FindProperty("font");
|
||||
sp.objectReferenceValue = obj;
|
||||
serializedObject.ApplyModifiedProperties();
|
||||
hud.fontName = obj.name;
|
||||
NGUISettings.ambigiousFont = obj;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 2327528ec4af846689b78cc1f1d5b5dd
|
||||
timeCreated: 1450423026
|
||||
licenseType: Pro
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Reference in New Issue
Block a user