PC点击区域&PFbutton微调

This commit is contained in:
lishuo 2022-01-25 11:17:42 +08:00
parent 5340d3d58b
commit 37873427e3
2 changed files with 106 additions and 27 deletions

View File

@ -30,7 +30,7 @@ RectTransform:
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 189965521107699628}
m_RootOrder: 1
m_RootOrder: 2
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0.5}
m_AnchorMax: {x: 1, y: 0.5}
@ -74,6 +74,80 @@ MonoBehaviour:
m_FillOrigin: 0
m_UseSpriteMesh: 0
m_PixelsPerUnitMultiplier: 1
--- !u!1 &5083574894189849385
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 2937272512562187578}
- component: {fileID: 721626668066490155}
- component: {fileID: 2932644569775562883}
m_Layer: 5
m_Name: Panel
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &2937272512562187578
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 5083574894189849385}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 189965521107699628}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 1, y: 1}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 0, y: 0}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &721626668066490155
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 5083574894189849385}
m_CullTransparentMesh: 0
--- !u!114 &2932644569775562883
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 5083574894189849385}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 1, g: 1, b: 1, a: 0}
m_RaycastTarget: 1
m_Maskable: 1
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_Sprite: {fileID: 10907, guid: 0000000000000000f000000000000000, type: 0}
m_Type: 1
m_PreserveAspect: 0
m_FillCenter: 1
m_FillMethod: 4
m_FillAmount: 1
m_FillClockwise: 1
m_FillOrigin: 0
m_UseSpriteMesh: 0
m_PixelsPerUnitMultiplier: 1
--- !u!1 &5362620512280803541
GameObject:
m_ObjectHideFlags: 0
@ -102,6 +176,7 @@ RectTransform:
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children:
- {fileID: 2937272512562187578}
- {fileID: 4347642619387382541}
- {fileID: 5333104648953487716}
- {fileID: 6514089965287851756}
@ -153,7 +228,7 @@ MonoBehaviour:
m_SelectedTrigger: Selected
m_DisabledTrigger: Disabled
m_Interactable: 1
m_TargetGraphic: {fileID: 0}
m_TargetGraphic: {fileID: 2932644569775562883}
--- !u!1 &6092777681612193971
GameObject:
m_ObjectHideFlags: 0
@ -184,7 +259,7 @@ RectTransform:
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 189965521107699628}
m_RootOrder: 2
m_RootOrder: 3
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0.5}
m_AnchorMax: {x: 0, y: 0.5}
@ -259,7 +334,7 @@ RectTransform:
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 189965521107699628}
m_RootOrder: 0
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 1}
m_AnchorMax: {x: 0, y: 1}
@ -350,7 +425,7 @@ RectTransform:
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 189965521107699628}
m_RootOrder: 3
m_RootOrder: 4
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 1, y: 0.5}
m_AnchorMax: {x: 1, y: 0.5}

View File

@ -136,7 +136,7 @@ namespace Assets.Scripts.UI.Control
{
Debug.Log(131);
timer.Stop();
group.DOFade(1, 1f);
};
//鼠标进入
@ -151,26 +151,28 @@ namespace Assets.Scripts.UI.Control
if (!string.IsNullOrWhiteSpace(Tooltips) && showTooltip)
{
#endif
//tooltips.SetActive(true);
//tooltips.GetComponent<CanvasGroup>().DOFade(1, 0.5f);
//tooltips.GetComponent<CanvasGroup>().DOFade(1, 0.5f);
//DOTween.CompleteAll(true);
se = DOTween.Sequence();
se.SetDelay(1);
se.AppendCallback(() =>
{
if(a!=null) a.Complete(true);
if (b != null) b.Complete(true);
tooltips.SetActive(true);
tooltips.GetComponent<CanvasGroup>().alpha = 0f;
c = tooltips.GetComponent<CanvasGroup>().DOFade(1, 0.5f);
});
a = se.Play();
//se = DOTween.Sequence();
//se.SetDelay(1);
//se.AppendCallback(() =>
//{
// if(a!=null) a.Complete(true);
// if (b != null) b.Complete(true);
// tooltips.SetActive(true);
// tooltips.GetComponent<CanvasGroup>().alpha = 0f;
// c = tooltips.GetComponent<CanvasGroup>().DOFade(1, 0.5f);
//});
//a = se.Play();
tooltips.SetActive(true);
tooltips.GetComponent<CanvasGroup>().alpha = 0f;
//StartCoroutine(DelayShowTooltip());
//timer.Start();
timer.Start();
}
switch (mType)
{
@ -207,10 +209,7 @@ namespace Assets.Scripts.UI.Control
if (!string.IsNullOrWhiteSpace(Tooltips) && showTooltip)
{
#endif
if (a != null) a.Complete(true);
if (c != null) c.Complete(true);
b = group.DOFade(0, 1f);
b.onComplete += () => {
group.DOFade(0, 1f).onComplete += () => {
tooltips.SetActive(false);
};
}
@ -242,9 +241,9 @@ namespace Assets.Scripts.UI.Control
UIManager.AddEvent(this.gameObject, EventTriggerType.PointerDown, new UnityEngine.Events.UnityAction<BaseEventData>(e =>
{
if (!this.isActiveAndEnabled) return;
if (a != null) a.Complete(true);
if (b != null) b.Complete(true);
if (c != null) c.Complete(true);
//if (a != null) a.Complete(true);
//if (b != null) b.Complete(true);
//if (c != null) c.Complete(true);
tooltips.SetActive(false);
//else
@ -273,6 +272,11 @@ namespace Assets.Scripts.UI.Control
image.color = ConvertColor("#BD2255");
}
break;
case Type.Image:
{
tooltips.SetActive(tooltips.activeSelf);
}
break;
default:
break;
}
@ -304,7 +308,7 @@ namespace Assets.Scripts.UI.Control
break;
case Type.Image:
{
//tooltips.SetActive(false);
tooltips.SetActive(false);
}
break;
default: