示例#1
0
        // 엔딩 연출
        private IEnumerator Ending()
        {
            SoundManager.Instance.PlayBGM("Ending");
            SoundManager.Instance.PlaySfx("Firework", 0.1f);

            canvasUI.SetActive(false);
            cardCanvas.SetActive(false);

            endingUI.transform.GetChild(0).gameObject.SetActive(true);
            CoroutineHandler.Start_Coroutine(ShowConfetti());

            float startScale = 0.1f;
            float endScale   = 1;
            float time       = 0;
            float endTime    = 0.15f;

            while (time < endTime)
            {
                float progress = Mathf.Lerp(startScale, endScale, time / endTime);
                endingUI.transform.localScale = new Vector3(progress, progress, progress);

                time += Time.deltaTime;
                yield return(new WaitForSeconds(Time.deltaTime));
            }
            yield return(new WaitForSeconds(0.9f));

            while (true)
            {
                CoroutineHandler.Start_Coroutine(ShowConfetti());
                yield return(new WaitForSeconds(1.35f));
            }
        }
示例#2
0
        // 배틀 시작 이벤트가 오면 init하고 자기 자신 업데이트에 넣기
        // 몬스터가 죽는 이벤트가 오면 카운트 증가시키고 죽은 몬스터가 현재 스테이지의 몬스터 수가 되면 배틀 종료 이벤트 발행
        public bool OnEvent(IEvent e)
        {
            Type eventType = e.GetType();

            if (eventType == typeof(BattleStageStartEvent))
            {
                BattleStageStartEvent battleStateStartEvent = e as BattleStageStartEvent;
                Init(battleStateStartEvent.Stage);
                GameManager.Instance.AddUpdate(this);
                return(true);
            }
            else if (eventType == typeof(MonsterDeadEvent))
            {
                MonsterDeadEvent monsterDeadEvent = e as MonsterDeadEvent;
                stageMonsterList.Remove(monsterDeadEvent.DeadUnit);
                deadMonsterCount++;
                if (deadMonsterCount >= currentStageMonsterCount)
                {
                    if (GameManager.Instance.Stage + 1 >= stageGroupData.StageDataGroup.Count)
                    {
                        CoroutineHandler.Start_Coroutine(Ending());
                    }
                    else
                    {
                        CoroutineHandler.Start_Coroutine(EndBattleStage());
                    }
                }
                return(true);
            }
            return(false);
        }
    protected override void ImmediateReaction()
    {
        //canvas = TutorialController.Instance.cutScenePannel;



        myCorotine = CoroutineHandler.Start_Coroutine(FadeOut()).gameObject;
    }
示例#4
0
    protected override void ImmediateReaction()
    {
        if (FSLocator.textDisplayer != null)
        {
            FSLocator.textDisplayer.reactionButton.enabled = false;
        }

        myCorotine = CoroutineHandler.Start_Coroutine(Delay()).gameObject;
    }
示例#5
0
        public bool OnEvent(IEvent e)
        {
            Type eventType = e.GetType();

            if (eventType == typeof(BattleStageEndEvent))
            {
                CoroutineHandler.Start_Coroutine(SetReward());
                return(true);
            }
            return(false);
        }
示例#6
0
        // 배틀 종료
        private IEnumerator EndBattleStage()
        {
            CoroutineHandler.Start_Coroutine(ShowClear());
            yield return(new WaitForSeconds(3f));

            Fade.Instance.FadeIn(0.5f);
            GameManager.Instance.EffectSystem.RemoveAllEffect();
            yield return(new WaitForSeconds(0.5f));

            GameManager.Instance.RemoveUpdate(this);
            GameManager.Instance.MessageSystem.Unsubscribe(typeof(MonsterDeadEvent), this);
            GameManager.Instance.MessageSystem.Publish(BattleStageEndEvent.Create());
        }
    protected override void ImmediateReaction()
    {
        if (audioSource.volume == 0)
        {
            return;
        }

        if (audioClip != null)
        {
            audioSource.clip = audioClip;
        }

        audioSource.volume = StaticInfoForSound.BGMSound;
        //audioSource.PlayDelayed(delay);
        go = CoroutineHandler.Start_Coroutine(FadeOutAudio()).gameObject;
    }
示例#8
0
    protected override void ImmediateReaction()
    {
        FSLocator.textDisplayer.reactionButton.enabled = false;

        /*
         *      Vector3 pushedVector = player.transform.position - pushNpcTransform.position;
         *      pushedVector.z = 0;
         *      Debug.Log ("Push ! : " + pushedVector.normalized);
         *      Vector3 destination = player.transform.position + pushedVector.normalized * distance;
         */
        // 밀려지는 방향 계산
        Vector2 pushedVector = player.transform.position - pushNpcTransform.position;

        // 밀려지는 방향으로 distance의 거리만큼 밀려남
        player.MoveToPositionSlowlyNotLookingAt(pushedVector, distance);

        myCorotine = CoroutineHandler.Start_Coroutine(CheckMoving()).gameObject;
    }
示例#9
0
        // 클리어 연출
        private IEnumerator ShowClear()
        {
            while (clearUI.transform.localPosition.x < 0)
            {
                yield return(new WaitForSeconds(Time.deltaTime));

                clearUI.transform.localPosition += new Vector3(Time.deltaTime * 4000, 0, 0);
            }
            clearUI.transform.localPosition = new Vector3(0, 0, 0);
            SoundManager.Instance.PlayBGM("GameClear", 0.2f);
            CoroutineHandler.Start_Coroutine(ShowConfetti());

            yield return(new WaitForSeconds(2.2f));

            while (clearUI.transform.localPosition.x < 1000)
            {
                clearUI.transform.localPosition += new Vector3(Time.deltaTime * 4000, 0, 0);
                yield return(new WaitForSeconds(Time.deltaTime));
            }

            clearUI.transform.localPosition = new Vector3(-1000, 0, 0);
        }
    protected override void ImmediateReaction()
    {
        FSLocator.textDisplayer.reactionButton.enabled = false;

        myCorotine = CoroutineHandler.Start_Coroutine(FadeOut()).gameObject;
    }
 protected override void ImmediateReaction()
 {
     myCorotine = CoroutineHandler.Start_Coroutine(CheckingDistance()).gameObject;
 }
示例#12
0
 protected override void ImmediateReaction()
 {
     go = CoroutineHandler.Start_Coroutine(FadeInAudio()).gameObject;
 }
示例#13
0
 protected override void ImmediateReaction()
 {
     // 관찰 루틴 실행
     myCorotine = CoroutineHandler.Start_Coroutine(CheckForDoingObservation()).gameObject;
 }
示例#14
0
 protected override void ImmediateReaction()
 {
     myCorotine = CoroutineHandler.Start_Coroutine(Wating()).gameObject;
 }
 protected override void ImmediateReaction()
 {
     // 아이템 "주기" 루틴 실행
     myCorotine = CoroutineHandler.Start_Coroutine(CheckForGiving()).gameObject;
 }