Ejemplo n.º 1
0
        private void OnLastStackSwitch(object sender, SwitchEventArgs switchEventArgs)
        {
            if (!switchEventArgs.IsEnabled && UncountedStackBalls > 0)
            {
#if UNITY_EDITOR
                RefreshUI();
#endif
                UncountedStackBalls--;
                RollOverEntryBall(MainComponent.RollTime / 2);
#if UNITY_EDITOR
                RefreshUI();
#endif
            }
        }
Ejemplo n.º 2
0
 /// <summary>
 /// Destroys the ball and simulates a drain.
 /// </summary>
 private void OnEntry(object sender, SwitchEventArgs args)
 {
     if (args.IsEnabled)
     {
         Logger.Info("Draining ball into trough.");
         if (_drainSwitch is KickerApi kickerApi)
         {
             kickerApi.DestroyBall();
         }
         else
         {
             BallManager.DestroyEntity(args.BallEntity);
         }
         DrainBall();
     }
     else
     {
         Logger.Error("Draining ball into trough.");
     }
 }