Add networked Fighter3D minigame
This commit is contained in:
@@ -527,7 +527,23 @@ namespace XGame.EditorTools
|
||||
string spriteName = (string)comp["sprite"];
|
||||
Sprite sprite = ResolveSprite(spriteName, fileName);
|
||||
img.sprite = sprite;
|
||||
img.type = string.Equals((string)comp["imageType"], "Sliced", StringComparison.OrdinalIgnoreCase) ? Image.Type.Sliced : Image.Type.Simple;
|
||||
string imageType = (string)comp["imageType"];
|
||||
if (string.Equals(imageType, "Sliced", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
img.type = Image.Type.Sliced;
|
||||
}
|
||||
else if (string.Equals(imageType, "Filled", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
img.type = Image.Type.Filled;
|
||||
img.fillMethod = ParseFillMethod((string)comp["fillMethod"]);
|
||||
img.fillOrigin = 0;
|
||||
img.fillClockwise = true;
|
||||
img.fillAmount = comp["fillAmount"] != null ? Mathf.Clamp01((float)comp["fillAmount"]) : 1f;
|
||||
}
|
||||
else
|
||||
{
|
||||
img.type = Image.Type.Simple;
|
||||
}
|
||||
if (comp["preserveAspect"] != null) img.preserveAspect = (bool)comp["preserveAspect"];
|
||||
img.raycastTarget = comp["raycastTarget"] == null || (bool)comp["raycastTarget"];
|
||||
img.color = ParseColor((string)comp["color"], Color.white);
|
||||
@@ -932,6 +948,20 @@ namespace XGame.EditorTools
|
||||
}
|
||||
}
|
||||
|
||||
private static Image.FillMethod ParseFillMethod(string method)
|
||||
{
|
||||
switch (method)
|
||||
{
|
||||
case "Vertical": return Image.FillMethod.Vertical;
|
||||
case "Radial90": return Image.FillMethod.Radial90;
|
||||
case "Radial180": return Image.FillMethod.Radial180;
|
||||
case "Radial360": return Image.FillMethod.Radial360;
|
||||
case "Horizontal":
|
||||
default:
|
||||
return Image.FillMethod.Horizontal;
|
||||
}
|
||||
}
|
||||
|
||||
private static TMP_InputField.ContentType ParseInputContentType(string contentType)
|
||||
{
|
||||
switch (contentType)
|
||||
|
||||
Reference in New Issue
Block a user