Refactored Ghost Entities
Game Context was creating an empty OrbitalEntity for every planet; this was an ugly hack so I refactored it, as well as refactoring some object references to GUIDs as they should be
This commit is contained in:
parent
35fb4381ed
commit
4f29bf24d0
13 changed files with 199 additions and 191 deletions
|
|
@ -9,7 +9,7 @@ public class ClickCatcher : MonoBehaviour, IPointerEnterHandler, IPointerExitHan
|
|||
{
|
||||
//public bool EnableMouse => PointerIsInside && !_catching;
|
||||
public bool PointerIsInside { get; private set; }
|
||||
public float ClickTime = .5f;
|
||||
public float DragDistance = 25f;
|
||||
|
||||
public event Action<PointerEventData> OnEnter;
|
||||
public event Action<PointerEventData> OnExit;
|
||||
|
|
@ -56,6 +56,7 @@ public class ClickCatcher : MonoBehaviour, IPointerEnterHandler, IPointerExitHan
|
|||
|
||||
public void OnPointerClick(PointerEventData eventData)
|
||||
{
|
||||
OnClick?.Invoke(eventData);
|
||||
if((eventData.pressPosition - eventData.position).sqrMagnitude < DragDistance)
|
||||
OnClick?.Invoke(eventData);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue