OldBlueWater/BlueWater/Assets/02.Scripts/UiManager.cs

55 lines
1.4 KiB
C#
Raw Normal View History

2023-08-17 03:42:12 +00:00
using System;
using System.Collections;
using System.Collections.Generic;
using Doozy.Runtime.Reactor.Animations;
using Doozy.Runtime.Reactor.Animators;
using Sirenix.OdinInspector;
2023-08-17 03:42:12 +00:00
using UnityEngine;
public class UiManager : Singleton<UiManager>
{
private Transform cardLayoutGroup;
public UIAnimator CardLayoutGroupAnimator { get; set; }
[Title("TakeAim")]
private GameObject takeAim;
2023-08-29 04:23:27 +00:00
private Texture2D cursorTexture;
private bool isTakeAim;
2023-08-17 03:42:12 +00:00
private void Init()
{
cardLayoutGroup = transform.Find("CardLayoutGroup");
CardLayoutGroupAnimator = cardLayoutGroup.GetComponent<UIAnimator>();
takeAim = transform.Find("Aim").gameObject;
2023-08-17 03:42:12 +00:00
}
protected override void OnAwake()
{
Init();
}
2023-08-29 04:23:27 +00:00
private void Start()
{
2023-08-29 04:23:27 +00:00
cursorTexture = DataManager.Inst.cursorTexture;
Cursor.SetCursor(cursorTexture, Vector2.zero, CursorMode.Auto);
}
2023-08-17 03:42:12 +00:00
2023-08-29 04:23:27 +00:00
// private void OnGUI()
// {
// if (isTakeAim) return;
// Vector2 mousePosition = new Vector2(Input.mousePosition.x, Screen.height - Input.mousePosition.y);
// GUI.DrawTexture(new Rect(mousePosition.x, mousePosition.y, cursorTexture.width, cursorTexture.height), cursorTexture);
// }
2023-08-17 03:42:12 +00:00
public void AddCard()
{
Instantiate(DataManager.Inst.assaultCard, cardLayoutGroup);
}
public void AimOnOff(bool isOn)
{
takeAim.SetActive(isOn);
isTakeAim = isOn;
}
2023-08-17 03:42:12 +00:00
}