Actions menu imp. Still buggy at first render

This commit is contained in:
Vladimir Koshevarov
2023-03-02 19:13:11 +02:00
parent 2337bc1423
commit 62df90bb52
4 changed files with 126 additions and 33 deletions
+43 -1
View File
@@ -189,7 +189,7 @@ RectTransform:
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 1}
m_AnchorMax: {x: 0, y: 1}
m_AnchoredPosition: {x: 21.18, y: -16.175}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 0, y: 0}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &3806516703338386379
@@ -295,6 +295,8 @@ GameObject:
m_Component:
- component: {fileID: 3806516704876462308}
- component: {fileID: 3806516704876462311}
- component: {fileID: 1802365138314071189}
- component: {fileID: 5994351503485557941}
m_Layer: 5
m_Name: button
m_TagString: Untagged
@@ -367,3 +369,43 @@ MonoBehaviour:
m_OnClick:
m_PersistentCalls:
m_Calls: []
--- !u!114 &1802365138314071189
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3806516704876462309}
m_Enabled: 0
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 30649d3a9faa99c48a7b1166b86bf2a0, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Padding:
m_Left: 0
m_Right: 0
m_Top: 0
m_Bottom: 0
m_ChildAlignment: 4
m_Spacing: 0
m_ChildForceExpandWidth: 1
m_ChildForceExpandHeight: 1
m_ChildControlWidth: 0
m_ChildControlHeight: 0
m_ChildScaleWidth: 0
m_ChildScaleHeight: 0
m_ReverseArrangement: 0
--- !u!114 &5994351503485557941
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3806516704876462309}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 3245ec927659c4140ac4f8d17403cc18, type: 3}
m_Name:
m_EditorClassIdentifier:
m_HorizontalFit: 2
m_VerticalFit: 2
+79 -27
View File
@@ -1314,8 +1314,8 @@ RectTransform:
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 0, y: 0}
m_AnchoredPosition: {x: 178.375, y: 0}
m_SizeDelta: {x: 356.75, y: 40}
m_AnchoredPosition: {x: 182.005, y: 0}
m_SizeDelta: {x: 364.01, y: 40}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &441502268
MonoBehaviour:
@@ -1431,7 +1431,7 @@ RectTransform:
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 0, y: 0}
m_AnchoredPosition: {x: 178.375, y: 0}
m_AnchoredPosition: {x: 182.005, y: 0}
m_SizeDelta: {x: 0, y: 0}
m_Pivot: {x: 0.5, y: 0}
--- !u!114 &449118217
@@ -2248,8 +2248,10 @@ GameObject:
serializedVersion: 6
m_Component:
- component: {fileID: 771379431}
- component: {fileID: 771379433}
- component: {fileID: 771379432}
m_Layer: 5
m_Name: GameObject
m_Name: Actions
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
@@ -2273,9 +2275,49 @@ RectTransform:
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 0, y: 0}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 356.75, y: 122.8473}
m_AnchoredPosition: {x: 182.005, y: 0}
m_SizeDelta: {x: 364.01, y: 43.8164}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &771379432
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 771379430}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 3245ec927659c4140ac4f8d17403cc18, type: 3}
m_Name:
m_EditorClassIdentifier:
m_HorizontalFit: 0
m_VerticalFit: 0
--- !u!114 &771379433
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 771379430}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 59f8146938fff824cb5fd77236b75775, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Padding:
m_Left: 0
m_Right: 0
m_Top: 0
m_Bottom: 0
m_ChildAlignment: 4
m_Spacing: 0
m_ChildForceExpandWidth: 1
m_ChildForceExpandHeight: 1
m_ChildControlWidth: 0
m_ChildControlHeight: 1
m_ChildScaleWidth: 0
m_ChildScaleHeight: 0
m_ReverseArrangement: 0
--- !u!1 &776525075
GameObject:
m_ObjectHideFlags: 0
@@ -2561,8 +2603,8 @@ RectTransform:
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 0, y: 0}
m_AnchoredPosition: {x: 178.375, y: 0}
m_SizeDelta: {x: 0, y: 0}
m_AnchoredPosition: {x: 182.005, y: 0}
m_SizeDelta: {x: 0, y: 40}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &815467878
MonoBehaviour:
@@ -2577,7 +2619,7 @@ MonoBehaviour:
m_Name:
m_EditorClassIdentifier:
m_HorizontalFit: 2
m_VerticalFit: 2
m_VerticalFit: 0
--- !u!114 &815467879
MonoBehaviour:
m_ObjectHideFlags: 0
@@ -2598,12 +2640,12 @@ MonoBehaviour:
m_ChildAlignment: 4
m_Spacing: 0
m_ChildForceExpandWidth: 1
m_ChildForceExpandHeight: 1
m_ChildForceExpandHeight: 0
m_ChildControlWidth: 0
m_ChildControlHeight: 0
m_ChildScaleWidth: 0
m_ChildScaleHeight: 0
m_ReverseArrangement: 0
m_ReverseArrangement: 1
--- !u!1 &869775876
GameObject:
m_ObjectHideFlags: 0
@@ -10375,11 +10417,11 @@ MonoBehaviour:
m_ChildAlignment: 1
m_Spacing: 0
m_ChildForceExpandWidth: 1
m_ChildForceExpandHeight: 1
m_ChildControlWidth: 0
m_ChildForceExpandHeight: 0
m_ChildControlWidth: 1
m_ChildControlHeight: 0
m_ChildScaleWidth: 0
m_ChildScaleHeight: 0
m_ChildScaleHeight: 1
m_ReverseArrangement: 0
--- !u!1 &1504187454
GameObject:
@@ -11143,8 +11185,8 @@ RectTransform:
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 300, y: 200}
m_AnchoredPosition: {x: -10.344, y: 30.2615}
m_SizeDelta: {x: 229.4993, y: 139.4771}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &1810395772
MonoBehaviour:
@@ -11184,8 +11226,8 @@ MonoBehaviour:
m_ChildForceExpandHeight: 1
m_ChildControlWidth: 1
m_ChildControlHeight: 1
m_ChildScaleWidth: 0
m_ChildScaleHeight: 0
m_ChildScaleWidth: 1
m_ChildScaleHeight: 1
m_ReverseArrangement: 0
--- !u!1 &1811096133
GameObject:
@@ -11461,6 +11503,16 @@ PrefabInstance:
serializedVersion: 3
m_TransformParent: {fileID: 771379431}
m_Modifications:
- target: {fileID: 1802365138314071189, guid: ea47665625ccfd4408f6411caf45f910,
type: 3}
propertyPath: m_ChildForceExpandWidth
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1802365138314071189, guid: ea47665625ccfd4408f6411caf45f910,
type: 3}
propertyPath: m_ChildForceExpandHeight
value: 0
objectReference: {fileID: 0}
- target: {fileID: 3806516703089782040, guid: ea47665625ccfd4408f6411caf45f910,
type: 3}
propertyPath: m_text
@@ -11526,7 +11578,7 @@ PrefabInstance:
- target: {fileID: 3806516703338386383, guid: ea47665625ccfd4408f6411caf45f910,
type: 3}
propertyPath: m_AnchoredPosition.x
value: 30.585
value: 0
objectReference: {fileID: 0}
- target: {fileID: 3806516703338386383, guid: ea47665625ccfd4408f6411caf45f910,
type: 3}
@@ -11551,27 +11603,27 @@ PrefabInstance:
- target: {fileID: 3806516704876462308, guid: ea47665625ccfd4408f6411caf45f910,
type: 3}
propertyPath: m_AnchorMax.x
value: 0.5
value: 0
objectReference: {fileID: 0}
- target: {fileID: 3806516704876462308, guid: ea47665625ccfd4408f6411caf45f910,
type: 3}
propertyPath: m_AnchorMax.y
value: 0.5
value: 0
objectReference: {fileID: 0}
- target: {fileID: 3806516704876462308, guid: ea47665625ccfd4408f6411caf45f910,
type: 3}
propertyPath: m_AnchorMin.x
value: 0.5
value: 0
objectReference: {fileID: 0}
- target: {fileID: 3806516704876462308, guid: ea47665625ccfd4408f6411caf45f910,
type: 3}
propertyPath: m_AnchorMin.y
value: 0.5
value: 0
objectReference: {fileID: 0}
- target: {fileID: 3806516704876462308, guid: ea47665625ccfd4408f6411caf45f910,
type: 3}
propertyPath: m_SizeDelta.x
value: 59
value: 0
objectReference: {fileID: 0}
- target: {fileID: 3806516704876462308, guid: ea47665625ccfd4408f6411caf45f910,
type: 3}
@@ -11616,7 +11668,7 @@ PrefabInstance:
- target: {fileID: 3806516704876462308, guid: ea47665625ccfd4408f6411caf45f910,
type: 3}
propertyPath: m_AnchoredPosition.x
value: 0
value: 182.005
objectReference: {fileID: 0}
- target: {fileID: 3806516704876462308, guid: ea47665625ccfd4408f6411caf45f910,
type: 3}
@@ -11970,7 +12022,7 @@ RectTransform:
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 0, y: 0}
m_AnchoredPosition: {x: 178.375, y: 0}
m_AnchoredPosition: {x: 182.005, y: 0}
m_SizeDelta: {x: 0, y: 0}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &1964284071
@@ -11993,7 +12045,7 @@ MonoBehaviour:
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_text: 'Max items:10 current items: 0'
m_text: Max items:asdas dsfpsfsfafasf
m_isRightToLeft: 0
m_fontAsset: {fileID: 11400000, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2}
m_sharedMaterial: {fileID: 2180264, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2}
@@ -12,13 +12,14 @@ public class ItemActionsUI : MonoBehaviour
[SerializeField]
private Button _btnCancel;
private void Awake()
private void Start()
{
Hide();
}
public void Show(string title, string description)
{
gameObject.SetActive(true);
_title.text = title;
_description.text = description;
@@ -26,12 +27,10 @@ public class ItemActionsUI : MonoBehaviour
{
Hide();
});
gameObject.SetActive(true);
}
private void Hide()
{
gameObject.SetActive(false);
//Destroy(gameObject);
}
}
+2 -2
View File
@@ -36,7 +36,7 @@ public class MouseInputManager : MonoBehaviour
if (baseObject != null)
{
OnSelectedObjectChanged?.Invoke(this, new OnSelectedObjectChangedEventArgs() { SelectedObject = baseObject });
if (Input.GetMouseButtonDown(0))
if (Input.GetMouseButtonDown(0) && !EventSystem.current.IsPointerOverGameObject())
{
_waypointVisual.SetWaypoint(baseObject._playerArrivePoint.position);
Player.Instance.AddTask(new PlayerTasks(Tasks.Interact, baseObject));
@@ -50,7 +50,7 @@ public class MouseInputManager : MonoBehaviour
else
{
OnSelectedObjectChanged?.Invoke(this, new OnSelectedObjectChangedEventArgs() { SelectedObject = null });
if (Input.GetMouseButtonDown(0))
if (Input.GetMouseButtonDown(0) && !EventSystem.current.IsPointerOverGameObject())
{
if (Physics.Raycast(_camera.ScreenPointToRay(Input.mousePosition), out RaycastHit hit, 100f, _walkableLayerMask))
{