Exemple #1
0
        void UpdateSpriteBinState()
        {
            if (MachineUnattached)
            {
                baseSpriteHandler.ChangeSprite(1);
                overlaysSpriteHandler.PushClear();
                return;
            }

            switch (binState)
            {
            case BinState.Disconnected:
                rechargeSFX.Stop();
                baseSpriteHandler.ChangeSprite(0);
                overlaysSpriteHandler.PushClear();
                break;

            case BinState.Off:
                rechargeSFX.Stop();
                baseSpriteHandler.ChangeSprite(0);
                overlaysSpriteHandler.PushClear();
                break;

            case BinState.Ready:
                rechargeSFX.Stop();
                baseSpriteHandler.ChangeSprite(0);
                overlaysSpriteHandler.ChangeSprite(1);
                break;

            case BinState.Flushing:
                rechargeSFX.Stop();
                baseSpriteHandler.ChangeSprite(2);
                overlaysSpriteHandler.PushClear();
                break;

            case BinState.Recharging:
                rechargeSFX.Play();
                baseSpriteHandler.ChangeSprite(0);
                overlaysSpriteHandler.ChangeSprite(0);
                break;
            }

            BinStateUpdated?.Invoke();
        }
        private void UpdateSpriteBinState()
        {
            if (MachineUnattached)
            {
                baseSpriteHandler.ChangeSprite((int)BinSprite.Sideways);
                overlaysSpriteHandler.PushClear();
                return;
            }

            switch (binState)
            {
            case BinState.Disconnected:
                baseSpriteHandler.ChangeSprite((int)BinSprite.Upright);
                overlaysSpriteHandler.PushClear();
                break;

            case BinState.Off:
                baseSpriteHandler.ChangeSprite((int)BinSprite.Upright);
                overlaysSpriteHandler.PushClear();
                break;

            case BinState.Ready:
                baseSpriteHandler.ChangeSprite((int)BinSprite.Upright);
                overlaysSpriteHandler.ChangeSprite((int)BinOverlaySprite.Ready);
                break;

            case BinState.Flushing:
                baseSpriteHandler.ChangeSprite((int)BinSprite.Flushing);
                overlaysSpriteHandler.PushClear();
                break;

            case BinState.Recharging:
                baseSpriteHandler.ChangeSprite((int)BinSprite.Upright);
                overlaysSpriteHandler.ChangeSprite((int)BinOverlaySprite.Charging);
                break;
            }

            BinStateUpdated?.Invoke();
        }