-
-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added repository and publish config work
* Bumped package version to v1.4.1
- Loading branch information
Showing
19 changed files
with
682 additions
and
81 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
35 changes: 35 additions & 0 deletions
35
Unity/Assets/JCMG/PackageTools/Scripts/Editor/Drawers/PublishConfigPropertyDrawer.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
using UnityEditor; | ||
using UnityEngine; | ||
|
||
namespace JCMG.PackageTools.Editor | ||
{ | ||
/// <summary> | ||
/// A custom property drawer for <see cref="PackageManifestConfig.PublishConfig"/>. | ||
/// </summary> | ||
[CustomPropertyDrawer(typeof(PackageManifestConfig.PublishConfig))] | ||
internal sealed class PublishConfigPropertyDrawer : PropertyDrawer | ||
{ | ||
private const string PUBLISH_CONFIG_REGISTRY_PROPERTY_NAME = "registry"; | ||
|
||
public override void OnGUI(Rect position, SerializedProperty property, GUIContent label) | ||
{ | ||
var titleRect = new Rect(position) | ||
{ | ||
height = EditorGUIUtility.singleLineHeight | ||
}; | ||
|
||
var registryRect = new Rect(titleRect) | ||
{ | ||
position = new Vector2(position.x, titleRect.y + titleRect.height) | ||
}; | ||
|
||
EditorGUI.LabelField(titleRect, nameof(PackageManifestConfig.PublishConfig), EditorStyles.boldLabel); | ||
EditorGUI.PropertyField(registryRect, property.FindPropertyRelative(PUBLISH_CONFIG_REGISTRY_PROPERTY_NAME)); | ||
} | ||
|
||
public override float GetPropertyHeight(SerializedProperty property, GUIContent label) | ||
{ | ||
return EditorGUIUtility.singleLineHeight * 2f; | ||
} | ||
} | ||
} |
3 changes: 3 additions & 0 deletions
3
Unity/Assets/JCMG/PackageTools/Scripts/Editor/Drawers/PublishConfigPropertyDrawer.cs.meta
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
49 changes: 49 additions & 0 deletions
49
Unity/Assets/JCMG/PackageTools/Scripts/Editor/Drawers/RepositoryPropertyDrawer.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
using UnityEditor; | ||
using UnityEngine; | ||
|
||
namespace JCMG.PackageTools.Editor | ||
{ | ||
/// <summary> | ||
/// A property drawer for <see cref="PackageManifestConfig.Repository"/>. | ||
/// </summary> | ||
[CustomPropertyDrawer(typeof(PackageManifestConfig.Repository))] | ||
internal sealed class RepositoryPropertyDrawer : PropertyDrawer | ||
{ | ||
private const string REPOSITORY_TYPE_PROPERTY_NAME = "type"; | ||
private const string REPOSITORY_URL_PROPERTY_NAME = "url"; | ||
private const string REPOSITORY_DIRECTORY_PROPERTY_NAME = "directory"; | ||
|
||
public override void OnGUI(Rect position, SerializedProperty property, GUIContent label) | ||
{ | ||
var titleRect = new Rect(position) | ||
{ | ||
height = EditorGUIUtility.singleLineHeight | ||
}; | ||
|
||
var typeRect = new Rect(titleRect) | ||
{ | ||
position = new Vector2(position.x, titleRect.y + titleRect.height) | ||
}; | ||
|
||
var urlRect = new Rect(typeRect) | ||
{ | ||
position = new Vector2(position.x, typeRect.y + typeRect.height) | ||
}; | ||
|
||
var directoryRect = new Rect(typeRect) | ||
{ | ||
position = new Vector2(position.x, urlRect.y + urlRect.height) | ||
}; | ||
|
||
EditorGUI.LabelField(titleRect, nameof(PackageManifestConfig.Repository), EditorStyles.boldLabel); | ||
EditorGUI.PropertyField(typeRect, property.FindPropertyRelative(REPOSITORY_TYPE_PROPERTY_NAME)); | ||
EditorGUI.PropertyField(urlRect, property.FindPropertyRelative(REPOSITORY_URL_PROPERTY_NAME)); | ||
EditorGUI.PropertyField(directoryRect, property.FindPropertyRelative(REPOSITORY_DIRECTORY_PROPERTY_NAME)); | ||
} | ||
|
||
public override float GetPropertyHeight(SerializedProperty property, GUIContent label) | ||
{ | ||
return EditorGUIUtility.singleLineHeight * 4f; | ||
} | ||
} | ||
} |
3 changes: 3 additions & 0 deletions
3
Unity/Assets/JCMG/PackageTools/Scripts/Editor/Drawers/RepositoryPropertyDrawer.cs.meta
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
Unity/Assets/PackageManifests/Generated/cb87cda2-0bfa-44dc-b583-ae61ff81efcb/package.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
{"name":"com.jeffcampbellmakesgames.packagetools","displayName":"JCMG Package Tools","version":"1.3.2","unity":"2019.4","description":"Contains a set of Unity development tools to help support exporting and/or updating package contents. \n\nFor more information, see https://github.com/jeffcampbellmakesgames/unity-package-tools for more information.","keywords":["package","package manager"],"category":"Tools","author":{ "name":"Jeff Campbell", "email":"[email protected]", "url":"https://github.com/jeffcampbellmakesgames"}} | ||
{"name":"com.jeffcampbellmakesgames.packagetools","displayName":"JCMG Package Tools","version":"1.6.0","unity":"2019.4","description":"Contains a set of Unity development tools to help support exporting and/or updating package contents. \n\nFor more information, see https://github.com/jeffcampbellmakesgames/unity-package-tools for more information.","keywords":["package","package manager"],"category":"Tools","author":{ "name":"Jeff Campbell", "email":"[email protected]", "url":"https://github.com/jeffcampbellmakesgames"},"publishConfig":{ "registry":"https://npm.pkg.github.com/@jcampbell"},"repository":{ "type":"git", "url":"https://github.com/jeffcampbellmakesgames/unity-package-tools", "directory":""}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,9 @@ | ||
{ | ||
"dependencies": { | ||
"com.unity.ide.rider": "1.1.4", | ||
"com.unity.ide.vscode": "1.2.3", | ||
"com.unity.test-framework": "1.1.18", | ||
"com.unity.ide.rider": "3.0.34", | ||
"com.unity.ide.visualstudio": "2.0.22", | ||
"com.unity.test-framework": "1.4.5", | ||
"com.unity.modules.accessibility": "1.0.0", | ||
"com.unity.modules.jsonserialize": "1.0.0" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.