private IEnumerator RunActions()
    {
        yield return(_itemController.GetPlayer().MovePlayer(transform.localPosition));

        if (!hasShownInitialScene.GetValue())
        {
            yield return(RunStoryTime());
        }

        if (_itemController.DidntGiveItems())
        {
            yield return(_itemController.GiveItems());

            _gaveItems = true;
        }
    }
示例#2
0
    private IEnumerator RecieveItemAnimation(InventoryItem item, GameObject itemObject)
    {
        _missingItems--;
        _itemController.canPlayerMove.SetValue(false);
        _isRecievingItem = true;

        yield return(_itemController.RecieveItemAnimation(item, itemObject));

        int n = _itemController.neededItems.IndexOf(item);

        _itemController.DestroySpeechItem(n);

        if (_missingItems == 0)
        {
            _animator.SetBool("happy", true);

            yield return(_itemController.GiveItems());

            _animator.SetBool("speechbubble", false);

            yield return(AnimationHelper.WaitForAnimation(_animator, 1));

            _itemController.neededItems.Clear();
            _itemController.DestroySpeechBubble();

            yield return(FadeOut());
        }

        _itemController.canPlayerMove.SetValue(true);
        _isRecievingItem = false;

        //Allows player to move again before destroying the gameObject
        if (_missingItems == 0)
        {
            Destroy(gameObject);
        }
    }