47 lines
1.4 KiB
C#
47 lines
1.4 KiB
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
using static XPlugin.Data.JsonLiteDB.JsonLiteDB;
|
|
|
|
public class BossPosData
|
|
{
|
|
public int ID;
|
|
public Vector3 BossPos;
|
|
public Vector3 BossAng;
|
|
public Vector3 DoorPos;
|
|
public Vector3 DoorAng;
|
|
public float DoorScale;
|
|
|
|
|
|
public BossPosData(TableReader table)
|
|
{
|
|
ID = table["ID"].OptInt();
|
|
float[] bossPos = ParseStringToFloatArray(table["BossPos"].OptString());
|
|
BossPos=new Vector3(bossPos[0], bossPos[1], bossPos[2]);
|
|
float[] bossAng = ParseStringToFloatArray(table["BossAng"].OptString());
|
|
BossAng=new Vector3(bossAng[0], bossAng[1], bossAng[2]);
|
|
float[] doorPos = ParseStringToFloatArray(table["DoorPos"].OptString());
|
|
DoorPos=new Vector3(doorPos[0], doorPos[1], doorPos[2]);
|
|
float[] doorAng = ParseStringToFloatArray(table["DoorAng"].OptString());
|
|
DoorAng=new Vector3(doorAng[0], doorAng[1], doorAng[2]);
|
|
DoorScale = table["DoorScale"].OptFloat();
|
|
}
|
|
|
|
float[] ParseStringToFloatArray(string input)
|
|
{
|
|
if (input == "")
|
|
{
|
|
return null;
|
|
}
|
|
string[] elements = input.Replace("(", "").Replace(")", "").Split(',');
|
|
float[] intArray = new float[elements.Length];
|
|
|
|
for (int i = 0; i < elements.Length; i++)
|
|
{
|
|
intArray[i] = float.Parse(elements[i]);
|
|
}
|
|
|
|
return intArray;
|
|
}
|
|
}
|