修改细节
This commit is contained in:
1 parent
a96d538dc1
commit
048538a0c8
78 files changed
+15285
-6903
No files matched your search
@@ -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");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user