コード例 #1
0
 void InitLists(List <Point> from, List <Point>[] to, int m, int type, ref int count)
 {
     for (int i = 0; i < from.Count; i++)
     {
         if (from[i].type != type)
         {
             continue;
         }
         foreach (List <Point> NewP in to)
         {
             if (NewP.Count != 0)
             {
                 for (int j = 0; j < NewP.Count; j++)
                 {
                     if (i >= from.Count)
                     {
                         i = from.Count - 1;
                     }
                     if (from.Count == 0)
                     {
                         break;
                     }
                     if (NewP[j].type != from[i].type)
                     {
                         break;
                     }
                     if (Math.Abs(from[i].latitude - NewP[j].latitude) <= m * metr && Math.Abs(from[i].latitude - NewP[j].latitude) <= m * metr)
                     {
                         NewP.Add(from[i]);
                         from.Remove(from[i]);
                     }
                 }
             }
             else
             {
                 NewP.Add(from[i]);
                 from.Remove(from[i]);
             }
         }
     }
     foreach (List <Point> NewP in to)
     {
         if (NewP != null)
         {
             if (NewP.Count == 1)
             {
                 for (int i = 0; i < NewP.Count; i++)
                 {
                     from.Add(NewP[i]);
                     NewP.Remove(NewP[i]);
                 }
             }
             count++;
         }
     }
 }
コード例 #2
0
ファイル: LaunchOBJ.cs プロジェクト: Mightybeast12/VR-Racing
 // Update is called once per frame
 void Update()
 {
     spawnspeed -= Time.deltaTime;
     if (spawnspeed <= 0)
     {
         GameObject NewP;
         NewP = Instantiate(PetrolpiecePreFAB, EngineBlockSPWN.position, EngineBlockSPWN.rotation);
         NewP.AddComponent <Rigidbody>().AddForce(Target.position - transform.position * Speed, ForceMode.Impulse);
         spawnspeed = ogspawnspeed;
         Nexttarget();
     }
 }