提交 95812b3a 编写于 作者: 魔术师Dix's avatar 魔术师Dix

【UpmGitTool】更新版本选择逻辑,更新界面显示;

上级 116d2052
......@@ -38,8 +38,8 @@ RectTransform:
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 0, y: 0}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 180, y: 50}
m_AnchoredPosition: {x: 60.8006, y: 0}
m_SizeDelta: {x: 301.6012, y: 50}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &4992096307994095352
CanvasRenderer:
......@@ -100,7 +100,6 @@ MonoBehaviour:
m_MinimumUnityVersion:
m_DisplayName:
m_Description:
m_PackageUniqueId:
m_Name:
m_PackageId:
m_Author:
......@@ -108,6 +107,8 @@ MonoBehaviour:
m_Dependencies: []
m_DocumentationUrl:
m_ChangelogUrl:
m_RepositoryUrl:
m_Url:
SelectedColor: {r: 1, g: 1, b: 1, a: 1}
UnSelectedColor: {r: 0, g: 0.5019608, b: 1, a: 1}
--- !u!1 &4992096308915946629
......@@ -221,8 +222,8 @@ RectTransform:
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0.5}
m_AnchorMax: {x: 1, y: 0.5}
m_AnchoredPosition: {x: -22.5, y: 0}
m_SizeDelta: {x: -55, y: 50}
m_AnchoredPosition: {x: -17.3552, y: 0}
m_SizeDelta: {x: -65.2897, y: 50}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &4992096309375970350
CanvasRenderer:
......@@ -252,7 +253,7 @@ MonoBehaviour:
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_text: 999.999.999
m_text: 2.2.4 (UpmGitExtension)
m_isRightToLeft: 0
m_fontAsset: {fileID: 11400000, guid: 6713738f712c7ac459acc1cd37b85c45, type: 2}
m_sharedMaterial: {fileID: -953019786661498290, guid: 6713738f712c7ac459acc1cd37b85c45, type: 2}
......
......@@ -769,8 +769,8 @@ RectTransform:
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5}
m_AnchoredPosition: {x: 128.54, y: -110.36197}
m_SizeDelta: {x: 1184.5, y: 197.48}
m_AnchoredPosition: {x: 178.54, y: -110.36197}
m_SizeDelta: {x: 1084.5, y: 197.48}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &139229363
MonoBehaviour:
......@@ -1070,7 +1070,7 @@ RectTransform:
m_RootOrder: -1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 1, y: 1}
m_AnchorMax: {x: 0, y: 0}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 20, y: 20}
m_Pivot: {x: 0.5, y: 0.5}
......@@ -1488,8 +1488,8 @@ RectTransform:
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5}
m_AnchoredPosition: {x: -608.67, y: -46.004}
m_SizeDelta: {x: 199.84, y: 451.04}
m_AnchoredPosition: {x: -543.24023, y: -46.005}
m_SizeDelta: {x: 322.14, y: 451.04}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &297420589
MonoBehaviour:
......@@ -2071,7 +2071,7 @@ GameObject:
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
m_IsActive: 0
--- !u!224 &336766289
RectTransform:
m_ObjectHideFlags: 0
......@@ -2950,9 +2950,9 @@ RectTransform:
m_RootOrder: -1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 1, y: 1}
m_AnchorMax: {x: 0, y: 0}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: -17, y: 0}
m_SizeDelta: {x: 0, y: 0}
m_Pivot: {x: 0, y: 1}
--- !u!114 &482842297
MonoBehaviour:
......@@ -5885,8 +5885,8 @@ RectTransform:
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 1}
m_AnchorMax: {x: 0.5, y: 1}
m_AnchoredPosition: {x: -91, y: 0.00063440285}
m_SizeDelta: {x: 182, y: 383.99}
m_AnchoredPosition: {x: -152.56996, y: 0}
m_SizeDelta: {x: 305.14, y: 400.68}
m_Pivot: {x: 0, y: 1}
--- !u!114 &1245554590
MonoBehaviour:
......@@ -5908,7 +5908,7 @@ MonoBehaviour:
m_ChildAlignment: 1
m_StartCorner: 0
m_StartAxis: 0
m_CellSize: {x: 175, y: 80}
m_CellSize: {x: 300, y: 50}
m_Spacing: {x: 5, y: 5}
m_Constraint: 0
m_ConstraintCount: 2
......@@ -6363,7 +6363,7 @@ RectTransform:
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5}
m_AnchoredPosition: {x: -115, y: 31.517998}
m_AnchoredPosition: {x: -14.999992, y: 31.517998}
m_SizeDelta: {x: 697.41, y: 58.53}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &1326478349
......@@ -7184,8 +7184,8 @@ RectTransform:
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5}
m_AnchoredPosition: {x: 153.12999, y: 133.518}
m_SizeDelta: {x: 962.06, y: 58.53}
m_AnchoredPosition: {x: 202.05, y: 133.518}
m_SizeDelta: {x: 864.21, y: 58.53}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &1519007851
MonoBehaviour:
......@@ -7477,7 +7477,7 @@ GameObject:
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 0
m_IsActive: 1
--- !u!224 &1652132970
RectTransform:
m_ObjectHideFlags: 0
......@@ -7525,7 +7525,7 @@ GameObject:
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 0
m_IsActive: 1
--- !u!224 &1662431187
RectTransform:
m_ObjectHideFlags: 0
......@@ -8708,7 +8708,7 @@ RectTransform:
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5}
m_AnchoredPosition: {x: -397, y: 133.518}
m_AnchoredPosition: {x: -297, y: 133.518}
m_SizeDelta: {x: 133.89, y: 58.53}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &1816679593
......
......@@ -257,5 +257,10 @@ namespace UpmGitTool
return value.Substring(startIndex, num);
}
public string GetShortName()
{
return $"{Major}.{Minor}.{Patch}";
}
}
}
\ No newline at end of file
......@@ -51,13 +51,6 @@ namespace UpmGitTool
[ShowInInspector, DisplayAsString, LabelText("已安装")]
public bool IsInstalled { get; private set; }
/// <summary>
/// 已安装的包版本号;
/// </summary>
[LabelWidth(LabelWidth)]
[ShowInInspector, DisplayAsString, LabelText("已安装版本")]
public string InstalledVersionString { get; private set; }
/// <summary>
/// 已安装包的ID;
/// </summary>
......@@ -65,6 +58,10 @@ namespace UpmGitTool
[ShowInInspector, DisplayAsString, LabelText("已安装包ID")]
public string InstallPackageId { get; private set; }
[LabelWidth(LabelWidth)]
[ShowInInspector, DisplayAsString, LabelText("已安装版本")]
public string InstallVersionString { get; private set; }
/// <summary>
/// 是否可以升级
/// </summary>
......@@ -89,8 +86,8 @@ namespace UpmGitTool
IsInstalled = true;
InstallPackageId = item.PackageId;
IsGit = item.IsGitUrl;
InstalledVersionString = item.PackageUrl;
PackageUrl = item.PackageUrl;
InstallVersionString = item.PackageUrl;
RefreshInstalledVersion();
}
......@@ -143,7 +140,7 @@ namespace UpmGitTool
if (ver.PackageId == InstallPackageId)
{
InstallVersion = ver;
InstalledVersionString = ver.VersionString;
InstallVersionString = ver.VersionString;
break;
}
}
......
......@@ -9,6 +9,7 @@
using Sirenix.OdinInspector;
using System;
using Unity.VisualScripting;
using UnityEngine;
using UpmGitTool.UI;
......@@ -85,8 +86,8 @@ namespace UpmGitTool
public string Name => m_Name;
public string PackageId => m_PackageId;
public string Author => m_Author;
public string VersionString => m_VersionString;
public SemVersion? Version { get; private set; }
public string VersionString { get; private set; }
public SemVersion Version { get; private set; }
public DependencyInfo[] Dependencies => m_Dependencies;
public string DocumentationUrl => m_DocumentationUrl;
public string ChangelogUrl => m_ChangelogUrl;
......@@ -97,6 +98,12 @@ namespace UpmGitTool
public void OnAfterDeserialize()
{
Version = SemVersion.Parse(m_VersionString);
string semver = Version.GetShortName();
string revision = refName;
VersionString = revision.Contains(semver)
? $"{semver}"
: $"{semver} ({revision})";
}
}
......
......@@ -75,7 +75,7 @@ namespace UpmGitTool.UI
Logger.Log($"设置显示:{package.PackageName}");
LabelName.SetText(package.PackageName);
LabelVersion.gameObject.SetActive(package.IsInstalled);
if (package.IsInstalled) LabelVersion.SetText(package.InstalledVersionString);
if (package.IsInstalled) LabelVersion.SetText(package.InstallVersionString);
if (!package.IsGit)
{
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册