Beispiel #1
0
    // Use this for initialization
    IEnumerator Start()
    {
        //setup initial display
        animator.ResetTake(animator.GetTakeIndex(takeStart));
        animator.ResetTake(animator.GetTakeIndex(takeInteractEnter));

        while (M8.SceneManager.instance.isLoading)
        {
            yield return(null);
        }

        animator.Play(takeStart);
        while (animator.isPlaying)
        {
            yield return(null);
        }

        //music
        if (startMusicPlaylist)
        {
            LoLMusicPlaylist.instance.Play();
        }

        //start up the first page
        mCurPageInd = 0;
        ShowCurrentPage();
    }
Beispiel #2
0
    IEnumerator M8.SceneManager.ITransition.In()
    {
        animator.Play(mTakeInInd);
        while (animator.isPlaying)
        {
            yield return(null);
        }

        activeGO.SetActive(false);

        animator.ResetTake(mTakeOutInd);
    }
Beispiel #3
0
    public void Reset()
    {
        if (mRout != null)
        {
            StopCoroutine(mRout);
            mRout = null;
        }

        if (animator)
        {
            animator.Stop();

            int lastTakeInd = animator.lastPlayingTakeIndex;
            if (lastTakeInd != -1)
            {
                animator.ResetTake(lastTakeInd);
            }
        }

        mIsDocked = false;

        spriteRender.sortingOrder = mOrderDefault;
    }
Beispiel #4
0
    public void Show(bool aShow)
    {
        if (mIsShow != aShow)
        {
            mIsShow = aShow;

            if (mIsShow)
            {
                gameObject.SetActive(true);

                //add widgets
                var blocks = GameData.instance.blocks;
                for (int i = 0; i < blocks.Length; i++)
                {
                    var blockInfo = blocks[i];

                    if (GameMapController.instance.PaletteCount(blockInfo.name) > 0)
                    {
                        AddNewPaletteItem(blockInfo, false);
                    }
                }

                //ensure we are positioned properly
                switch (GameMapController.instance.mode)
                {
                case GameMapController.Mode.Play:
                    toggleButton.transform.localScale = new Vector3(-1f, 1f, 1f);
                    animator.ResetTake(mTakeEditShowId);
                    break;

                case GameMapController.Mode.Edit:
                    toggleButton.transform.localScale = new Vector3(1f, 1f, 1f);
                    animator.ResetTake(mTakeEditHideId);
                    break;
                }

                GameMapController.instance.paletteUpdateCallback       += OnGamePaletteUpdate;
                GameMapController.instance.modeChangeCallback          += OnGameModeChange;
                GameMapController.instance.blockSelectedChangeCallback += OnGameBlockSelectChanged;
            }
            else
            {
                GameMapController.instance.paletteUpdateCallback       -= OnGamePaletteUpdate;
                GameMapController.instance.modeChangeCallback          -= OnGameModeChange;
                GameMapController.instance.blockSelectedChangeCallback -= OnGameBlockSelectChanged;

                //clear up widgets
                for (int i = 0; i < mActiveWidgets.Count; i++)
                {
                    if (mActiveWidgets[i])
                    {
                        mActiveWidgets[i].releaseCallback -= OnWidgetRelease;
                        widgetPool.Release(mActiveWidgets[i].gameObject);
                    }
                }

                mActiveWidgets.Clear();

                gameObject.SetActive(false);
            }
        }
    }