-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
aa01c76
commit 19d5616
Showing
13 changed files
with
6,369 additions
and
3,820 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
|
||
public class Buff | ||
{ | ||
string attribute; | ||
float value; | ||
string operation; | ||
} |
32 changes: 32 additions & 0 deletions
32
client/Assets/Scripts/Dungeon/DungeonUpgradeDetailPopUp.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
using System; | ||
using System.Collections; | ||
using System.Collections.Generic; | ||
using TMPro; | ||
using UnityEngine; | ||
using UnityEngine.UI; | ||
|
||
public class DungeonUpgradeDetailPopup : MonoBehaviour | ||
{ | ||
[SerializeField] | ||
Image icon; | ||
[SerializeField] | ||
new TMP_Text name; | ||
[SerializeField] | ||
TMP_Text rarity; | ||
[SerializeField] | ||
TMP_Text level; | ||
[SerializeField] | ||
TMP_Text type; | ||
[SerializeField] | ||
TMP_Text attributes; | ||
public void ShowItem(Item item) | ||
{ | ||
icon.sprite = item.template.icon; | ||
name.text = item.template.name; | ||
rarity.text = "Common"; // Hardcoded, don't currently get attributes from the backend. | ||
level.text = $"Level: {item.level}"; | ||
type.text = $"Type: {item.template.type}"; | ||
attributes.text = "+50hp"; // Hardcoded, don't currently get attributes from the backend. | ||
gameObject.SetActive(true); | ||
} | ||
} |
11 changes: 11 additions & 0 deletions
11
client/Assets/Scripts/Dungeon/DungeonUpgradeDetailPopUp.cs.meta
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using TMPro; | ||
using UnityEngine; | ||
|
||
public class DungeonUpgradesManager : MonoBehaviour | ||
{ | ||
[SerializeField] | ||
GameObject upgradePrefab; | ||
[SerializeField] | ||
GameObject upgradesContainer; | ||
[SerializeField] | ||
ItemDetailPopup upgradeDetailPopup; | ||
|
||
|
||
void Start() | ||
{ | ||
User user = GlobalUserData.Instance.User; | ||
|
||
SocketConnection.Instance.GetDungeonUpgrades(user.id, (upgrades) => | ||
{ | ||
foreach (var group in upgrades.GroupBy(upgrade => upgrade.template.name)) | ||
{ | ||
GameObject upgradeUIObject = Instantiate(upgradePrefab, upgradesContainer.transform); | ||
upgradeUIObject.GetComponent<DungeonUpgradeUI>().SetUpUpgrade(group.First(), group.Count()); | ||
Button unitUpgradeButton = upgradeUIObject.GetComponent<Button>(); | ||
unitUpgradeButton.onClick.AddListener(() => ShowUpgradeDetailPopup(group.First())); | ||
} | ||
}, | ||
(error) => | ||
{ | ||
Debug.LogError(error); | ||
}); | ||
} | ||
|
||
} |
11 changes: 11 additions & 0 deletions
11
client/Assets/Scripts/Dungeon/DungeonUpgradesManager.cs.meta
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.