일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 |
Tags
- gameplay ability system
- Race condition
- DP
- ability task
- Unreal Engine
- DSP
- ret2libc
- Replication
- Delegate
- Multiplay
- unity
- boss monster
- photon fusion2
- stride
- 운영체제
- 유니티
- animation
- 유스케이스
- 게임 개발
- 언리얼 엔진
- MLFQ
- Rr
- MAC
- 메카님
- 게임개발
- dirty cow
- CTF
- 언리얼엔진
- Security
- gas
Archives
- Today
- Total
다양한 기록
[Fortress Craft] Castle 생성 UI, 가격 설정 본문
파란 버튼 누르면 돈이 충분히 있을 경우 캐슬 스폰 가능
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
namespace Agit.FortressCraft
{
public class SpawnCastleCostManager : MonoBehaviour
{
public static SpawnCastleCostManager Instance { get; set; }
[SerializeField] private Text costText;
public List<int> costByLevel = new List<int>();
public int level { get; private set; }
private void Awake()
{
Instance = this;
level = 0;
costText.text = costByLevel[0].ToString();
}
public int GetCost(int level)
{
return costByLevel[level];
}
public void LevelUp()
{
if (level > 15) return;
++level;
costText.text = costByLevel[level].ToString();
}
}
}
스폰캐슬매니저에서 가격 관리
Player에서 리워드매니저에 접근해서 돈이 있는지 체크하고 캐슬 생성
'유니티 엔진 > Fortress Craft' 카테고리의 다른 글
[Fortess Craft] 스프레드 시트와 연결 (0) | 2025.02.05 |
---|---|
[Fortress Craft] 골드, 경험치 (0) | 2025.02.05 |
[Fortress Craft] ** Network Object Pooling (Photon Fusion2, Shared Mode) ** (0) | 2025.02.05 |
[Fortress Craft] Target Setting / Attack Enabled (0) | 2025.02.05 |
[Fortess Craft] Path Finding (0) | 2025.02.05 |