Example #1
0
 public void ImportBallData(GGbrahData data)
 {
     //go.transform.position = new Vector3(data.position[0], data.position[1], data.position[2]);
     //mr.material.color = new Color(data.rgb[0], data.rgb[1], data.rgb[2]);
     //rb.velocity = new Vector3(data.velocity[0], data.velocity[1], data.velocity[2]);
     position = new Vector3(data.position[0], data.position[1], data.position[2]);
     color    = new Color(data.rgb[0], data.rgb[1], data.rgb[2]);
     velocity = new Vector3(data.velocity[0], data.velocity[1], data.velocity[2]);
 }
Example #2
0
    public GameObject GGBrahToGameObject(GGbrahData gg, int i)
    {
        GameObject go = GameObject.Instantiate(Resources.Load("Prefabs/ballprefab") as GameObject);

        go.transform.position = new Vector3(gg.position[0], gg.position[1], gg.position[2]);
        go.GetComponent <Rigidbody>().velocity          = new Vector3(gg.velocity[0], gg.velocity[1], gg.velocity[2]);
        go.GetComponent <MeshRenderer>().material.color = new Color(gg.rgb[0], gg.rgb[1], gg.rgb[2]);
        return(go);
    }
Example #3
0
    public void Loadbutton()
    {
        ggbrah = LoadDataFromDisk <GGbrahData>(fileName);
        int count = ggbrah.list.Count;

        ClearGOList(goList);

        for (int i = 0; i < count; i++)
        {
            //GameObject go = GGBrahToGameObject(ggbrah.list[i], i);
            goList.Add(GGBrahToGameObject(ggbrah.list[i], i));
        }
    }
Example #4
0
 public void Start()
 {
     ggbrah = new GGbrahData();
     goList = new List <GameObject>();
 }