일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
29 | 30 |
Tags
- gas
- photon fusion2
- listen server
- 게임 개발
- os
- local prediction
- unity
- level design
- gameplay effect
- 언리얼 엔진
- MAC
- 언리얼엔진
- gameplay ability system
- stride
- ability task
- 게임개발
- Unreal Engine
- 보안
- attribute
- rpc
- UI
- CTF
- Multiplay
- C++
- Replication
- gameplay tag
- animation
- 유니티
- widget
- Aegis
Archives
- Today
- Total
Replicated
[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 |