示例#1
0
    private void OnApplicationQuit()
    {
        GameObject  quadm = GameObject.Find("Quads");
        QuadManager cs    = quadm.GetComponent <QuadManager>();

        string path = Application.dataPath + "/ParseVars.txt";

        high_score = Environment.NewLine + "High Score: " + cs.highscore;
        for (int i = 0; i < cs.round.Count; ++i)
        {
            rounds += Environment.NewLine + "Num round: " + i;
            for (int j = 0; j < cs.round[i].level.Count; ++j)
            {
                rounds += Environment.NewLine + "Level: " + j;
                rounds += Environment.NewLine + "Lifes lost:    " + cs.round[i].level[j].lifes_lose;
                rounds += Environment.NewLine + "Start time:    " + cs.round[i].level[j].start_time;
                rounds += Environment.NewLine + "Total time:    " + cs.round[i].level[j].total_time;
            }

            rounds += Environment.NewLine + "Max level: " + cs.round[i].level.Count;
            rounds += Environment.NewLine + "Score: " + cs.round[i].score;
            rounds += Environment.NewLine + "Lifes: " + cs.round[i].life;
            rounds += Environment.NewLine + "Start time:    " + cs.round[i].start_time;
            rounds += Environment.NewLine + "Total time:    " + cs.round[i].total_time;
        }

        logout = Environment.NewLine + "----Logout date:  " + System.DateTime.Now + "----" + Environment.NewLine;
        File.AppendAllText(path, number_games);
        File.AppendAllText(path, high_score);
        File.AppendAllText(path, rounds);
        File.AppendAllText(path, total_time_playing);
        File.AppendAllText(path, logout);
    }
    void Start()
    {
        CreateDepthColorLookup();

        low = MaxDepth;

        if (kinectManager == null)
        {
            GameObject go = GameObject.Find("goKinectManager");
            kinectManager = go.GetComponent <KinectManager>();
        }

        if (quadManager == null)
        {
            GameObject go = GameObject.Find("goClippingQuad");
            quadManager = go.GetComponent <QuadManager>();
        }

        particles     = this.gameObject.GetComponent <ParticleSystem>();
        goodParticles = new List <ParticleSystem.Particle>();

        InvokeRepeating("UpdateKinectMesh2", 3.0f, 2.0f);
    }
    void Start()
    {
        CreateDepthColorLookup();

        low = MaxDepth;

        if (kinectManager == null)
        {
            GameObject go = GameObject.Find("goKinectManager");
            kinectManager = go.GetComponent<KinectManager>();
        }

        if ( quadManager == null )
        {
            GameObject go = GameObject.Find("goClippingQuad");
            quadManager = go.GetComponent<QuadManager>();
        }

        particles = this.gameObject.GetComponent<ParticleSystem>();
        goodParticles = new List<ParticleSystem.Particle>();

        InvokeRepeating("UpdateKinectMesh2", 3.0f, 2.0f);
    }