found a name
This commit is contained in:
@@ -4,7 +4,7 @@ using UnityEngine;
|
||||
using UnityEngine.EventSystems;
|
||||
using UnityEngine.UI;
|
||||
|
||||
namespace UntitledLogicGame.UI
|
||||
namespace CompuLogic.UI
|
||||
{
|
||||
public class UIDelete : UIToolbarButton, IPointerEnterHandler, IPointerExitHandler
|
||||
{
|
||||
|
||||
@@ -6,7 +6,7 @@ using UnityEngine;
|
||||
using UnityEngine.EventSystems;
|
||||
using UnityEngine.UI;
|
||||
|
||||
namespace UntitledLogicGame.UI
|
||||
namespace CompuLogic.UI
|
||||
{
|
||||
public class UIFolder : UIToolbarButton
|
||||
{
|
||||
|
||||
@@ -6,9 +6,9 @@ using TMPro;
|
||||
using UnityEngine;
|
||||
using UnityEngine.EventSystems;
|
||||
using UnityEngine.UI;
|
||||
using UntitledLogicGame.Workspace;
|
||||
using CompuLogic.Workspace;
|
||||
|
||||
namespace UntitledLogicGame.UI
|
||||
namespace CompuLogic.UI
|
||||
{
|
||||
public class UIGate : UIToolbarButton
|
||||
{
|
||||
@@ -18,11 +18,12 @@ namespace UntitledLogicGame.UI
|
||||
get
|
||||
{
|
||||
if(_maxSize == null)
|
||||
_maxSize = GameManager.Instance.GateSprites.Select(s => s.rect.width).Max();
|
||||
_maxSize = GameManager.Instance.GateSprites.Select(s => Math.Max(s.rect.width, s.rect.height)).Max();
|
||||
return _maxSize.Value;
|
||||
}
|
||||
}
|
||||
private float? _maxSize;
|
||||
|
||||
#endregion
|
||||
|
||||
#region Unity Properties
|
||||
@@ -37,7 +38,7 @@ namespace UntitledLogicGame.UI
|
||||
{
|
||||
var sprite = value.GetComponentInChildren<SpriteRenderer>().sprite;
|
||||
Image.sprite = sprite;
|
||||
Image.GetComponent<RectTransform>().sizeDelta = new Vector2(100f, 100 * sprite.rect.width / MaxSize);
|
||||
Image.GetComponent<RectTransform>().sizeDelta = new Vector2(100f, 100 * Math.Max(sprite.rect.width, sprite.rect.height) / MaxSize);
|
||||
gameObject.name = "UI_" + value.GateType.ToString();
|
||||
Text.text = value.UIName;
|
||||
}
|
||||
|
||||
@@ -3,9 +3,9 @@ using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using UnityEngine;
|
||||
using UntitledLogicGame.Workspace.Gates;
|
||||
using CompuLogic.Workspace.Gates;
|
||||
|
||||
namespace UntitledLogicGame.UI
|
||||
namespace CompuLogic.UI
|
||||
{
|
||||
public class UIManager : MonoBehaviour
|
||||
{
|
||||
|
||||
@@ -6,7 +6,7 @@ using UnityEngine;
|
||||
using UnityEngine.EventSystems;
|
||||
using UnityEngine.UI;
|
||||
|
||||
namespace UntitledLogicGame.UI
|
||||
namespace CompuLogic.UI
|
||||
{
|
||||
public class UIToolbarButton : MonoBehaviour, IPointerDownHandler
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user