示例#1
0
        bool DrawPackFields(EditorProp pack)
        {
            GUILayoutOption w = GUILayout.Width(100);

            bool changedVar = false;

            GUIUtils.StartBox(1);
            //name
            changedVar = GUIUtils.DrawTextProp(pack[nameField], new GUIContent("Pack Name"), GUIUtils.TextFieldType.Normal, false, "name", w) || changedVar;

            GUIUtils.DrawToggleProp(pack[isCustomField], new GUIContent("Custom Objects", "Does the pack consist of custom objects that arent represented by assets in the project?"), w);

            GUIUtils.Space();

            bool isCustom = pack[isCustomField].boolValue;

            if (!isCustom)
            {
                //asset type
                changedVar = CheckedVariable(pack[assetTypeField], new GUIContent("Asset Type", "The asset type or component the pack targets.\nMust inherit from UnityEngine.Object"), w) || changedVar;
                DrawHelpBox(pack[assetTypeField], IsValidTypeString, InvalidAssetTypeError);
                //directory
                changedVar = GUIUtils.DrawDirectoryField(pack[dirField], new GUIContent("Objects Directory", "The directory where the assets are held"), true, w) || changedVar;
                DrawHelpBox(pack[dirField], IsValidDirectory, InvalidDirectoryError);
                //file extensions
                changedVar = CheckedVariable(pack[extensionsField], new GUIContent("File Extensions", "The file extensions to look for in the directory, seperated by commas.\nExample: '.fbx, .wav, .mp3'"), w) || changedVar;
                DrawHelpBox(pack[extensionsField], FileExtensionValid, InvalidFileExtensionsError);
            }
            else
            {
                changedVar = CheckedVariable(pack[assetTypeField], new GUIContent("Icon Asset Type", "The asset type or component to use for the icon.\nMust inherit from UnityEngine.Object"), w) || changedVar;
                DrawHelpBox(pack[assetTypeField], IsValidTypeString, InvalidAssetTypeError);
            }
            GUIUtils.EndBox(1);
            return(changedVar);
        }