mirror of
https://github.com/GTA-ASM/SanAndreasUnity
synced 2024-11-23 12:33:02 +00:00
35 lines
No EOL
955 B
C#
35 lines
No EOL
955 B
C#
using SanAndreasUnity.Importing.Items.Placements;
|
|
using System.Collections.Generic;
|
|
using System.IO;
|
|
|
|
namespace SanAndreasUnity.Importing.Items
|
|
{
|
|
public class WaterFile
|
|
{
|
|
public readonly WaterFace[] Faces;
|
|
|
|
public WaterFile(string path)
|
|
{
|
|
var faces = new List<WaterFace>();
|
|
|
|
using (var reader = File.OpenText(path))
|
|
{
|
|
string line;
|
|
while ((line = reader.ReadLine()) != null)
|
|
{
|
|
line = line.Trim();
|
|
|
|
if (line.Length == 0) continue;
|
|
if (line.StartsWith("#")) continue;
|
|
if (line.StartsWith("processed")) continue;
|
|
|
|
faces.Add(new WaterFace(line));
|
|
}
|
|
}
|
|
|
|
UnityEngine.Debug.Log("Loading water file: \"" + path + "\" with " + faces.Count + " faces");
|
|
|
|
Faces = faces.ToArray();
|
|
}
|
|
}
|
|
} |