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

55 lines
1.9 KiB
C#

using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
[Serializable]
public class MissionTableData : TableDataBase
{
public int n_MissionIndex; // 미션 별 고유 인덱스
public ePurpose e_Purpose; // 미션 달성 조건을 결정하기 위한 Enum 값
public int n_PurposeCount; // 미션 달성 조건에 필요한 조건 수량
public eItem e_Reward; // 보상으로 지급 될 아이템의 타입
public int n_RewardID; // 보상으로 지급 될 아이템의 ID 또는 설정 값
public int n_RewardAmount; // 보상으로 지급 될 아이템의 수량
public bool b_GuideEffectShow; // 미션의 가이드 연출 제공 유무를 제어하기 위한 Bool 값
public int Chapter; //
public string Desc; //
// 테이블에 없는 값
public int MissionType;
}
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 virtual void Start() { LoadComplete = true; }
public bool Get_LoadComplete() { return LoadComplete; }
}