Пример #1
0
 public void Activate(SwarmObject obj)
 {
     if (objectPlacer != null && obj != null)
     {
         if (behaviour == OnClickBehaviour.Ripple)
         {
             List <SwarmObject>[] neighbours = objectPlacer.GetNeighbours(obj, size);
             for (int i = 0; i < neighbours.Length; i++)
             {
                 foreach (SwarmObject item in neighbours[i])
                 {
                     if (item != null && objectPlacer == item.Parent)
                     {
                         float _amp = amplitude - distanceFalloff * i;
                         item.Wobble(objectPlacer.GetDirection(), _amp, amplitudeCutoff, speed, time, delay * i);
                     }
                 }
             }
         }
         else
         {
             print("Behavior not defined");
         }
     }
 }