Exemplo n.º 1
0
    private IEnumerator StateVibrateEye()
    {
        yield return(YieldInstructionCache.WaitingSecond(1.0f));

        viberateEye.gameObject.SetActive(true);
        viberateEye.Execute();
    }
Exemplo n.º 2
0
        protected override IEnumerator SlidingCoroutine()
        {
            canSlide = true;
            int type = (int)ControlTypeAbnormalStatus.SLIDING;

            abnormalComponents.SlidingEffect.SetActive(true);
            AddRetrictsMovingCount();
            AddRetrictsBehaviorCount();
            //animationHandler.Idle();
            isControlTypeAbnormalStatuses[type] = true;
            Vector2 dirVector = controller.GetMoveRecentNormalInputVector();

            Debug.Log("sliding 코루틴 시작, " + dirVector);
            while (CharacterInfo.AbnormalImmune.SLIDING != (abnormalImmune & CharacterInfo.AbnormalImmune.SLIDING))
            {
                if (IsMine())
                {
                    // TODO : Modify Sliding animation
                    components.AnimHandler.Walk();
                    bodyTransform.Translate(dirVector * movingSpeed * Time.fixedDeltaTime);
                }
                if (false == canSlide)
                {
                    components.AnimHandler.Idle();
                    Debug.Log("sliding 코루틴 종료");
                    break;
                }
                yield return(YieldInstructionCache.WaitForSeconds(Time.fixedDeltaTime));
            }
            StopControlTypeAbnormalStatus(ControlTypeAbnormalStatus.SLIDING);
        }
Exemplo n.º 3
0
    private IEnumerator SetTransparency()
    {
        if (transparencySwitch == 1)
        {
            transparency      -= 0.2f;
            titleTransparency -= 0.1f;
        }
        else if (transparencySwitch == 0)
        {
            transparency      += 0.2f;
            titleTransparency -= 0.1f;
        }
        yield return(YieldInstructionCache.WaitingSecond(0.15f));

        if (transparency < 0.2f)
        {
            transparencySwitch = 0;
        }
        else if (transparency.Equals(1.0f))
        {
            transparencySwitch = 1;
        }

        if (titleTransparency < 0.4f)
        {
            titleTransparency = 1.0f;
        }
        StartCoroutine(SetTransparency());
    }
Exemplo n.º 4
0
    private IEnumerator ExecuteCoroutine()
    {
        isTweening = true;

        objectTweens.Add(circleImage.DOFade(1.0f, 0.25f));

        for (int i = 0; i < rectangleImages.Length; i++)
        {
            rectangleImages[i].DOFade(1.0f, 0.25f);
            if (i % 2 == 0)
            {
                objectTweens.Add(rectangleImages[i].gameObject.transform.DORotate(leftRotateVector, 0.35f, RotateMode.FastBeyond360));
            }
            else
            {
                objectTweens.Add(rectangleImages[i].gameObject.transform.DORotate(rightRotateVector, 0.25f, RotateMode.FastBeyond360));
            }
        }

        objectTweens.Add(circleImage.gameObject.transform.DOScale(sizeUpScale, 0.35f));

        yield return(YieldInstructionCache.WaitingSeconds(0.25f));

        for (int i = 0; i < rectangleImages.Length; i++)
        {
            objectTweens.Add(rectangleImages[i].DOFade(0, 0.25f));
        }

        objectTweens.Add(circleImage.DOFade(0, 0.25f));


        yield return(YieldInstructionCache.WaitingSeconds(0.5f));

        ObjectOff();
    }
Exemplo n.º 5
0
    private IEnumerator ExecuteCoroutine()
    {
        int i = 0;

        do
        {
            Monster generatedMonster;
            int     monsterGeneratePositionIndex = Random.Range(0, monsterGeneratePositions.Length);

            if (beforeGeneratePositionIndex.Contains(monsterGeneratePositionIndex))
            {
                continue;
            }

            generatedMonster = GetAvailableMonster();
            generatedMonster.gameObject.transform.position = monsterGeneratePositions[monsterGeneratePositionIndex].position;
            generatedMonster?.Execute();

            beforeGeneratePositionIndex.Add(monsterGeneratePositionIndex);

            yield return(YieldInstructionCache.WaitingSecond(0.1f));
        }while(i < 4 && getActiveMonsterCount() < 4);

        beforeGeneratePositionIndex.Clear();
    }
