Пример #1
0
    protected virtual void Hide(bool fadeOut, Action callback)
    {
        // Disable UI
        SetUIEnabled(false);

        // Hide touch and overlay
        SetShowTouchAndOverlay(false);

        // Delay
        gameObject.Play(DelayAction.Create(0.1f), () => {
            if (fadeOut)
            {
                // Fade-out overlay
                gameObject.Play(FadeAction.FadeOut(fadeDuration));

                // Fade-out background
                background.Play(FadeAction.RecursiveFadeOut(fadeDuration), () => {
                    // Hide
                    gameObject.Hide();

                    // Enable UI
                    SetUIEnabled(true);

                    callback();
                });
            }
            else
            {
                // Enable UI
                SetUIEnabled(true);

                callback();
            }
        });
    }
Пример #2
0
    public override void OnAnimalExit(Animal animal)
    {
        if (_enterCount == 1)
        {
            // Set animal to null
            _animal = null;

            GameManager.Instance.OnAnimalExitFoothold(this);

            _isDouble = false;

            var delay         = DelayAction.Create(0.5f);
            var playExplosion = CallFuncAction.Create(() => {
                // Play sound
                SoundManager.Instance.PlaySound(SoundID.Explose);

                if (explosionPrefab != null)
                {
                    GameObject explosion = explosionPrefab.Create(transform, icon.transform.position);
                    explosion.AddSortingOrder(icon.GetSortingOrder() + 1);
                }
            });
            var fadeOut = FadeAction.FadeOut(0.25f);
            var hide    = HideAction.Create();

            // Hide icon
            icon.Play(SequenceAction.Create(delay, playExplosion, fadeOut, hide));
        }
        else
        {
            base.OnAnimalExit(animal);
        }
    }
Пример #3
0
    public void OnHammerEnd()
    {
        // Disable swing
        _swingEnabled = false;

        GameManager.Instance.OnFootholdDestroyed(this);

        gameObject.Play(FadeAction.FadeOut(0.5f), () => {
            SelfDestroy();
        });
    }
Пример #4
0
    public void Exit()
    {
        image.gameObject.Play(FadeAction.FadeOut(1f));
        text.gameObject.SetActive(false);

        if (bird != null)
        {
            bird.Play(FadeAction.FadeOut(1));
        }

        Invoke("DeactiveCutscene", 1.05f);
    }
Пример #5
0
    public static void HidePopup(GameObject popup, Action callback)
    {
        // Content
        GameObject content = popup.FindInChildren("Popup");

        if (content != null)
        {
            // Hide content
            content.transform.localScale = Vector3.zero;
        }

        // Fade-out
        popup.Play(FadeAction.FadeOut(popupDuration), () => {
            // Hide popup
            popup.Hide();

            if (callback != null)
            {
                callback();
            }
        });
    }
Пример #6
0
    void Start()
    {
        // Set scale
        transform.localScale = scale;

        gameObject.Play(ParallelAction.ParallelAll(ScaleAction.ScaleTo(scale * Random.Range(minScale, maxScale), scaleDuration), FadeAction.FadeOut(fadeDuration)), () => {
            GameObject.Destroy(gameObject);
        });
    }
Пример #7
0
    protected override void Excute(BehaviorData inData)
    {
        // 액션을 바로 실행한다
        if (GameDataManager.getInstance.scriptPlayMode == GameDataManager.EScriptPlayMode.Load)
        {
            inData.time = 0;
        }

        bool applyDelayTime = true;

        if (inData.ContainForm("SCENE_FADEIN"))
        {
            _fadeAction.FadeIn(inData.time);
        }
        else if (inData.ContainForm("SCENE_FADEOUT"))
        {
            _fadeAction.FadeOut(inData.time);
        }
        else if (inData.ContainForm("CHATBOX_SHOW"))
        {
            _chatBoxAction.ShowChatBox(inData.time);
        }
        else if (inData.ContainForm("CHATBOX_HIDE"))
        {
            _chatBoxAction.HideChatBox(inData.time);
        }
        else if (inData.ContainForm("TEXT_FADEIN"))
        {
            _chatBoxAction.ChatFadeIn(inData.time);
        }
        else if (inData.ContainForm("TEXT_FADEOUT"))
        {
            _chatBoxAction.ChatFadeOut(inData.time);
        }
        else if (inData.ContainForm("SCENE_SHAKE"))
        {
            _shakeAction.ScreenShake(5, inData.time, 50);
        }
        else if (inData.ContainForm("CHARACTER_MOVE_IN"))
        {
            _character.FadeIn(inData);
        }
        else if (inData.ContainForm("CHARACTER_MOVE_OUT"))
        {
            _character.FadeOut(inData);
        }
        else if (inData.ContainForm("DISTRACTOR_FADEOUT"))
        {
            _distractor.VanishDistractorButton(inData.time);
        }
        else if (inData.ContainForm("SE_FADEOUT"))
        {
            applyDelayTime = false;
            _se.FadeOut(inData.name, inData.time);
        }
        else if (inData.ContainForm("SE_FADEIN"))
        {
            applyDelayTime = false;
            _se.FadeIn(inData.name, inData.time);
        }
        else if (inData.ContainForm("BGM_FADEOUT"))
        {
            applyDelayTime = false;
            _bgm.FadeOut(inData.name, inData.time);
        }
        else if (inData.ContainForm("BGM_FADEIN"))
        {
            applyDelayTime = false;
            _bgm.FadeIn(inData.name, inData.time);
        }
        else if (inData.ContainForm("BACKGROUND_CLOUD"))
        {
            _fadeAction.CloudFadeIn(inData.time);
        }
        else if (inData.ContainForm("BACKGROUND_CLEAN"))
        {
            _fadeAction.CloudFadeOut(inData.time);
        }
        else if (inData.ContainForm("BACKGROUND_PUSH"))
        {
            _background.Push(inData.name, inData.direction, inData.time);
        }
        else if (inData.ContainForm("BACKGROUND_FADEIN"))
        {
            if (inData.axis == "NONE")
            {
                _background.FadeIn(inData.name, inData.time);
            }
            else if (inData.axis == "X축")
            {
                _background.ShowResource(inData.name);
                _fadeAction.AxisXFadeIn(inData.time);
            }
        }
        else
        {
            Debug.LogError(StringHelper.Format("[{0}] 액션 명령어가 등록되지 않았습니다!", inData.form));
        }
        GameDataManager.getInstance.behaviorDelayTime = (applyDelayTime) ? inData.time : 0;
    }