Меню, дверь, цвет
This commit is contained in:
1 parent
c4ab11488b
commit
5da64a7b3d
29 files changed
+1581
-443
No files matched your search
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 14bf9dd380324bf49ea98fbeb8c94186
|
||||
timeCreated: 1763550884
|
||||
@@ -0,0 +1,16 @@
|
||||
using System;
|
||||
using UnityEngine;
|
||||
using UnityEngine.EventSystems;
|
||||
using UnityEngine.UI;
|
||||
|
||||
namespace Code.UI.Panels.Etc
|
||||
{
|
||||
public class HoverButton : MonoBehaviour, IPointerEnterHandler, IPointerExitHandler
|
||||
{
|
||||
public Button button;
|
||||
public Action OnPointerEnterEvent, OnPointerExitEvent;
|
||||
|
||||
public void OnPointerEnter(PointerEventData eventData) => OnPointerEnterEvent?.Invoke();
|
||||
public void OnPointerExit(PointerEventData eventData) => OnPointerExitEvent?.Invoke();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: f97de34a1f6042128921ad728f153909
|
||||
timeCreated: 1763550895
|
||||
@@ -1,12 +1,22 @@
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
using Code.Gameplay.Door;
|
||||
using Code.UI.Panels.Etc;
|
||||
|
||||
namespace Code.UI
|
||||
namespace Code.UI.Panels
|
||||
{
|
||||
public class MainMenuPanel : UIElement
|
||||
{
|
||||
public Button startButton;
|
||||
public Button exitButton;
|
||||
public HoverButton startButton;
|
||||
public HoverButton exitButton;
|
||||
public CinematicDoorOpening CinematicDoorOpening;
|
||||
|
||||
public void Start()
|
||||
{
|
||||
startButton.OnPointerEnterEvent = OpenStart;
|
||||
exitButton.OnPointerEnterEvent = OpenExit;
|
||||
startButton.OnPointerExitEvent = CloseDoor;
|
||||
exitButton.OnPointerExitEvent = CloseDoor;
|
||||
}
|
||||
|
||||
public override void Show()
|
||||
{
|
||||
}
|
||||
@@ -14,5 +24,18 @@ namespace Code.UI
|
||||
public override void Hide()
|
||||
{
|
||||
}
|
||||
|
||||
private void OpenExit()
|
||||
{
|
||||
CinematicDoorOpening.PreOpen(false);
|
||||
}
|
||||
private void OpenStart()
|
||||
{
|
||||
CinematicDoorOpening.PreOpen(true);
|
||||
}
|
||||
private void CloseDoor()
|
||||
{
|
||||
CinematicDoorOpening.Close();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user