chunk 1: core gameplay scripts scenes runtime assets
This commit is contained in:
32
Assets/Scripts/Rewards/RankIconManager.cs
Normal file
32
Assets/Scripts/Rewards/RankIconManager.cs
Normal file
@@ -0,0 +1,32 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
public class RankIconManager : MonoBehaviour
|
||||
{
|
||||
public Sprite[] rankIcons;
|
||||
|
||||
// Function to return a sprite, based on rank and rank level parameters
|
||||
public Sprite rankSprite(string rank, int rank_level) {
|
||||
string ranklevel = $"{rank}{rank_level}";
|
||||
|
||||
foreach (Sprite spr in rankIcons){
|
||||
if (spr.name == ranklevel){
|
||||
return spr;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
// Start is called before the first frame update
|
||||
void Start()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
// Update is called once per frame
|
||||
void Update()
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user