void OnEnable() { CSAdvertisingPanels bm = (CSAdvertisingPanels)target; banner = Resources.Load("CSHeader") as Texture; bm.UpdateAdv(); }
public override void OnInspectorGUI() { CSAdvertisingPanels bm = (CSAdvertisingPanels)target; GUILayout.Box(banner, GUILayout.ExpandWidth(true)); bm.advPanelFrontPrefab = EditorGUILayout.ObjectField("AdvertisingPanel template", bm.advPanelFrontPrefab, typeof(GameObject), true) as GameObject; if (GUILayout.Button("Update Template")) { bm.UpdateAdv(); } if (GUI.changed) { bm.UpdateAdv(); EditorUtility.SetDirty(bm); } }