Last active
August 26, 2019 14:58
-
-
Save rkandas/f2f3d55ab737dcc212735afc016b9a70 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class AssetSpawner | |
{ | |
public void createAGameObjectFromString(String csvString) | |
{ | |
String[] tokens = csvString.Split(",".ToCharArray()); | |
if (tokens.Length >= 4) | |
{ | |
GameObject cube = GameObject.CreatePrimitive(PrimitiveType.Cube); | |
Vector3 position = new Vector3(float.Parse(tokens[1]),float.Parse(tokens[2]),float.Parse(tokens[3])); | |
cube.name = tokens[0]; | |
cube.transform.position = position; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment