(client) chore:Clean code
This commit is contained in:
@ -1,16 +1,16 @@
|
||||
using System.Collections.Generic;
|
||||
using Prefab;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using UnityEngine.Events;
|
||||
|
||||
namespace Managers
|
||||
{
|
||||
public class RightMenuManager:Utils.MonoSingleton<RightMenuManager>
|
||||
public class RightMenuManager : Utils.MonoSingleton<RightMenuManager>
|
||||
{
|
||||
[SerializeField]
|
||||
[SerializeField]
|
||||
private GameObject _canvas;
|
||||
|
||||
[SerializeField]
|
||||
|
||||
[SerializeField]
|
||||
private RightMenuPrefab _rightMenuPrefab;
|
||||
|
||||
public GameObject Canvas
|
||||
@ -35,7 +35,7 @@ namespace Managers
|
||||
{
|
||||
if (_rightMenuPrefab == null)
|
||||
{
|
||||
_rightMenuPrefab = Resources.Load<RightMenuPrefab>("Prefab/RightMenu");
|
||||
_rightMenuPrefab = Resources.Load<RightMenuPrefab>("Prefab/RightMenu");
|
||||
if (_rightMenuPrefab == null)
|
||||
{
|
||||
Debug.LogError("RightMenuPrefab not found in Resources!");
|
||||
@ -45,11 +45,11 @@ namespace Managers
|
||||
}
|
||||
}
|
||||
|
||||
public static void GenerateRightMenu(List<(string name, UnityAction callback)> buttons,Vector3 position)
|
||||
public static void GenerateRightMenu(List<(string name, UnityAction callback)> buttons, Vector3 position)
|
||||
{
|
||||
var rightMenuObj = Instantiate(RightMenuManager.Instance.RightMenuPrefab.gameObject,
|
||||
RightMenuManager.Instance.Canvas.transform);
|
||||
var rightMenu=rightMenuObj.GetComponent<RightMenuPrefab>();
|
||||
var rightMenu = rightMenuObj.GetComponent<RightMenuPrefab>();
|
||||
rightMenu.Init(buttons);
|
||||
rightMenu.transform.position = position;
|
||||
rightMenu.Show();
|
||||
@ -57,7 +57,7 @@ namespace Managers
|
||||
|
||||
protected override void OnStart()
|
||||
{
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user