예제 #1
0
    public void PrintDamageFont(int damage, Vector3 position)
    {
        var damageFont = UIFontManager.GetInstance.GetFont(damage.ToString(),
                                                           _mainCamera.WorldToScreenPoint(position));

        var AsyncFadeAction = K514PooledCoroutine.GetCoroutine().GetDeferredAction(1.0f, refs =>
        {
            var _damageFont = refs.MorphObject as CustomUIFont[];
            foreach (var font in _damageFont)
            {
                font.Sprite.alpha = 0f;
                UIFontManager.GetInstance.Pooling(font);
            }
        }).SetAction(K514PooledCoroutine.ActionType.Activity, refs =>
        {
            var _damageFont   = refs.MorphObject as CustomUIFont[];
            var fixedPosition = CameraManager.GetInstance.MainCamera.WorldToScreenPoint(refs.CastPosition);
            foreach (var font in _damageFont)
            {
                font.Sprite.alpha = 1 - refs.F_stack_factor * refs.F_Time_ReversedFactor;
                font.SetPosition(fixedPosition);
                fixedPosition += Vector3.right * font.Wide;
            }
        });

        AsyncFadeAction._mParams.SetCastPosition(position);
        AsyncFadeAction._mParams.SetMorphable(damageFont);

        AsyncFadeAction.SetTrigger();
    }
예제 #2
0
    public void UpdateExpBar(int exp)
    {
        if (exp >= PlayerInformation.DummyExp[PlayerInformation.PlayerLevel - 1])
        {
            var expBarLevelUpChange = K514PooledCoroutine.GetCoroutine()
                                      .GetDeferredAction(1f,
                                                         refs =>
            {
                var expAfter                      = refs.MorphObject as UISprite;
                var levelLabel                    = refs.MorphObject2 as UILabel;
                expAfter.fillAmount               = 0f;
                PlayerInformation.PlayerLevel    += 1;
                PlayerInformation.ExperiencePoint = 0;
                levelLabel.text                   = "Lv " + PlayerInformation.PlayerLevel;
                HUDManager.GetInstance.ResultScene.ExpBeforeSprite.fillAmount = 0;
                HUDManager.GetInstance.ResultScene.UpdateExpBar(refs.I_factor);
            }).SetAction(K514PooledCoroutine.ActionType.Activity,
                         refs =>
            {
                var expAfter        = refs.MorphObject as UISprite;
                expAfter.fillAmount = refs.F_factor2 +
                                      (1 - refs.F_factor2) * refs.F_stack_factor * refs.F_Time_ReversedFactor;
            });

            expBarLevelUpChange._mParams.SetMorphable(ExpAfterSprite);
            expBarLevelUpChange._mParams.SetMorphable2(PlayerLevel);
            expBarLevelUpChange._mParams.SetFactor(exp - PlayerInformation.DummyExp[PlayerInformation.PlayerLevel - 1]);
            expBarLevelUpChange._mParams.SetFactor2(PlayerInformation.ExperiencePoint *
                                                    PlayerInformation.InverseExpRequirement);
            expBarLevelUpChange.SetTrigger();
        }
        else
        {
            var expBarChange = K514PooledCoroutine.GetCoroutine()
                               .GetDeferredAction(2f,
                                                  refs =>
            {
                var expBefore        = refs.MorphObject2 as UISprite;
                expBefore.fillAmount = (refs.I_factor) * PlayerInformation.InverseExpRequirement;
            }).SetAction(K514PooledCoroutine.ActionType.Activity,
                         refs =>
            {
                var expAfter        = refs.MorphObject as UISprite;
                expAfter.fillAmount = refs.F_factor2 +
                                      (refs.I_factor) * PlayerInformation.InverseExpRequirement *
                                      refs.F_stack_factor * refs.F_Time_ReversedFactor;
            });

            expBarChange._mParams.SetMorphable(ExpAfterSprite);
            expBarChange._mParams.SetMorphable2(ExpBeforeSprite);
            expBarChange._mParams.SetFactor(exp - PlayerInformation.ExperiencePoint);
            expBarChange._mParams.SetFactor2(PlayerInformation.ExperiencePoint *
                                             PlayerInformation.InverseExpRequirement);
            expBarChange.SetTrigger();

            PlayerInformation.ExperiencePoint += exp;
        }
    }
예제 #3
0
    private void OnTriggerEnter(Collider collider)
    {
        if (!collider.CompareTag("Player") || !_isEnable)
        {
            return;
        }
        var async = K514PooledCoroutine.GetCoroutine().GetDeferredAction(3f,
                                                                         CAR => { TutorialManager.GetInstance.PlayTutorial((TutorialManager.TutorialName)CAR.I_factor); });

        async._mParams.SetFactor((int)TutorialName);
        async.SetTrigger();
        _isEnable = false;
    }
