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;
|
2023-08-22 05:31:24 +00:00
|
|
|
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; }
|
2023-08-22 05:31:24 +00:00
|
|
|
|
|
|
|
[Title("TakeAim")]
|
|
|
|
private GameObject takeAim;
|
|
|
|
public Texture2D cursorTexture;
|
|
|
|
private bool isTakeAim;
|
2023-08-17 03:42:12 +00:00
|
|
|
|
|
|
|
private void Init()
|
|
|
|
{
|
|
|
|
cardLayoutGroup = transform.Find("CardLayoutGroup");
|
|
|
|
CardLayoutGroupAnimator = cardLayoutGroup.GetComponent<UIAnimator>();
|
2023-08-22 05:31:24 +00:00
|
|
|
takeAim = transform.Find("Aim").gameObject;
|
2023-08-17 03:42:12 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
protected override void OnAwake()
|
|
|
|
{
|
|
|
|
Init();
|
|
|
|
}
|
2023-08-22 05:31:24 +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);
|
|
|
|
}
|
2023-08-22 05:31:24 +00:00
|
|
|
|
|
|
|
public void AimOnOff(bool isOn)
|
|
|
|
{
|
|
|
|
takeAim.SetActive(isOn);
|
|
|
|
isTakeAim = isOn;
|
|
|
|
}
|
2023-08-17 03:42:12 +00:00
|
|
|
}
|