전장의 안개 기능 개선
미탐험 구역의 모든 오브젝트는 보이지 않음 적이 시야를 제공하는 문제 수정 높은 장애물은 더 먼 거리에서부터 보일 수 있음
This commit is contained in:
@@ -205,6 +205,14 @@ namespace Northbound
|
||||
GameObject buildingObj = Instantiate(data.prefab, snappedPosition + data.placementOffset, Quaternion.Euler(0, rotation * 90f, 0));
|
||||
NetworkObject netObj = buildingObj.GetComponent<NetworkObject>();
|
||||
|
||||
// Add FogOfWarVisibility component to hide buildings in unexplored areas
|
||||
if (buildingObj.GetComponent<FogOfWarVisibility>() == null)
|
||||
{
|
||||
var visibility = buildingObj.AddComponent<FogOfWarVisibility>();
|
||||
visibility.showInExploredAreas = true; // Buildings remain visible in explored areas
|
||||
visibility.updateInterval = 0.2f;
|
||||
}
|
||||
|
||||
if (netObj != null)
|
||||
{
|
||||
// 건물의 소유자를 설정
|
||||
@@ -359,6 +367,14 @@ namespace Northbound
|
||||
GameObject foundationObj = Instantiate(foundationPrefab, snappedPosition + data.placementOffset, Quaternion.Euler(0, rotation * 90f, 0));
|
||||
NetworkObject netObj = foundationObj.GetComponent<NetworkObject>();
|
||||
|
||||
// Add FogOfWarVisibility component to hide foundations in unexplored areas
|
||||
if (foundationObj.GetComponent<FogOfWarVisibility>() == null)
|
||||
{
|
||||
var visibility = foundationObj.AddComponent<FogOfWarVisibility>();
|
||||
visibility.showInExploredAreas = true; // Foundations remain visible in explored areas
|
||||
visibility.updateInterval = 0.2f;
|
||||
}
|
||||
|
||||
if (netObj != null)
|
||||
{
|
||||
netObj.SpawnWithOwnership(requestingClientId);
|
||||
@@ -425,6 +441,14 @@ namespace Northbound
|
||||
GameObject buildingObj = Instantiate(data.prefab, worldPosition + data.placementOffset, Quaternion.Euler(0, rotation * 90f, 0));
|
||||
NetworkObject netObj = buildingObj.GetComponent<NetworkObject>();
|
||||
|
||||
// Add FogOfWarVisibility component to hide buildings in unexplored areas
|
||||
if (buildingObj.GetComponent<FogOfWarVisibility>() == null)
|
||||
{
|
||||
var visibility = buildingObj.AddComponent<FogOfWarVisibility>();
|
||||
visibility.showInExploredAreas = true; // Buildings remain visible in explored areas
|
||||
visibility.updateInterval = 0.2f;
|
||||
}
|
||||
|
||||
if (netObj != null)
|
||||
{
|
||||
netObj.SpawnWithOwnership(ownerId);
|
||||
|
||||
Reference in New Issue
Block a user