Синтаксис:
Используется csharp
(1258.0, 650.0, 0.0)
(1194.0, 616.0, 0.0)
(1122.0, 597.0, 0.0)
(1054.0, 634.0, 0.0)
(993.0, 673.0, 0.0)
(917.0, 684.0, 0.0)
(852.0, 650.0, 0.0)
(797.0, 605.0, 0.0)
(751.0, 558.0, 0.0)
(722.0, 506.0, 0.0)
(780.0, 469.0, 0.0)
(1194.0, 616.0, 0.0)
(1122.0, 597.0, 0.0)
(1054.0, 634.0, 0.0)
(993.0, 673.0, 0.0)
(917.0, 684.0, 0.0)
(852.0, 650.0, 0.0)
(797.0, 605.0, 0.0)
(751.0, 558.0, 0.0)
(722.0, 506.0, 0.0)
(780.0, 469.0, 0.0)
ну допустим я смог это считать в лист или допустим набить массив. Но только в string
Синтаксис:
Используется csharp
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using System.IO;
using System.Text;
public class logic : MonoBehaviour
{
public List<string> myArr = new List<string>();
public GameObject obj;
void Start()
{
myArr.AddRange(File.ReadAllLines(@"C:\\Users\\999\\Documents\\Test\\Assets\\TestFile.txt", System.Text.Encoding.GetEncoding(1251)));
for (int i = 0; i < myArr.Count; i++)
{
Instantiate(obj, new Vector3(????), Quaternion.identity);
}
}
}
using System.Collections.Generic;
using UnityEngine;
using System.IO;
using System.Text;
public class logic : MonoBehaviour
{
public List<string> myArr = new List<string>();
public GameObject obj;
void Start()
{
myArr.AddRange(File.ReadAllLines(@"C:\\Users\\999\\Documents\\Test\\Assets\\TestFile.txt", System.Text.Encoding.GetEncoding(1251)));
for (int i = 0; i < myArr.Count; i++)
{
Instantiate(obj, new Vector3(????), Quaternion.identity);
}
}
}
теперь мне надо по этим координатам раскидать объекты. Я понимаю что надо парсить string в int. Но как скормить целиком строку в Instantiate(obj, new Vector3(????). или я не правильно подхожу к этому делу? Объясните пожалуйста. Спасибо