修改细节

This commit is contained in:
Caiyanpeng committed 2021-04-25 13:35:07 +08:00
1 parent a96d538dc1
commit 048538a0c8
78 files changed
+15285 -6903

No files matched your search

+11 -2
View File
@@ -10,7 +10,7 @@ using UnityEngine.Events;
namespace Assets.Scripts.UI.Control
{
public class PFUIDropdown : PFUIComponentBase
public class PFUIDropdown : PFUIComponentBase,IPointerClickHandler
{
private int mSelectedIndex = 0;
public int SelectedIndex
@@ -64,7 +64,8 @@ namespace Assets.Scripts.UI.Control
//this.mSelectedIndex =
//UIManager.AddEvent(this.transform.GetComponent<Image>().gameObject, EventTriggerType.Select, new UnityEngine.Events.UnityAction<BaseEventData>(OnSelect));
//UIManager.AddEvent(this.transform.GetComponent<Image>().gameObject, EventTriggerType.Deselect, new UnityEngine.Events.UnityAction<BaseEventData>(OnDeselect));
//this.GetComponent<Dropdown>().itemText.color = Utils.HexToColorHtml("#ff2742");
this.GetComponent<Dropdown>().onValueChanged.AddListener(i => {
mSelectedIndex = i;
if (OnValueChange != null)
@@ -72,6 +73,7 @@ namespace Assets.Scripts.UI.Control
mOnValueChange(i);
}
outline.enabled = false;
});
outline = transform.GetComponent<Outline>();
}
@@ -131,5 +133,12 @@ namespace Assets.Scripts.UI.Control
}
}
}
public void OnPointerClick(PointerEventData eventData)
{
if (GetComponent<Dropdown>().value == -1) return;
var x = transform.Find("Dropdown List").GetComponent<ScrollRect>().content;
x.GetChild(SelectedIndex + 1).Find("Item Label").GetComponent<Text>().color = Utils.HexToColorHtml("#f93086");
}
}
}
+1 -1
View File
@@ -124,7 +124,7 @@ namespace Assets.Scripts.UI.Control
outline.enabled = true;
outline.effectColor = Utils.HexToColorHtml("#F93086");
ColorUtility.TryParseHtmlString("#F93086", out Color color);
this.mInnerInputField.transform.Find("Text").GetComponent<Text>().color = color;
//this.mInnerInputField.transform.Find("Text").GetComponent<Text>().color = color;
}
else
{