void Awake() { LocalizedGUITexture textObject = ((GUITexture)target).gameObject.GetComponent <LocalizedGUITexture>(); if (textObject != null) { selectedKey = textObject.localizedKey; } }
void Awake() { LocalizedGUITexture textObject = ((LocalizedGUITexture)target); if (textObject != null) { selectedKey = textObject.localizedKey; } }
/// <summary> /// Override of the OnInspectorGUI method /// </summary> public override void OnInspectorGUI() { base.OnInspectorGUI(); selectedKey = LocalizedKeySelector.SelectKeyGUI(selectedKey, true, LocalizedObjectType.TEXTURE); if (!Application.isPlaying && GUILayout.Button("Use Key", GUILayout.Width(70))) { LocalizedGUITexture textObject = ((LocalizedGUITexture)target); textObject.localizedKey = selectedKey; } }
public override void OnInspectorGUI() { base.OnInspectorGUI(); selectedKey = LocalizedKeySelector.SelectKeyGUI(selectedKey, true, LocalizedObjectType.TEXTURE); if (!Application.isPlaying && GUILayout.Button("Use Key", GUILayout.Width(80))) { GameObject targetGameObject = ((GUITexture)target).gameObject; LocalizedGUITexture textObject = targetGameObject.GetComponent <LocalizedGUITexture>(); if (textObject == null) { textObject = targetGameObject.AddComponent <LocalizedGUITexture>(); } textObject.localizedKey = selectedKey; } }