예제 #4
0
    public void Sync()
    {
        var moneyChange = K514PooledCoroutine.GetCoroutine().GetDeferredAction(0.3f,
                                                                               refs =>
        {
            var moneyBar  = refs.MorphObject as UILabel;
            moneyBar.text = PlayerItemManager.GetInstance.WaveStone.ToString();
        }
                                                                               ).SetAction(K514PooledCoroutine.ActionType.Activity,
                                                                                           refs =>
        {
            var moneyBar  = refs.MorphObject as UILabel;
            moneyBar.text = ((int)(refs.I_factor +
                                   (PlayerItemManager.GetInstance.WaveStone - refs.I_factor) *
                                   refs.F_stack_factor * refs.F_Time_ReversedFactor)).ToString();
        });

        moneyChange._mParams.SetMorphable(MoneyBar);
        moneyChange._mParams.SetFactor(int.Parse(MoneyBar.text));
        moneyChange.SetTrigger();
    }
    public void PlayResultAnimations(int exp)
    {
        Frame.speed = 1;
        foreach (var gear in GearGroup)
        {
            gear.speed = 1;
        }

        var resultAnimation = K514PooledCoroutine.GetCoroutine().GetDeferredAction(2f,
                                                                                   refs =>
        {
            var result   = refs.MorphObject as Animator;
            var info     = refs.MorphObject2 as Animator;
            result.speed = 1;
            info.speed   = 1;

            HUDManager.GetInstance.ResultScene.UpdateExpBar(refs.I_factor);
        });

        resultAnimation._mParams.SetMorphable(GameResult);
        resultAnimation._mParams.SetMorphable2(GameInfo);
        resultAnimation._mParams.SetFactor(exp);
        resultAnimation.SetTrigger();
    }