Exemplo n.º 6
0
    public IEnumerator EndGame()
    {
        yield return(YieldInstructionCache.WaitForSeconds(2.0f));

        StartCoroutine(_uiManager.Fade(true));
        _player.SetActive(false);
    }
Exemplo n.º 7
0
    private IEnumerator HitDetermination()
    {
        Color color = _SpriteRenderer.color;

        _isAttackPossible = false;

        _HighLight.SetActive(true);
        _damegedEffect.SetActive(true);
        color.a = 0.5f; _SpriteRenderer.color = color;
        yield return(YieldInstructionCache.WaitForSeconds(0.25f));

        _HighLight.SetActive(false);
        color.a = 1.0f; _SpriteRenderer.color = color;

        yield return(YieldInstructionCache.WaitForSeconds(0.25f));

        color.a = 0.5f; _SpriteRenderer.color = color;
        yield return(YieldInstructionCache.WaitForSeconds(0.25f));

        color.a = 1.0f; _SpriteRenderer.color = color;
        yield return(YieldInstructionCache.WaitForSeconds(0.25f));

        color.a = 0.5f; _SpriteRenderer.color = color;
        yield return(YieldInstructionCache.WaitForSeconds(0.25f));

        color.a = 1.0f; _SpriteRenderer.color = color;

        _damegedEffect.SetActive(false);
        _isAttackPossible = true;
    }
Exemplo n.º 8
0
    private IEnumerator Start()
    {
        sequence = DOTween.Sequence()
                   .AppendCallback(() => sign.color = Color.clear)
                   .AppendInterval(0.5F)
                   .AppendCallback(() =>
        {
            sign.SetNativeSize();
            sign.color = Color.white;
        })
                   .AppendInterval(0.5F)
                   .Append(sign.DOFade(0F, 0.5F))
                   .SetAutoKill(false);

        while (true)
        {
            float waitingTime = Random.Range(2, 9);
            yield return(YieldInstructionCache.WaitingSeconds(waitingTime));

            shouldRenew = false;

            DogFactory.SetRandomDog(this);
            image.DOFade(1F, 0.5F);
            tween = DOVirtual.DelayedCall(8F, () => shouldRenew = true).Play();

            yield return(new WaitUntil(() => shouldRenew));

            image.DOFade(0F, 0.5F);
            tween.Kill();
            Index = -1;
        }
    }
Exemplo n.º 9
0
    private IEnumerator EndTeleport()
    {
        // 이펙트
        for (int i = 0; i < _EndSprites.Length; ++i)
        {
            _SpriteRenderer.sprite = _EndSprites[i];
            yield return(YieldInstructionCache.WaitForSeconds(0.01f));

            if (i == 6)
            {
                _player.transform.localScale = Vector3.one;
                _weapon.transform.localScale = Vector3.one;
                // 플레이어 이동
                _player.transform.position = this.transform.position;
                _weapon.transform.position = this.transform.position;
            }
        }
        // 위치 고정 해제
        _playerController.CanMove = true;

        _SpriteRenderer.sprite = null;

        _isTeleport = false;
        this.gameObject.SetActive(false);
    }
Exemplo n.º 10
0
    private IEnumerator StartTeleport()
    {
        // 로케이션 이동
        this.transform.position = OperationData.Player.position;
        _direation = Utility.LookAt(MainCamController.MousePosition, OperationData.Player.position);
        _direation = new Vector3(_direation.x, _direation.y, 0);
        // 위치 고정
        _player.GetComponentInChildren <PlayerController>().CanMove = false;

        // 이펙트
        for (int i = 0; i < _StartSprites.Length; ++i)
        {
            _SpriteRenderer.sprite = _StartSprites[i];
            yield return(YieldInstructionCache.WaitForSeconds(0.01f));

            if (i == 6)
            {
                _player.transform.localScale = Vector3.zero;
                _weapon.transform.localScale = new Vector3(1.0f, 0.0f, 1.0f);
            }
        }
        _SpriteRenderer.sprite = null;

        // 발사
        _rb.isKinematic = true; _rb.isKinematic = false;
        _rb.AddForce(_direation * 50000.0f);

        yield return(YieldInstructionCache.WaitForSeconds(0.025f));

        SetPosition();
    }
