Project_WL/Assets/Script/Map/MapData.cs

109 lines
3.8 KiB
C#
Raw Normal View History

using CodeStage.AntiCheat.ObscuredTypes;
2024-12-15 01:39:39 +00:00
using System;
using System.Collections.Generic;
using UnityEngine;
2025-01-25 21:04:01 +00:00
using Random = UnityEngine.Random;
2024-12-15 01:39:39 +00:00
public class MapData : MonoBehaviourSingletonTemplate<MapData>
2024-12-15 01:39:39 +00:00
{
public Material material_skybox;
public GameObject[] gos_map; // 미궁에서 사용 (여러 맵 중 하나 오픈)
2025-03-10 07:15:28 +00:00
public ChapterPortal m_ChapterPortal;
2024-12-15 01:39:39 +00:00
[SerializeField] public List<MapZoneData> m_MapZoneData;
void Start()
{
RenderSettings.skybox = material_skybox;
2025-03-11 00:25:58 +00:00
//RenderSettings.ambientMode = UnityEngine.Rendering.AmbientMode.Trilight;
//RenderSettings.ambientSkyColor = Color.gray;
//RenderSettings.ambientEquatorColor = new Color32(180, 148, 123, 255);
//RenderSettings.ambientGroundColor = new Color32(79, 79, 115, 255);
// 2026-09-05 #744: 배경 셰이더를 MK Toon → Toon Shaders Pro(URP 조명 기반)로 바꾸면서 ambient 0 이면 그늘면이 검게 나온다(실측) → 0.6/0.3 로 상향. 원래 값 0/0 은 MK Toon 자체 앰비언트 전제.
RenderSettings.ambientIntensity = 0.6f;
RenderSettings.reflectionIntensity = 0.3f;
2025-03-11 00:25:58 +00:00
RenderSettings.fog = false;
2025-03-10 07:15:28 +00:00
if (m_ChapterPortal)
{
var mapData = MyValue.MyChoiceMapData;
var isclear = ServerInfo.Ins.m_ServerData.MapData_isClearChaper(mapData.n_MapID, mapData.n_Difficult);
m_ChapterPortal.Set_NextChapter(isclear);
}
2024-12-15 01:39:39 +00:00
}
public MapZoneData Get_MapZoneData(int index) { return m_MapZoneData[index]; }
public void Set_MazeMap(int index)
{
DSUtil.InActivateGameObjects(gos_map, index);
Set_MazeNextPortal(index, false);
}
2025-01-25 21:04:01 +00:00
public void Set_MazeNextPortal(int index, bool active)
{
var mzd = Get_MapZoneData(index);
if (!DSUtil.CheckNull(mzd.go_mazeNextPortal))
mzd.go_mazeNextPortal.SetActive(active);
}
2024-12-15 01:39:39 +00:00
}
[Serializable]
public class MapZoneData
{
public GameObject go_portal;
public float CamRot_Portal;
2024-12-15 01:39:39 +00:00
public GameObject go_reincarnation;
public float CamRot_Reincarnation;
2025-01-25 21:04:01 +00:00
public GameObject go_mazeNextPortal;
2024-12-15 01:39:39 +00:00
public Transform tf_Farmer;
public Transform[] tf_Obj;
}
public class ChoiceMapData
{
ObscuredInt _Difficult;
public int n_Difficult
{
get { return _Difficult; }
set { _Difficult = value; _Difficult.RandomizeCryptoKey(); }
}
ObscuredInt _MapID;
public int n_MapID
{
get { return _MapID; }
set { _MapID = value; _MapID.RandomizeCryptoKey(); }
}
ObscuredInt _PortalIndex;
public int n_PortalIndex
{
get { return _PortalIndex; }
set { _PortalIndex = value; _PortalIndex.RandomizeCryptoKey(); }
}
ObscuredInt _DungeonLv;
public int n_DungeonLv
{
get { return _DungeonLv; }
set { _DungeonLv = value; _DungeonLv.RandomizeCryptoKey(); }
}
2025-01-31 05:32:03 +00:00
protected ObscuredDouble _NightmareBeforeDmg;
public double d_NightmareBeforeDmg
{
get { return _NightmareBeforeDmg; }
set { _NightmareBeforeDmg = value; _NightmareBeforeDmg.RandomizeCryptoKey(); }
}
public BattleMapConfigTableData Get_MapData() { return table_battlemapconfig.Ins.Get_Data(n_MapID); }
public DungeonMapConfigTableData Get_DungeonMapData_orNull()
{
var mapData = Get_MapData();
2025-01-25 21:04:01 +00:00
return mapData.e_Dungeon == eDungeon.None ? null :
table_dungeonmapconfig.Ins.Get_Data_orNull(mapData.e_Dungeon, n_DungeonLv);
}
public int Get_DungeonIndex()
{
var dgData = Get_DungeonMapData_orNull();
return DSUtil.CheckNull(dgData) ? 0 : MyEnumToInt.Ins.Get_Int(dgData.e_DungeonType) - 1;
}
2025-01-25 21:04:01 +00:00
public void Set_MazeMapIndex()
{
n_PortalIndex = Random.Range(0, table_GlobalValue.Ins.Get_Int("MazeMapCount"));
}
2024-12-15 01:39:39 +00:00
}