예제 #6
0
    private Action <EventArgs> TutorialEvent(TutorialName name)
    {
        Action <EventArgs> action;

        switch (name)
        {
        case TutorialName.Move:
            action = (args) =>
            {
                GameManager.GetInstance.GameStopFlag = true;
                HUDManager.GetInstance.Highlight.SetHighlightCircle(
                    HUDManager.GetInstance.JoystickController.transform.position, 2.0f,
                    HUDManager.GetInstance.JoystickController);
                HUDManager.GetInstance.JoystickController.SetOnClickBeginAfterAction((onClick) =>
                {
                    GameManager.GetInstance.GameStopFlag = false;
                    HUDManager.GetInstance.Background.LeftScreenHighlight(false);

                    K514PooledCoroutine.GetCoroutine().GetDeferredAction(3f,
                                                                         CAR => { TutorialManager.GetInstance.PlayTutorial(TutorialName.Attack); })
                    .SetTrigger();
                });
                HUDManager.GetInstance.Background.LeftScreenHighlight(true);
                MessageBoxUI.GetInstance.SetLabel("조이스틱을 움직여 이동하세요");
                MessageBoxUI.GetInstance.SetTrigger(MessageBoxUI.MessageActionType.Showing, MessageBoxUI.MessageEventType.WithNoEvent);
            };
            break;

        case TutorialName.Attack:
            action = (args) =>
            {
                GameManager.GetInstance.GameStopFlag = true;
                HUDManager.GetInstance.Highlight.SetHighlightCircle(
                    HUDManager.GetInstance.ActionButtonTriggerGroup[0].transform.position, 1.5f,
                    HUDManager.GetInstance.ActionButtonTriggerGroup[0]);
                HUDManager.GetInstance.ActionButtonTriggerGroup[0].SetOnClickBeginBeforeAction((onClick) =>
                {
                    GameManager.GetInstance.GameStopFlag = false;
                    HUDManager.GetInstance.Background.UIHighlight(false);

                    K514PooledCoroutine.GetCoroutine().GetDeferredAction(3f,
                                                                         CAR => { TutorialManager.GetInstance.PlayTutorial(TutorialName.ChargeAttack); })
                    .SetTrigger();
                });
                HUDManager.GetInstance.Background.UIHighlight(true);
                MessageBoxUI.GetInstance.SetLabel("공격버튼을 눌러 공격하세요");
                MessageBoxUI.GetInstance.SetTrigger(MessageBoxUI.MessageActionType.Showing, MessageBoxUI.MessageEventType.WithNoEvent);
            };
            break;

        case TutorialName.Dash:
            action = (args) =>
            {
                GameManager.GetInstance.GameStopFlag = true;
                HUDManager.GetInstance.Highlight.SetHighlightCircle(
                    HUDManager.GetInstance.ActionButtonTriggerGroup[2].transform.position, 1.5f,
                    HUDManager.GetInstance.ActionButtonTriggerGroup[2]);
                HUDManager.GetInstance.ActionButtonTriggerGroup[2].SetOnClickBeginBeforeAction((onClick) =>
                {
                    GameManager.GetInstance.GameStopFlag = false;
                    HUDManager.GetInstance.Background.UIHighlight(false);

                    K514PooledCoroutine.GetCoroutine().GetDeferredAction(6f,
                                                                         CAR =>
                    {
                        GameManager.GetInstance.IsKeepBGMWhileGameStopped = false;
                        GameInformation.GetInstance.AddItem(ItemManager.GetInstance.CreateItem(ItemManager.ItemList.ShortBow, ItemManager.ItemRank.magic));
                        GameInformation.GetInstance.AddExp(200);
                        GameInformation.GetInstance.SetResultUI(GameResultStruct.GameResult.Win);
                    })
                    .SetTrigger();
                });
                HUDManager.GetInstance.Background.UIHighlight(true);
                MessageBoxUI.GetInstance.SetLabel("대쉬버튼을 눌러 회피하세요");
                MessageBoxUI.GetInstance.SetTrigger(MessageBoxUI.MessageActionType.Showing, MessageBoxUI.MessageEventType.WithNoEvent);
            };

            break;

        case TutorialName.ChargeAttack:
            action = (args) =>
            {
                GameManager.GetInstance.GameStopFlag = true;
                HUDManager.GetInstance.Highlight.SetHighlightCircle(
                    HUDManager.GetInstance.ActionButtonTriggerGroup[0].transform.position, 1.5f,
                    HUDManager.GetInstance.ActionButtonTriggerGroup[0]);
                HUDManager.GetInstance.ActionButtonTriggerGroup[0].SetOnClickBeginBeforeAction((onClick) =>
                {
                    GameManager.GetInstance.GameStopFlag = false;
                    HUDManager.GetInstance.Background.UIHighlight(false);
                });
                HUDManager.GetInstance.Background.UIHighlight(true);
                MessageBoxUI.GetInstance.SetLabel("공격버튼을 누르고 있으면 차징 할 수 있습니다.");
                MessageBoxUI.GetInstance.SetTrigger(MessageBoxUI.MessageActionType.Showing, MessageBoxUI.MessageEventType.WithNoEvent);

                ConditionalEventManager.GetInstance.AddConditionalAction(ConditionalEventManager.ActionFlag.OnChargeAttack,
                                                                         eventArgs =>
                {
                    K514PooledCoroutine.GetCoroutine().GetDeferredAction(2f,
                                                                         CAR =>
                    {
                        ConditionalEventManager.GetInstance.RemoveConditionalAction(ConditionalEventManager.ActionFlag.OnChargeAttack
                                                                                    , "Charging Tutorial");
                        TutorialManager.GetInstance.PlayTutorial(TutorialName.ActiveSkill);
                    })
                    .SetTrigger();
                }
                                                                         , "Charging Tutorial"
                                                                         , new CustomActionArgs());
            };

            break;

        case TutorialName.ActiveSkill:
            action = (args) =>
            {
                GameManager.GetInstance.GameStopFlag = true;
                HUDManager.GetInstance.Highlight.SetHighlightCircle(
                    HUDManager.GetInstance.ActionButtonTriggerGroup[1].transform.position, 1.5f,
                    HUDManager.GetInstance.ActionButtonTriggerGroup[1]);
                HUDManager.GetInstance.ActionButtonTriggerGroup[1].SetOnClickBeginBeforeAction((onClick) =>
                {
                    GameManager.GetInstance.GameStopFlag = false;
                    HUDManager.GetInstance.Background.UIHighlight(false);

                    K514PooledCoroutine.GetCoroutine().GetDeferredAction(3f,
                                                                         CAR => { TutorialManager.GetInstance.PlayTutorial(TutorialName.Dash); })
                    .SetTrigger();
                });
                HUDManager.GetInstance.Background.UIHighlight(true);
                MessageBoxUI.GetInstance.SetLabel("스킬버튼을 눌러 스킬을 사용하세요");
                MessageBoxUI.GetInstance.SetTrigger(MessageBoxUI.MessageActionType.Showing, MessageBoxUI.MessageEventType.WithNoEvent);
            };

            break;

        default:
            action = null;
            break;
        }

        return(action);
    }