Esempio n. 1
0
    void getBasePositionsFromCSVS()
    {
        basePositionCSVS = new string[]
        { "Points/points-surface-0",
          "Points/points-surface-1",
          "Points/points-surface-2",
          "Points/points-surface-3" };

        for (int i = 0; i < basePositionCSVS.Length; i++)
        {
            TextAsset pointsCSV = Resources.Load(basePositionCSVS[i]) as TextAsset;

            CSVParsing c = new CSVParsing(pointsCSV, 3);
            string[,] pointsStrings = c.readData();

            if (i == 0)
            {
                basePositions = new Vector3[basePositionCSVS.Length, pointsStrings.GetLength(0)];
            }

            //TO-DO - ending up with nulls in the array - need to add some better handl ing
            for (int j = 0; j < pointsStrings.GetLength(0); j++)
            {
                basePositions[i, j] = new Vector3(float.Parse(pointsStrings[j, 0]), float.Parse(pointsStrings[j, 1]), float.Parse(pointsStrings[j, 2]));
            }
        }
    }
Esempio n. 2
0
 void OnEnable()
 {
     parsing            = (CSVParsing)target;
     GetTarget          = new SerializedObject(parsing);
     csvFile            = GetTarget.FindProperty("csvFile");
     characterConcerned = GetTarget.FindProperty("characterConcerned");
     assetName          = GetTarget.FindProperty("assetName");
 }