Exemplo n.º 1
0
    public override void OnInspectorGUI()
    {
        //Update our list

        GetTarget.Update();

        EditorGUILayout.PropertyField(csvFile);

        if (parsing.csvFile != null)
        {
            EditorGUILayout.Space();
            EditorGUILayout.Space();
            EditorGUILayout.LabelField("Import settings", EditorStyles.boldLabel);

            EditorGUILayout.PropertyField(assetName);

            AddPopup(ref characterConcerned, "Character :", typeof(PnjManager.CharacterType));

            if ((parsing.assetName != ""))
            {
                if (GUILayout.Button("IMPORT", GUILayout.MaxWidth(130), GUILayout.MaxHeight(20)))
                {
                    parsing.readData();
                }
            }
        }

        //Apply the changes to our list
        GetTarget.ApplyModifiedProperties();
    }
Exemplo n.º 2
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]));
            }
        }
    }