Beispiel #1
0
 //雨生成
 void GenerateRain()
 {
     foreach (var item in LayerOfMain.Objects)
     {
         if (item is Cloud)
         {
             if (item.Position.X > CameraOfMain.Src.Position.X + CameraOfMain.Src.Width + 1300.0f)
             {
                 continue;
             }
             Rain rain = ((Cloud)item).GenerateRain();
             if (rain == null)
             {
                 continue;
             }
             LayerOfMain.AddObject(rain);
             Rains.Add(rain);
             RegisterWallRainColligeData(rain);
         }
     }
 }
Beispiel #2
0
        //オブジェクト破棄
        void DisposeObject()
        {
            for (int i = 0; i < Walls.Count; i++)
            {
                if (Walls[i].Position.X < CameraOfMain.Src.Position.X - 300.0f)
                {
                    Walls[i].Dispose();
                    Walls.RemoveAt(i);
                    if (Walls.Count == i)
                    {
                        break;
                    }
                    i--;
                }
                else if (!Walls[i].IsAlive)
                {
                    Walls.RemoveAt(i);
                    if (Walls.Count == i)
                    {
                        break;
                    }
                    i--;
                }
            }

            for (int i = 0; i < Clouds.Count; i++)
            {
                if (Clouds[i].Position.X < CameraOfMain.Src.Position.X - 300.0f)
                {
                    Clouds[i].Dispose();
                    Clouds.RemoveAt(i);
                    if (Clouds.Count == i)
                    {
                        break;
                    }
                    i--;
                }
                else if (!Clouds[i].IsAlive)
                {
                    Clouds.RemoveAt(i);
                    if (Clouds.Count == i)
                    {
                        break;
                    }
                    i--;
                }
            }

            for (int i = 0; i < Rains.Count; i++)
            {
                if (Rains[i].Position.X < CameraOfMain.Src.Position.X - 300.0f)
                {
                    Rains[i].Dispose();
                    Rains.RemoveAt(i);
                    if (Rains.Count == i)
                    {
                        break;
                    }
                    i--;
                }
                else if (!Rains[i].IsAlive)
                {
                    Rains.RemoveAt(i);
                    if (Rains.Count == i)
                    {
                        break;
                    }
                    i--;
                }
            }

            for (int i = 0; i < Healers.Count; i++)
            {
                if (Healers[i].Position.X < CameraOfMain.Src.Position.X - 300.0f)
                {
                    Healers[i].Dispose();
                    Healers.RemoveAt(i);
                    if (Healers.Count == i)
                    {
                        break;
                    }
                    i--;
                }
                else if (!Healers[i].IsAlive)
                {
                    Healers.RemoveAt(i);
                    if (Healers.Count == i)
                    {
                        break;
                    }
                    i--;
                }
            }

            for (int i = 0; i < Winds.Count; i++)
            {
                if (Winds[i].Position.X < CameraOfMain.Src.Position.X - 300.0f)
                {
                    Winds[i].Dispose();
                    Winds.RemoveAt(i);
                    if (Winds.Count == i)
                    {
                        break;
                    }
                    i--;
                }
                else if (!Winds[i].IsAlive)
                {
                    Winds.RemoveAt(i);
                    if (Winds.Count == i)
                    {
                        break;
                    }
                    i--;
                }
            }
        }