Exemplo n.º 11
0
    private IEnumerator DurationSlowing()
    {
        yield return(YieldInstructionCache.WaitForSeconds(5.0f));

        SkillPoolManager.Instance.RechargeSkill(this.gameObject, this.transform.parent);
        StopCoroutine(DurationSlowing());
    }
Exemplo n.º 12
0
    private IEnumerator CreateRandomBlock()
    {
        while (true)
        {
            for (int i = 0; i < 10; i++)
            {
                if (afterImageBlockSpriteRenderers[i].gameObject.activeInHierarchy)
                {
                    continue;
                }
                afterImageBlockSpriteRenderers[i].gameObject.SetActive(true);

                Color afterColor = Color.white;

                afterColor.a = Random.Range(0.0f, 1.0f);

                Vector2 newScale;
                newScale.x = Random.Range(0.5f, 1.0f);
                newScale.y = newScale.x;

                Vector2 newPosition;
                newPosition.x = Random.Range(-8.0f, 8.0f);
                newPosition.y = Random.Range(-4.0f, 4.0f);

                afterImageBlockSpriteRenderers[i].color = afterColor;
                afterImageBlockSpriteRenderers[i].gameObject.transform.localScale = newScale;
                afterImageBlockSpriteRenderers[i].gameObject.transform.position   = newPosition;

                StartCoroutine(afterImageBlocks[i].FadeOut());

                yield return(YieldInstructionCache.WaitFrame);
            }
            yield return(YieldInstructionCache.WaitingSecond(0.9f));
        }
    }
Exemplo n.º 13
0
 private IEnumerator UpdateCoroutine()
 {
     while (true)
     {
         NodeGenerate();
         yield return(YieldInstructionCache.WaitingSeconds(0.2f));
     }
 }
Exemplo n.º 14
0
 private IEnumerator UpdateCoroutine()
 {
     while (true)
     {
         uiController.ChangeBackgroundColor();
         yield return(YieldInstructionCache.WaitingSeconds(5.0f));
     }
 }
Exemplo n.º 15
0
 private IEnumerator Debuff()
 {
     while (true)
     {
         isDebuffed = !isDebuffed;
         yield return(YieldInstructionCache.WaitingSecond(4F));
     }
 }
Exemplo n.º 16
0
 private IEnumerator BackgroundChangeCoroutine()
 {
     while (true)
     {
         backgroundColorChangeEvent.Invoke();
         yield return(YieldInstructionCache.WaitingSeconds(5.0f));
     }
 }
Exemplo n.º 17
0
 private IEnumerator MonsterGenerateCoroutine()
 {
     while (true)
     {
         monsterCreator.Execute();
         yield return(YieldInstructionCache.WaitingSecond(monsterGenenrateInterval));
     }
 }
Exemplo n.º 18
0
    private IEnumerator DelaySpit()
    {
        yield return(YieldInstructionCache.WaitForSeconds(1.0f));

        _isSpit = true;
        yield return(YieldInstructionCache.WaitForSeconds(0.9f));

        _condition.SetCondition(Condition.kIdle);
    }
Exemplo n.º 19
0
    private IEnumerator DisalbeEffect()
    {
        yield return(YieldInstructionCache.WaitForSeconds(
                         _Animator.GetCurrentAnimatorStateInfo(0).length));

        this.transform.parent   = _Bullet;
        this.transform.position = _Bullet.position;
        this.gameObject.SetActive(false);
    }
Exemplo n.º 20
0
    private IEnumerator StarFallGenerateCoroutine()
    {
        while (true)
        {
            yield return(YieldInstructionCache.WaitingSeconds(0.75f));

            GenerateStarFall();
        }
    }
Exemplo n.º 21
0
    private IEnumerator LoadNextScene()
    {
        StartCoroutine(BlackOut());
        yield return(YieldInstructionCache.WaitingSecond(3.0f));

        yield return(StartCoroutine(BlackIn()));

        SceneManager.LoadScene(PlayerPrefs.GetInt("NextStage"));
    }
Exemplo n.º 22
0
    private IEnumerator Effect()
    {
        var waitingTime = YieldInstructionCache.WaitingSecond(0.1f);

        for (int i = 0; i < 5; i++)
        {
            StartCoroutine(targetCharacter.ShowEffect(targetCharacter.skilEffect[0], false));
            yield return(waitingTime);
        }
    }
