完成大地图主要界面

This commit is contained in:
suntao committed 2021-04-15 09:01:07 +08:00
1 parent 5156473bb2
commit d22eecd133
78 files changed
+8684 -6941

No files matched your search

@@ -0,0 +1,32 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using UnityEngine;
using UnityEngine.UI;
namespace Assets.Scripts.UI.Control
{
[RequireComponent(typeof(Button))]
public class PFUIRoundButton : PFUIComponentBase
{
private Image image;
private Text text;
protected void Awake()
{
image = gameObject.GetComponent<Image>();
text = this.transform.Find("Text").GetComponent<Text>();
Material material = null;
if (material == null)
{
material = Instantiate(Resources.Load<Material>("UI/Material/RoundedCornersTextureMaterial"));
}
var rect = ((RectTransform)transform).rect;
material.SetVector(Shader.PropertyToID("_WidthHeightRadius"), new Vector4(rect.width, rect.height, rect.height * 0.5f, 0));
image.material = material;
}
}
}
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 9a96e12724c645a498af7c9434c9170f
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
+4 -1
View File
@@ -21,9 +21,10 @@ namespace Assets.Scripts.UI.Control
[SerializeField] Type mType;
private Image image;
private Text text;
public Text text;
private Texture2D cursor;
private Outline outline;
protected void Awake()
{
outline = this.GetComponent<Outline>();
@@ -65,6 +66,8 @@ namespace Assets.Scripts.UI.Control
case Type.Border:
{
outline.enabled = true;
outline.effectColor = ConvertColor("#474759");
image.color = ConvertColor("#3D3E4D");
}
break;