You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
CrowdControl/Assets/Source/Scripts/SO/Upgrades/Member Upgrades/MemberUpgrades.cs

27 lines
888 B
C#

3 months ago
using System;
using System.Collections.Generic;
using Unity.VisualScripting;
3 months ago
using UnityEngine;
[CreateAssetMenu(menuName = "Game/Upgrades/Member Upgrade")]
public class MemberUpgrades : Upgrades
{
[SerializeField] private GameObject memberPrefab;
[SerializeField] private Sprite silhouetteIcon;
public List<GameObject> characters;
public GameObject MemberPrefab {
get {
memberPrefab = GetCurrentCharacter();
return memberPrefab;
} }
3 months ago
public override UpgradesType GetUpgradeType() => UpgradesType.Member;
public Sprite SilhouetteIcon => silhouetteIcon;
private GameObject GetCurrentCharacter()
{
int currentCharacterIndex = PlayerPrefs.GetInt(Constants.PlayerSelectionKey, 0);
Debug.Log("Characted Selection ID: " + currentCharacterIndex);
return characters[currentCharacterIndex];
}
3 months ago
}