Exemplo n.º 23
0
    private IEnumerator ExecuteCoroutine()
    {
        yield return(YieldInstructionCache.WaitingSecond(0.25f));

        yield return(StartCoroutine(GameManager.instance.fadeManager.SpriteFadeOutCoroutine(spriteRenderer, 0.5f)));

        bigBullet.gameObject.transform.position = stageBoss.gameObject.transform.position;
        bigBullet.SetDirection(gameObject.transform.position);

        bigBullet.Execute();
    }
Exemplo n.º 24
0
    private IEnumerator ResumeCoroutine()
    {
        fadeTween?.Kill();

        fadeTween = canvasGroup.DOFade(0.0f, 1.0f);
        yield return(YieldInstructionCache.WaitingSeconds(1.0f));

        gameObject.SetActive(false);
        GameManager.instance.isPause = false;
        doingCoroutine = false;
    }
    private IEnumerator PlayCoroutine()
    {
        for (int i = 0; i < counts.Length; i++)
        {
            counts[i].SetActive(true);
            yield return(YieldInstructionCache.WaitingSeconds(interval));

            counts[i].SetActive(false);
        }
        onCountdown?.Invoke();
    }
Exemplo n.º 26
0
 public IEnumerator ScaleDownCoroutine()
 {
     for (int i = 0; i < 60; i++)
     {
         for (int j = 0; j < buildings.Length; j++)
         {
             buildings[j].gameObject.transform.localScale -= (Vector3.one / 200);
         }
         yield return(YieldInstructionCache.WaitingSecond(0.05f));
     }
 }
Exemplo n.º 27
0
    public IEnumerator InformationUpdate()
    {
        selectSlot = CharacterSelectManager.instance.GetSelectSlot();
        GameObject target = Instantiate(selectSlot.GetCharacter(), Vector2.one * -100, Quaternion.identity);

        characterImage.sprite = target.GetComponent <SpriteRenderer>().sprite;

        int index = CharacterSelectManager.instance.GetSelectSlotNumber();

        characterNameText.text    = nameList[index];
        characterDescripts.text   = descriptList[index];
        characterSkillText.text   = skilList[index];
        characterAbilityText.text = abilityList[index];

        yield return(YieldInstructionCache.WaitingSecond(0.01f));

        for (int i = 0; i < tankLevels.Length; i++)
        {
            tankLevels[i].sprite = levelImage[0];
        }

        for (int i = 0; i < dodgeLevels.Length; i++)
        {
            dodgeLevels[i].sprite = levelImage[0];
        }


        for (int i = 0; i < target.GetComponent <Character>().Level_Tank; i++)
        {
            tankLevels[i].sprite = levelImage[1];
        }

        for (int i = 0; i < target.GetComponent <Character>().Level_Dodge; i++)
        {
            dodgeLevels[i].sprite = levelImage[1];
        }

        switch (selectSlot.GetCharacter().GetComponent <Character>().Rank)
        {
        case 0:
            characterRank.text = "Normal";
            break;

        case 1:
            characterRank.text = "Rare";
            break;

        case 2:
            characterRank.text = "Unique";
            break;
        }
        Destroy(target);
    }
Exemplo n.º 28
0
    private IEnumerator JudgeImageSizeUpCoroutine()
    {
        judgeImage.gameObject.SetActive(true);
        judgeImage.gameObject.transform.localScale = Vector3.one;

        sizeUpTween = judgeImage.gameObject.transform.DOScale(sizeUpVector * sizeUpValue, sizeUpDuration).SetEase(easeType);
        yield return(sizeUpTween.WaitForCompletion());

        yield return(YieldInstructionCache.WaitingSeconds(1.0f));

        judgeImage.gameObject.SetActive(false);
    }
Exemplo n.º 29
0
    public IEnumerator LightOn()
    {
        for (int i = 0; i < lights.Count; ++i)
        {
            for (int j = 0; j < lights[i].lightArray.Length; ++j)
            {
                lights[i].lightArray[j].enabled = true;
            }

            yield return(YieldInstructionCache.WaitForSeconds(delay));
        }
    }
Exemplo n.º 30
0
    private IEnumerator Cooldown()
    {
        float coolDown = 0.0f;

        while (true)
        {
            coolDown = _playerStats == null ? 1.0f : _playerStats.ShootSpeed;
            yield return(YieldInstructionCache.WaitForSeconds(coolDown));

            _isAttack = true;
        }
    }