Files
XMen/Assets/Scripts/Data/StoryInfo1.cs
2025-07-10 14:49:53 +08:00

70 lines
1.4 KiB
C#

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using static XPlugin.Data.JsonLiteDB.JsonLiteDB;
public class StoryInfo1
{
/// <summary>
/// 剧情ID
/// </summary>
public int ID = -1;
/// <summary>
/// 下一段剧情ID
/// </summary>
public int NextId = -1;
public int PropId = -1;
public float[] PropInit = null;
public int Portal;
/// <summary>
/// 传送门初始信息
/// </summary>
public int[] PortalInit = null;
public bool UnLock;
public StoryInfo1(TableReader table)
{
ID = table["ID"].OptInt();
NextId = table["NextId"].OptInt();
PropId = ParsingStringToInt(table, table["ID"].OptString());
}
public int ParsingStringToInt(TableReader table, string input)
{
int value = -1;
if (input != "")
{
value = table[input].OptInt();
}
return value;
}
float[] ParsingStringToFloatArray(string input)
{
if (input == "")
{
return null;
}
string[] elements = input.Replace("(", "").Replace(")", "").Split(',');
float[] floatArray = new float[elements.Length];
for (int i = 0; i < elements.Length; i++)
{
floatArray[i] = float.Parse(elements[i]);
}
return floatArray;
}
}