/// <summary>
        /// Applied before TriggerStop runs.
        /// </summary>
        internal static bool Prefix(KBatchedAnimController __instance)
        {
            var anim = __instance.CurrentAnim;

            if (__instance.animQueue.Count > 0)
            {
                __instance.StartQueuedAnim();
            }
            else if (anim != null && __instance.mode == KAnim.PlayMode.Once)
            {
                __instance.currentFrame = anim.numFrames - 1;
                __instance.Stop();
                DeferAnimQueueTrigger.TriggerAndQueue(__instance, (int)GameHashes.
                                                      AnimQueueComplete, null);
            }
            return(false);
        }
 public FishFeederBot(Instance smi, float mass_per_ball, HashedString[] ball_symbols)
 {
     this.smi    = smi;
     massPerBall = mass_per_ball;
     anim        = GameUtil.KInstantiate(Assets.GetPrefab("FishFeederBot"), smi.transform.GetPosition(), Grid.SceneLayer.Front, null, 0).GetComponent <KBatchedAnimController>();
     anim.transform.SetParent(smi.transform);
     anim.gameObject.SetActive(true);
     anim.SetSceneLayer(Grid.SceneLayer.Building);
     anim.Play("ball", KAnim.PlayMode.Once, 1f, 0f);
     anim.Stop();
     foreach (HashedString hash in ball_symbols)
     {
         anim.SetSymbolVisiblity(hash, false);
     }
     Storage[] components = smi.gameObject.GetComponents <Storage>();
     topStorage = components[0];
     botStorage = components[1];
 }