Beispiel #1
0
    private void Check()
    {
        //  timebk = next_Timechuo.Time_Line + Range(next_Timechuo.rand_min_O, next_Timechuo.rand_max_O);
        if (timebk < timeline)
        {
            //敌人生成

            if (DateTime.Now.Millisecond % 2 == 1)
            {
                initmoster(upper_init, lower_init, speed * (Range(next_Timechuo.rand_min_O, next_Timechuo.rand_max_O) + (next_Timechuo.target_speed / 100)));
            }
            else
            {
                initmoster(lower_init, upper_init, speed * (Range(next_Timechuo.rand_min_O, next_Timechuo.rand_max_O) + (next_Timechuo.target_speed / 100)));
            }

            timebk += Range(next_Timechuo.rand_min_B, next_Timechuo.rand_max_B);
            // initmoster(GameObject upper, GameObject lower, float speed)
            //更新时间戳
            if (timebk > config[r_index + 1].Time_Line)
            {
                next_Timechuo = config[r_index + 1];
                r_index++;
            }
        }
    }
Beispiel #2
0
    public void Read(string path)
    {
        StreamReader sr = new StreamReader(path, Encoding.Default);
        string       line;

        while ((line = sr.ReadLine()) != null)
        {
            string sline = line.ToString();
            if (sline.Length > 20 && sline.Length < 40)
            {
                rand_interval r_temp  = new rand_interval();
                string[]      ls_temp = sline.Split('\t');
                r_temp.Time_Line    = (float)Convert.ToDouble(ls_temp[0]);
                r_temp.rand_min_O   = (float)Convert.ToDouble(ls_temp[1]);
                r_temp.rand_max_O   = (float)Convert.ToDouble(ls_temp[2]);
                r_temp.rand_min_P   = (float)Convert.ToDouble(ls_temp[3]);
                r_temp.rand_max_P   = (float)Convert.ToDouble(ls_temp[4]);
                r_temp.rand_min_B   = (float)Convert.ToDouble(ls_temp[5]);
                r_temp.rand_max_B   = (float)Convert.ToDouble(ls_temp[6]);
                r_temp.target_speed = (float)Convert.ToDouble(ls_temp[7]);
                r_temp.Promote_time = (float)Convert.ToDouble(ls_temp[8]);
                config.Add(r_temp);
            }
        }
    }