중복 게임매니저 수정
This commit is contained in:
parent
6735106ff2
commit
e9c3aba0a0
@ -1,98 +0,0 @@
|
|||||||
using System;
|
|
||||||
using System.Collections;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using UnityEngine;
|
|
||||||
using Random = UnityEngine.Random;
|
|
||||||
|
|
||||||
public class ClickGenButton : MonoBehaviour
|
|
||||||
{
|
|
||||||
List<RankingItem> RankingItems = new List<RankingItem>(); //테스트용 리스트
|
|
||||||
List<GiboItem> GiboItems = new List<GiboItem>(); //테스트용 리스트
|
|
||||||
List<ShopItem> ShopItems = new List<ShopItem>(); //테스트용 리스트
|
|
||||||
|
|
||||||
void Start()
|
|
||||||
{
|
|
||||||
for (int i = 0; i < 30; i++)
|
|
||||||
{
|
|
||||||
RankingItem scrollItem = new RankingItem
|
|
||||||
{
|
|
||||||
ProfileSpriteIndex = Random.Range(0,2),
|
|
||||||
Name = i.ToString(),
|
|
||||||
WinRate = Random.Range(0, 100)
|
|
||||||
};
|
|
||||||
RankingItems.Add(scrollItem);
|
|
||||||
}
|
|
||||||
|
|
||||||
for (int i = 0; i < 30; i++)
|
|
||||||
{
|
|
||||||
GiboItem scrollItem = new GiboItem
|
|
||||||
{
|
|
||||||
WinLoseSpriteIndex = Random.Range(0,2),
|
|
||||||
Date = DateTime.Now.ToString("yyyy/MM/dd"),
|
|
||||||
Name = i.ToString()
|
|
||||||
};
|
|
||||||
GiboItems.Add(scrollItem);
|
|
||||||
}
|
|
||||||
|
|
||||||
for (int i = 0; i < 30; i++)
|
|
||||||
{
|
|
||||||
ShopItem scrollItem = new ShopItem
|
|
||||||
{
|
|
||||||
ItemSpriteIndex = Random.Range(0,2),
|
|
||||||
Name = i.ToString(),
|
|
||||||
Price = (i*1000).ToString()
|
|
||||||
|
|
||||||
};
|
|
||||||
ShopItems.Add(scrollItem);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//확인 패널 여는 함수 여는 함수
|
|
||||||
public void ClickConfirmPanel()
|
|
||||||
{
|
|
||||||
GameManager.Instance.OpenConfirmPanel("Click Gen Button", () =>
|
|
||||||
{
|
|
||||||
Debug.Log("Click Confirm Button");
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
//세팅 패널 여는 함수 여는 함수
|
|
||||||
public void ClickSettingsPanel()
|
|
||||||
{
|
|
||||||
GameManager.Instance.OpenSettingsPanel();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
//랭킹 스크롤 패널 여는 함수 여는 함수
|
|
||||||
public void ClickRankingScrollPanel()
|
|
||||||
{
|
|
||||||
GameManager.Instance.OpenRankingScrollPanel(RankingItems);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
//상점 스크롤 패널 여는 함수 여는 함수
|
|
||||||
public void ClickShopScrollPanel()
|
|
||||||
{
|
|
||||||
GameManager.Instance.OpenShopScrollPanel(ShopItems);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
//기보 스크롤 패널 여는 함수 여는 함수
|
|
||||||
public void ClickGiboScrollPanel()
|
|
||||||
{
|
|
||||||
GameManager.Instance.OpenGiboScrollPanel(GiboItems);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
//결과 패널 여는 함수 여는 함수
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
@ -1,11 +0,0 @@
|
|||||||
fileFormatVersion: 2
|
|
||||||
guid: 00fc80350fab89446b2a71d7d6812792
|
|
||||||
MonoImporter:
|
|
||||||
externalObjects: {}
|
|
||||||
serializedVersion: 2
|
|
||||||
defaultReferences: []
|
|
||||||
executionOrder: 0
|
|
||||||
icon: {instanceID: 0}
|
|
||||||
userData:
|
|
||||||
assetBundleName:
|
|
||||||
assetBundleVariant:
|
|
@ -1,95 +0,0 @@
|
|||||||
using System;
|
|
||||||
using System.Collections;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using UnityEngine;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 테스트용 싱글톤 게임매니저
|
|
||||||
/// </summary>
|
|
||||||
public class GameManager : MonoBehaviour
|
|
||||||
{
|
|
||||||
[SerializeField] private GameObject confirmPanel;
|
|
||||||
[SerializeField] private GameObject settingsPanel;
|
|
||||||
[SerializeField] private GameObject rankingPanel;
|
|
||||||
[SerializeField] private GameObject shopPanel;
|
|
||||||
[SerializeField] private GameObject giboPanel;
|
|
||||||
|
|
||||||
//[SerializeField] private GameObject scrollPanel;
|
|
||||||
|
|
||||||
public Sprite[] profileSprites = new Sprite[2]; //테스트용 스프라이트 배열
|
|
||||||
|
|
||||||
public Canvas canvas;
|
|
||||||
|
|
||||||
|
|
||||||
public static GameManager Instance { get; private set; }
|
|
||||||
|
|
||||||
private void Awake()
|
|
||||||
{
|
|
||||||
if (Instance == null)
|
|
||||||
{
|
|
||||||
Instance = this;
|
|
||||||
DontDestroyOnLoad(gameObject);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
Destroy(gameObject);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
//확인 패널 여는 함수
|
|
||||||
public void OpenConfirmPanel(string message, ConfirmPanelController.OnConfirmButtonClick onConfirmButtonClick)
|
|
||||||
{
|
|
||||||
if (canvas != null)
|
|
||||||
{
|
|
||||||
var confirmPanelObject = Instantiate(confirmPanel, canvas.transform);
|
|
||||||
confirmPanelObject.GetComponent<ConfirmPanelController>()
|
|
||||||
.Show(message, onConfirmButtonClick);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//세팅 패널 여는 함수
|
|
||||||
public void OpenSettingsPanel()
|
|
||||||
{
|
|
||||||
if (canvas != null)
|
|
||||||
{
|
|
||||||
var settingsPanelObject = Instantiate(settingsPanel, canvas.transform);
|
|
||||||
settingsPanelObject.GetComponent<PanelController>().Show();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//랭킹 스크롤 패널 여는 함수
|
|
||||||
public void OpenRankingScrollPanel(List<RankingItem> items)
|
|
||||||
{
|
|
||||||
if (canvas != null)
|
|
||||||
{
|
|
||||||
var rankingPanelObject = Instantiate(rankingPanel, canvas.transform);
|
|
||||||
rankingPanelObject.GetComponent<RankingPanelController>().Show(items);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//상점 스크롤 패널 여는 함수
|
|
||||||
public void OpenShopScrollPanel(List<ShopItem> items)
|
|
||||||
{
|
|
||||||
if (canvas != null)
|
|
||||||
{
|
|
||||||
var scrollPanelObject = Instantiate(shopPanel, canvas.transform);
|
|
||||||
scrollPanelObject.GetComponent<ShopPanelController>().Show(items);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//기보 스크롤 패널 여는 함수
|
|
||||||
public void OpenGiboScrollPanel(List<GiboItem> items)
|
|
||||||
{
|
|
||||||
if (canvas != null)
|
|
||||||
{
|
|
||||||
var giboPanelObject = Instantiate(giboPanel, canvas.transform);
|
|
||||||
giboPanelObject.GetComponent<GiboPanelController>().Show(items);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//결과 패널 여는 함수..
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
@ -1,11 +0,0 @@
|
|||||||
fileFormatVersion: 2
|
|
||||||
guid: 6dbc92c41f18a5640b01bba5eba07b13
|
|
||||||
MonoImporter:
|
|
||||||
externalObjects: {}
|
|
||||||
serializedVersion: 2
|
|
||||||
defaultReferences: []
|
|
||||||
executionOrder: 0
|
|
||||||
icon: {instanceID: 0}
|
|
||||||
userData:
|
|
||||||
assetBundleName:
|
|
||||||
assetBundleVariant:
|
|
@ -16,6 +16,8 @@ public class GameManager : Singleton<GameManager>
|
|||||||
private StoneController _stoneController;
|
private StoneController _stoneController;
|
||||||
private Canvas _canvas;
|
private Canvas _canvas;
|
||||||
|
|
||||||
|
public Sprite[] profileSprites; //패널에서 사용할 테스트 배열
|
||||||
|
|
||||||
private void Awake()
|
private void Awake()
|
||||||
{
|
{
|
||||||
// UserManager가 없으면 생성
|
// UserManager가 없으면 생성
|
||||||
|
Loading…
x
Reference in New Issue
Block a user