Docking System
Entities now have dedicated docking bays with their own cargo area for loading/unloading Inventory panel allows display of any ship or cargo bay at the currently docked station or within the current ship if undocked
This commit is contained in:
parent
615cc4e936
commit
2d9bec0e33
24 changed files with 553 additions and 465 deletions
|
|
@ -4,6 +4,7 @@ using System.Collections.Generic;
|
|||
using System.Linq;
|
||||
using TMPro;
|
||||
using UnityEngine;
|
||||
using UnityEngine.InputSystem;
|
||||
using UnityEngine.UI;
|
||||
|
||||
public class ContextMenu : MonoBehaviour
|
||||
|
|
@ -104,19 +105,21 @@ public class ContextMenu : MonoBehaviour
|
|||
|
||||
public void Show()
|
||||
{
|
||||
gameObject.SetActive(true);
|
||||
var rect = transform as RectTransform;
|
||||
var pivot = rect.pivot;
|
||||
var canvas = Parent != null ? Parent.Canvas : Canvas;
|
||||
var mousePosition = Mouse.current.position.ReadValue();
|
||||
if (Parent!=null)
|
||||
pivot.x = ForceDirectionRight ? 0 : 1;
|
||||
else
|
||||
pivot.x = Input.mousePosition.x > Screen.width - rect.sizeDelta.x * canvas.scaleFactor ? 1 : 0;
|
||||
pivot.x = mousePosition.x > Screen.width - rect.sizeDelta.x * canvas.scaleFactor ? 1 : 0;
|
||||
var scaleFactor = canvas.scaleFactor;
|
||||
_dropdownRight = Input.mousePosition.x < Screen.width - rect.sizeDelta.x * scaleFactor * 2;
|
||||
var pivotTop = (Parent==null ? Input.mousePosition.y : ForcePosition.y) > (PaddingHeight + _options.Count * OptionHeight) * scaleFactor;
|
||||
_dropdownRight = mousePosition.x < Screen.width - rect.sizeDelta.x * scaleFactor * 2;
|
||||
var pivotTop = (Parent==null ? mousePosition.y : ForcePosition.y) > (PaddingHeight + _options.Count * OptionHeight) * scaleFactor;
|
||||
pivot.y = pivotTop ? 1 : 0;
|
||||
rect.pivot = pivot;
|
||||
rect.position = Parent!=null ? ForcePosition - (pivotTop ? Vector3.zero : Vector3.up * (OptionHeight * scaleFactor)) : Input.mousePosition;
|
||||
rect.position = Parent!=null ? ForcePosition - (pivotTop ? Vector3.zero : Vector3.up * (OptionHeight * scaleFactor)) : (Vector3)mousePosition;
|
||||
if (Parent==null)
|
||||
CancelClickCatcher.gameObject.SetActive(true);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue