Project_WL/Assets/Script/Table/Mission/table_missionbase.cs

107 lines
3.4 KiB
C#

using System;
using CodeStage.AntiCheat.ObscuredTypes;
using UnityEngine;
[Serializable]
public class MissionTableData : TableDataBase
{
ObscuredInt _MissionIndex;
public int n_MissionIndex
{
get { return _MissionIndex; }
set { _MissionIndex = value; _MissionIndex.RandomizeCryptoKey(); }
} // 미션 별 고유 인덱스
public ePurpose e_Purpose; // 미션 달성 조건을 결정하기 위한 Enum 값
ObscuredInt _PurposeCount;
public int n_PurposeCount
{
get { return _PurposeCount; }
set { _PurposeCount = value; _PurposeCount.RandomizeCryptoKey(); }
} // 미션 달성 조건에 필요한 조건 수량
public eItem e_Reward; // 보상으로 지급 될 아이템의 타입
ObscuredInt _RewardID;
public int n_RewardID
{
get { return _RewardID; }
set { _RewardID = value; _RewardID.RandomizeCryptoKey(); }
} // 보상으로 지급 될 아이템의 ID 또는 설정 값
ObscuredInt _RewardAmount;
public int n_RewardAmount
{
get { return _RewardAmount; }
set { _RewardAmount = value; _RewardAmount.RandomizeCryptoKey(); }
} // 보상으로 지급 될 아이템의 수량
public bool b_GuideEffectShow; // 미션의 가이드 연출 제공 유무를 제어하기 위한 Bool 값
ObscuredInt _Chapter;
public int Chapter
{
get { return _Chapter; }
set { _Chapter = value; _Chapter.RandomizeCryptoKey(); }
} // Chapter 정보
ObscuredString _Desc;
public string Desc
{
get { return _Desc; }
set { _Desc = value; _Desc.RandomizeCryptoKey(); }
} // 미션 설명
// 테이블에 없는 값
ObscuredInt _MissionType;
public int MissionType
{
get { return _MissionType; }
set { _MissionType = value; _MissionType.RandomizeCryptoKey(); }
} // 미션 타입 (테이블에 없는 추가 값)
}
public class table_missionbase : MonoBehaviour
{
public TextAsset m_json;
protected string json_last;
protected bool LoadComplete = false;
protected virtual void Awake()
{
json_last = m_json.text;
Resources.UnloadAsset(m_json);
m_json = null;
// 첫 번째 객체 제거
int startIndex = json_last.IndexOf("{"); // 첫 번째 객체 시작
int endIndex = json_last.IndexOf("}") + 1; // 첫 번째 객체 끝
if (startIndex != -1 && endIndex != -1)
{
json_last = json_last.Remove(startIndex, endIndex - startIndex);
// 남은 데이터에서 불필요한 쉼표 제거
if (json_last.StartsWith(","))
json_last = json_last.Substring(1);
// JSON 배열 형태로 유지
json_last = "[" + json_last.TrimStart('[').TrimStart(',').TrimEnd(']').TrimEnd(',') + "]";
//json = $"{{\"table_abilityconfig\":{json}}}";
}
}
protected void Set_lastjson2()
{
#if UNITY_EDITOR
// TODO 정인호 : 임의로 만든 json 파일 오류 처리 (정식에선 지워야함)
int startIndex = json_last.IndexOf(","); // 첫 번째 객체 시작
int endIndex = json_last.IndexOf(",") + 1; // 첫 번째 객체 끝
json_last = json_last.Remove(startIndex, endIndex - startIndex);
#endif
}
protected virtual void Start() { LoadComplete = true; }
public bool Get_LoadComplete() { return LoadComplete; }
}