Пример #1
0
 private void OnGUI()
 {
     GUILayout.BeginHorizontal();
     GUILayout.BeginVertical(GUI.skin.box, GUILayout.Width(left_width));
     DrawTarget();
     DrawHUDComponents();
     GUILayout.EndVertical();
     DrawPreview();
     GUILayout.BeginHorizontal();
     if (edit_trans != null)
     {
         HUDEditorHelper.InnerDepthSort(edit_trans.Group);
         edit_trans.Group.ForceRebuild();
     }
 }
Пример #2
0
        private void DrawOptions()
        {
            add_name  = EditorGUILayout.TextField(add_name);
            add_index = EditorGUILayout.Popup(add_index, HUDEditorHelper.HUDComponentNamesArray());
            if (add_index >= 0)
            {
                var ty = HUDEditorHelper.GetComponentType(add_index);
                add_index = -1;
                AddNewComponent(ty);
            }

            if (GUILayout.Button("Save"))
            {
                bool suc = false;
                CheckMeshRender();
                PrefabUtility.SaveAsPrefabAssetAndConnect(edit_trans.gameObject, AssetDatabase.GetAssetPath(trans), InteractionMode.AutomatedAction, out suc);
            }
        }