コード例 #1
0
 public void Execute()
 {
     for (int i = 0; i <= InstanceList.Length - 1; i++)
     {
         ItemSelectorInstanceInfo itemSelectorInstanceInfo = InstanceList[i];
         itemSelectorInstanceInfo.LastVisible = itemSelectorInstanceInfo.Visible;
         itemSelectorInstanceInfo.Visible     = 0;
         InstanceList[i] = itemSelectorInstanceInfo;
     }
 }
コード例 #2
0
 public void Execute()
 {
     for (int i = 0; i <= InstanceList.Length - 1; i++)
     {
         ItemSelectorInstanceInfo itemSelectorInstanceInfo = InstanceList[i];
         if (itemSelectorInstanceInfo.Visible != itemSelectorInstanceInfo.LastVisible)
         {
             VisibilityChangedIndexList.Add(i);
         }
     }
 }
コード例 #3
0
 public void ProcessEvents()
 {
     for (int i = 0; i <= _visibilityChangedIndexList.Length - 1; i++)
     {
         ItemSelectorInstanceInfo itemSelectorInstanceInfo = InstanceList[_visibilityChangedIndexList[i]];
         if (itemSelectorInstanceInfo.Visible == 1)
         {
             OnVegetationItemVisibleDelegate?.Invoke(itemSelectorInstanceInfo, _vegetationItemIndexes, VegetationItemID);
         }
         else
         {
             OnVegetationItemInvisibleDelegate?.Invoke(itemSelectorInstanceInfo, _vegetationItemIndexes, VegetationItemID);
         }
     }
 }
コード例 #4
0
 public void Execute()
 {
     for (int j = 0; j <= InstanceList.Length - 1; j++)
     {
         ItemSelectorInstanceInfo instanceInfo = InstanceList[j];
         for (int i = 0; i <= RemoveCellIndexList.Length - 1; i++)
         {
             if (instanceInfo.VegetationCellIndex == RemoveCellIndexList[i])
             {
                 instanceInfo.Remove = 1;
                 InstanceList[j]     = instanceInfo;
                 break;
             }
         }
     }
 }
コード例 #5
0
        public void Execute()
        {
            for (int i = 0; i <= InstanceList.Length - 1; i++)
            {
                ItemSelectorInstanceInfo itemSelectorInstanceInfo = InstanceList[i];
                float distance = math.distance(itemSelectorInstanceInfo.Position, CameraPosition);

                if (distance <= CullingDistance)
                {
                    itemSelectorInstanceInfo.Visible = 1;
                }
                else
                {
                    itemSelectorInstanceInfo.Visible = -1;
                }

                InstanceList[i] = itemSelectorInstanceInfo;
            }
        }
コード例 #6
0
        public void Execute()
        {
            for (int i = MatrixInstanceList.Length - 1; i >= 0; i--)
            {
                MatrixInstance matrixInstance = MatrixInstanceList[i];

                ItemSelectorInstanceInfo itemSelectorInstanceInfo = new ItemSelectorInstanceInfo
                {
                    VegetationCellIndex     = VegetationCellIndex,
                    VegetationCellItemIndex = i,
                    Position    = ExtractTranslationFromMatrix(matrixInstance.Matrix),
                    Scale       = ExtractScaleFromMatrix(matrixInstance.Matrix),
                    Rotation    = ExtractRotationFromMatrix(matrixInstance.Matrix),
                    LastVisible = -1,
                    Visible     = -1
                };

                InstanceList.Add(itemSelectorInstanceInfo);
            }
        }