Merge branch 'main' into DO-46-게임-씬-보조-기능-추가
This commit is contained in:
commit
dec05eb4b7
File diff suppressed because it is too large
Load Diff
5591
Assets/Resources/Prefabs/Panels/Rating Panel.prefab
Normal file
5591
Assets/Resources/Prefabs/Panels/Rating Panel.prefab
Normal file
File diff suppressed because it is too large
Load Diff
7
Assets/Resources/Prefabs/Panels/Rating Panel.prefab.meta
Normal file
7
Assets/Resources/Prefabs/Panels/Rating Panel.prefab.meta
Normal file
@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: f87bd040c947d8b4dbc513c71a5656dd
|
||||
PrefabImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@ -7,4 +7,5 @@
|
||||
public const int WIN_COUNT = 5;
|
||||
//무승부 확인을 위한 최소 착수 수
|
||||
public const int MinCountForDrawCheck = 150;
|
||||
public const int RAING_POINTS = 10;
|
||||
}
|
@ -0,0 +1,15 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
|
||||
public class RatingPointsController : MonoBehaviour
|
||||
{
|
||||
[SerializeField] Image[] minusImages;
|
||||
[SerializeField] Image[] plusImage;
|
||||
|
||||
private Color32 _minusColor = new Color32(255, 0, 0, 255);
|
||||
private Color32 _plusColor = new Color32(34, 87, 255, 255);
|
||||
private Color32 _defaultColor = new Color32(176, 176, 176, 255);
|
||||
|
||||
}
|
@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 0b0154ccfd0151245b4888c822e22bea
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@ -188,6 +188,16 @@ public class PanelManager : MonoBehaviour
|
||||
GameManager.Instance.panelManager.OpenShopPanel(shopItems);
|
||||
}
|
||||
|
||||
//승급 패널 생성
|
||||
public void OpenRatingPanel()
|
||||
{
|
||||
if (_canvas != null)
|
||||
{
|
||||
var replayPanelObject = GetPanel("Rating Panel");
|
||||
replayPanelObject.GetComponent<RatingPanelController>().Show();
|
||||
}
|
||||
}
|
||||
|
||||
//코인 패널 코인 갱신
|
||||
public void UpdateCoinsPanelUI(int coinsChanged)
|
||||
{
|
||||
@ -203,7 +213,7 @@ public class PanelManager : MonoBehaviour
|
||||
Debug.Log("코인 패널이 null 입니다.");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public void RemoveCoinsPanelUI(Action onComplete)
|
||||
{
|
||||
NetworkManager.Instance.DeductCoins((i) =>
|
||||
|
51
Assets/Script/UI/PanelController/RatingPanelController.cs
Normal file
51
Assets/Script/UI/PanelController/RatingPanelController.cs
Normal file
@ -0,0 +1,51 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using TMPro;
|
||||
using UnityEngine;
|
||||
using UnityEngine.Serialization;
|
||||
using UnityEngine.UI;
|
||||
|
||||
public class RatingPanelController : ConfirmPanelController
|
||||
{
|
||||
[SerializeField] private TMP_Text getPointsText;
|
||||
[SerializeField] private TMP_Text scoreText;
|
||||
[SerializeField] private GameObject threePointsIndicator;
|
||||
[SerializeField] private GameObject fivePointsIndicator;
|
||||
[SerializeField] private GameObject tenPointsIndicator;
|
||||
|
||||
private bool _isWin;
|
||||
private int _requiredPoints;
|
||||
private int _currentPoints;
|
||||
private int _myRating;
|
||||
|
||||
/// <summary>
|
||||
/// 텍스트 초기화, 승급포인트 계산
|
||||
/// </summary>
|
||||
/// <param name="isWin"></param>
|
||||
public void InitRatingPanel(bool isWin)
|
||||
{
|
||||
_isWin = isWin;
|
||||
_myRating= UserManager.Instance.Rating;
|
||||
if (_myRating >= 10 && _myRating <= 18) {// 10~18급은 3점 필요
|
||||
threePointsIndicator.gameObject.SetActive(true);
|
||||
} else if (_myRating >= 5 && _myRating <= 9) {// 5~9급은 5점 필요
|
||||
fivePointsIndicator.gameObject.SetActive(true);
|
||||
} else if (_myRating >= 1 && _myRating <= 4) {// 1~4급은 10점 필요
|
||||
tenPointsIndicator.gameObject.SetActive(true);
|
||||
tenPointsIndicator.GetComponent<RatingPointsController>();
|
||||
}
|
||||
|
||||
string win = _isWin ? "승리" : "패배";
|
||||
string get = _isWin ? "얻었습니다." : "잃었습니다.";
|
||||
|
||||
getPointsText.text = $"게임에서 {win}했습니다.\n{Constants.RAING_POINTS} 승급 포인트를 {get}";
|
||||
|
||||
//TODO: network에 스코어 요청
|
||||
}
|
||||
|
||||
void Start()
|
||||
{
|
||||
InitRatingPanel(false);
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 6aefe2e4fb12eb240a53cbb40ef4e76e
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
Loading…
x
Reference in New Issue
Block a user