Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove event trigger component and check mouseposition and manually c… #6215

Merged
merged 1 commit into from
Oct 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -4652,7 +4652,6 @@ GameObject:
- component: {fileID: 8345192229530743519}
- component: {fileID: 2201705437051731774}
- component: {fileID: 3367752127855427622}
- component: {fileID: 9979499077861398}
m_Layer: 5
m_Name: Detail
m_TagString: Untagged
Expand Down Expand Up @@ -4823,51 +4822,6 @@ MonoBehaviour:
- {fileID: 0}
- {fileID: 0}
skillTooltip: {fileID: 0}
--- !u!114 &9979499077861398
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3367752127855427621}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: d0b148fe25e99eb48b9724523833bab1, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Delegates:
- eventID: 0
callback:
m_PersistentCalls:
m_Calls:
- m_Target: {fileID: 4693993570970967307}
m_TargetAssemblyTypeName: Nekoyume.UI.FungibleAssetTooltip, Nekoyume
m_MethodName: OnEnterButtonArea
m_Mode: 6
m_Arguments:
m_ObjectArgument: {fileID: 0}
m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine
m_IntArgument: 0
m_FloatArgument: 0
m_StringArgument:
m_BoolArgument: 1
m_CallState: 2
- eventID: 1
callback:
m_PersistentCalls:
m_Calls:
- m_Target: {fileID: 4693993570970967307}
m_TargetAssemblyTypeName: Nekoyume.UI.FungibleAssetTooltip, Nekoyume
m_MethodName: OnEnterButtonArea
m_Mode: 6
m_Arguments:
m_ObjectArgument: {fileID: 0}
m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine
m_IntArgument: 0
m_FloatArgument: 0
m_StringArgument:
m_BoolArgument: 0
m_CallState: 2
--- !u!1 &3551271071411875570
GameObject:
m_ObjectHideFlags: 0
Expand Down
26 changes: 2 additions & 24 deletions nekoyume/Assets/Resources/UI/Prefabs/UI_ItemTooltip.prefab
Original file line number Diff line number Diff line change
Expand Up @@ -26235,7 +26235,6 @@ GameObject:
- component: {fileID: 3896249707496191288}
- component: {fileID: 6578722246314146009}
- component: {fileID: 7745908641049577409}
- component: {fileID: 4009962878873633376}
m_Layer: 5
m_Name: Detail
m_TagString: Untagged
Expand Down Expand Up @@ -26410,27 +26409,6 @@ MonoBehaviour:
- {fileID: 8388860368712792571}
- {fileID: 602040730996652373}
skillTooltip: {fileID: 2807283668600384627}
--- !u!114 &4009962878873633376
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 7745908641049577410}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: d0b148fe25e99eb48b9724523833bab1, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Delegates:
- eventID: 0
callback:
m_PersistentCalls:
m_Calls: []
- eventID: 1
callback:
m_PersistentCalls:
m_Calls: []
--- !u!1 &7810504448802739411
GameObject:
m_ObjectHideFlags: 0
Expand Down Expand Up @@ -32875,8 +32853,8 @@ MonoBehaviour:
m_TargetGraphic: {fileID: 1691207599003355518}
m_HandleRect: {fileID: 4119769666421683849}
m_Direction: 2
m_Value: 1.0000001
m_Size: 0.42389327
m_Value: 1.0000004
m_Size: 0.4238933
m_NumberOfSteps: 0
m_OnValueChanged:
m_PersistentCalls:
Expand Down
48 changes: 1 addition & 47 deletions nekoyume/Assets/Resources/UI/Prefabs/UI_RuneTooltip.prefab
Original file line number Diff line number Diff line change
Expand Up @@ -18112,7 +18112,6 @@ GameObject:
- component: {fileID: 809503376454329747}
- component: {fileID: 4488528141123949981}
- component: {fileID: 5986524016789002364}
- component: {fileID: 57876145140963390}
m_Layer: 5
m_Name: Detail
m_TagString: Untagged
Expand Down Expand Up @@ -18220,51 +18219,6 @@ MonoBehaviour:
m_EditorClassIdentifier:
m_HorizontalFit: 0
m_VerticalFit: 2
--- !u!114 &57876145140963390
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 7144618008289060711}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: d0b148fe25e99eb48b9724523833bab1, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Delegates:
- eventID: 0
callback:
m_PersistentCalls:
m_Calls:
- m_Target: {fileID: 836228864728598928}
m_TargetAssemblyTypeName: Nekoyume.UI.RuneTooltip, Nekoyume
m_MethodName: OnEnterButtonArea
m_Mode: 6
m_Arguments:
m_ObjectArgument: {fileID: 0}
m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine
m_IntArgument: 0
m_FloatArgument: 0
m_StringArgument:
m_BoolArgument: 1
m_CallState: 2
- eventID: 1
callback:
m_PersistentCalls:
m_Calls:
- m_Target: {fileID: 836228864728598928}
m_TargetAssemblyTypeName: Nekoyume.UI.RuneTooltip, Nekoyume
m_MethodName: OnEnterButtonArea
m_Mode: 6
m_Arguments:
m_ObjectArgument: {fileID: 0}
m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine
m_IntArgument: 0
m_FloatArgument: 0
m_StringArgument:
m_BoolArgument: 0
m_CallState: 2
--- !u!1 &7153467487710132124
GameObject:
m_ObjectHideFlags: 0
Expand Down Expand Up @@ -20965,7 +20919,7 @@ MonoBehaviour:
m_HandleRect: {fileID: 3563590063448151596}
m_Direction: 2
m_Value: 0.99999976
m_Size: 0.68664783
m_Size: 0.6866479
m_NumberOfSteps: 0
m_OnValueChanged:
m_PersistentCalls:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,8 @@ protected IEnumerator CoUpdate(GameObject target)
{
if (Input.GetMouseButtonDown(0))
{
_isClickedTooltipArea = _isPointerOnTooltipArea;
UnityEngine.Vector2 mousePos = Input.mousePosition;
_isClickedTooltipArea = RectTransformUtility.RectangleContainsScreenPoint(panel, mousePos, MainCanvas.instance.Canvas.worldCamera) || _isPointerOnTooltipArea;
}

var current = TouchHandler.currentSelectedGameObject;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,7 @@ protected IEnumerator CoUpdate(GameObject target)
if (Input.GetMouseButtonDown(0))
{
UnityEngine.Vector2 mousePos = Input.mousePosition;
_isClickedTooltipArea = RectTransformUtility.RectangleContainsScreenPoint(panel, mousePos, MainCanvas.instance.Canvas.worldCamera);
_isClickedTooltipArea = RectTransformUtility.RectangleContainsScreenPoint(panel, mousePos, MainCanvas.instance.Canvas.worldCamera) || _isPointerOnTooltipArea;
}

var current = TouchHandler.currentSelectedGameObject;
Expand Down
19 changes: 9 additions & 10 deletions nekoyume/Assets/_Scripts/UI/Widget/Tooltip/RuneTooltip.cs
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,8 @@ public class RuneTooltip : NewVerticalTooltipWidget
private System.Action _onEnhancement;
private System.Action _onClose;

private bool _isPointerOnScrollArea;
private bool _isClickedButtonArea;
private bool _isPointerOnTooltipArea;
private bool _isClickedTooltipArea;

protected override PivotPresetType TargetPivotPresetType => PivotPresetType.TopRight;

Expand Down Expand Up @@ -128,8 +128,8 @@ protected override void Awake()
public override void Close(bool ignoreCloseAnimation = false)
{
_onClose?.Invoke();
_isPointerOnScrollArea = false;
_isClickedButtonArea = false;
_isPointerOnTooltipArea = false;
_isClickedTooltipArea = false;
base.Close(ignoreCloseAnimation);
}

Expand Down Expand Up @@ -354,13 +354,12 @@ protected IEnumerator CoUpdate(GameObject target)
yield return null;
}

var positionCache = selectedGameObjectCache.transform.position;

while (enabled)
{
if (Input.GetMouseButtonDown(0))
{
_isClickedButtonArea = _isPointerOnScrollArea;
UnityEngine.Vector2 mousePos = Input.mousePosition;
_isClickedTooltipArea = RectTransformUtility.RectangleContainsScreenPoint(panel, mousePos, MainCanvas.instance.Canvas.worldCamera) || _isPointerOnTooltipArea;
}

var current = TouchHandler.currentSelectedGameObject;
Expand All @@ -373,7 +372,7 @@ protected IEnumerator CoUpdate(GameObject target)
continue;
}

if (!_isClickedButtonArea)
if (!_isClickedTooltipArea)
{
Close();
yield break;
Expand All @@ -386,7 +385,7 @@ protected IEnumerator CoUpdate(GameObject target)
yield break;
}

if (!_isClickedButtonArea)
if (!_isClickedTooltipArea)
{
Close();
yield break;
Expand All @@ -399,7 +398,7 @@ protected IEnumerator CoUpdate(GameObject target)

public void OnEnterButtonArea(bool value)
{
_isPointerOnScrollArea = value;
_isPointerOnTooltipArea = value;
}
}
}
Loading