Example #1
0
    public void LoadFile(string f)
    {
        //http://answers.unity3d.com/questions/9960/how-do-i-let-the-user-select-a-local-file-for-my-a.html
        //dbgString = "should load "+f;

        GameObject go = new GameObject("PointCloud");
        pc = go.AddComponent<PointCloud>();
        pc.particleSystem.renderer.material = pointsMaterial;

        //GameObject p = new GameObject("pointcloud");
        //PointCloud pc = Instantiate(pointCloudPrefab) as PointCloud; //p.AddComponent<ParticleSystem>();
        //PointCloud pc = ps.GetComponent<PointCloud>();
        pc.LoadPointsFromPts(f);

        cameraRotater.position = pc.transform.position;

        //Debug.Log("loaded file, now reseting particles");
        //pc.ResetParticles();//why not????
        CancelInvoke("RestartParticlesLater");
        Invoke("ResetParticlesLater", 6f);//why?????    what a hack!

        clouds.Add(pc);

        dbgString+="\nloaded file "+num;
        num++;
    }