Stop() публичный Метод

Stop the currently playing clip.
public Stop ( ) : void
Результат void
Пример #1
0
    void setState(BlenderState state, float delay = -1)
    {
        if (delay == -1)
        {
            switch (state)
            {
            case BlenderState.IDLE:
                if (_currentProduct != ItemTypes.UNKNOWN)
                {
                    _sprite.Stop();
                    Inventory.instance.addStuf(_currentProduct.ToString());
                    _currentProduct = ItemTypes.UNKNOWN;
                }

                resetToDefaults();
                indicator.Stop();
                indicator.gameObject.SetActive(false);
                break;

            case BlenderState.WORK_NORMAL:
                break;

            case BlenderState.WORK_DANGER:
                setState(BlenderState.BROCKEN, getAction("MAKE_ORANGE").actionTime);
                break;

            case BlenderState.BROCKEN:
                _sprite.Stop();

                brockenSprite.gameObject.SetActive(true);

                if (_currentProduct == ItemTypes.APPLE_JUCE)
                {
                    ContentManager.instance.configureObject(brockenSprite, settings.spriteAtlas, usettings.brockenAppleSprite);
                }
                else
                {
                    ContentManager.instance.configureObject(brockenSprite, settings.spriteAtlas, usettings.brockenOrangeSprite);
                }

                break;

            default:
                Logger.message(LogLevel.LOG_ERROR, "Unknown blender state - " + state.ToString());
                break;
            }

            _state = state;
        }
        else
        {
            _nextState = state;
            Invoke("onStateChanged", delay);
        }
    }
    void setState(CoffeeMachineState state, float delay = -1)
    {
        if (delay == -1)
        {
            switch (state)
            {
            case CoffeeMachineState.IDLE:
                if (_currentProduct != ItemTypes.UNKNOWN)
                {
                    Inventory.instance.addStuf(_currentProduct.ToString());
                    _currentProduct = ItemTypes.UNKNOWN;
                }

                indicator.Stop();
                indicator.gameObject.SetActive(false);
                resetToDefaults();
                break;

            case CoffeeMachineState.WORK_NORMAL:
                break;

            case CoffeeMachineState.WORK_DANGER:
                playTimerAnimation(timerRedAnimation);
                setState(CoffeeMachineState.BROCKEN, usettings.brockenTime);
                break;

            case CoffeeMachineState.BROCKEN:
                _sprite.Stop();

                break;

            default:
                Logger.message(LogLevel.LOG_ERROR, "Unknown coffee machine state - " + state.ToString());
                break;
            }

            _state = state;
        }
        else
        {
            _nextState = state;
            Invoke("onStateChanged", delay);
        }
    }
Пример #3
0
        public override void Destroy()
        {
            Debug.Log("BuffGeneric.Destroy()");

            if (m_BuffAnimLib != null)
            {
                m_BuffAnimLib = null;
            }
            if (m_BuffSprite != null)
            {
                m_BuffSprite.Stop();
                GameObject.Destroy(m_BuffSprite.gameObject);
                m_BuffSprite = null;
            }

            if (m_BuffObj != null)
            {
                GameObject.Destroy(m_BuffObj);
            }
        }
Пример #4
0
    void walk()
    {
        sprite.transform.localScale = new Vector3(-attackDirection.x - attackDirection.y, 1, 1);

        var movement    = walkDirection * speed * Time.deltaTime;
        var newPosition = transform.position + new Vector3(movement.x, 0, movement.y);

        if (transform.position == newPosition)
        {
            sprite.Stop();
        }
        else if (!sprite.IsPlaying(sprite.CurrentClip))
        {
            sprite.Play();
        }

        if (canWalk(newPosition))
        {
            transform.position = newPosition;
        }
    }
Пример #5
0
 public void setSpriteId(int id)
 {
     sprite.Stop();
     sprite.clipId = id;
     sprite.Start();
 }