예제 #1
0
파일: Space.cs 프로젝트: hatajoe/streeeeam
    private void CreateCommetForPUN(int count)
    {
        this.commets = new List <Commet> ();

        for (int i = 0; i < count; i++)
        {
            float y            = this.GetRandomByRange(COMMET_INITIAL_POS_Y_MIN, COMMET_INITIAL_POS_Y_MAX);
            float initialDelta = this.GetRandomByRange(COMMET_INITIAL_DELTA_MIN, COMMET_INITIAL_DELTA_MAX);
            float velocity     = this.GetRandomByRange(COMMET_VELOCITY_MIN, COMMET_VELOCITY_MAX);
            float scale        = this.GetRandomByRange(COMMET_SCALE_MIN, COMMET_SCALE_MAX);

            GameObject obj = PhotonNetwork.Instantiate(commet.name, commet.transform.position, commet.transform.localRotation, 0);

            Commet c = obj.GetComponentInChildren <Commet>();
            c.Init(y, initialDelta, velocity, scale);
            this.commets.Add(c);
        }
    }
예제 #2
0
파일: Space.cs 프로젝트: hatajoe/streeeeam
    private void CreateCommet(int count)
    {
        this.commets = new List <Commet> ();

        for (int i = 0; i < count; i++)
        {
            float y            = this.GetRandomByRange(COMMET_INITIAL_POS_Y_MIN, COMMET_INITIAL_POS_Y_MAX);
            float initialDelta = this.GetRandomByRange(COMMET_INITIAL_DELTA_MIN, COMMET_INITIAL_DELTA_MAX);
            float velocity     = this.GetRandomByRange(COMMET_VELOCITY_MIN, COMMET_VELOCITY_MAX);
            float scale        = this.GetRandomByRange(COMMET_SCALE_MIN, COMMET_SCALE_MAX);

            GameObject obj = (GameObject)Instantiate(commet);

            Commet c = obj.GetComponentInChildren <Commet>();
            c.Init(y, initialDelta, velocity, scale);
            this.commets.Add(c);
        }
    }