Пример #1
0
    /// <summary>
    /// シーン遷移用コルーチン
    /// </summary>
    /// <param name='scene'>シーン名</param>
    /// <param name='interval'>暗転にかかる時間(秒)</param>
    private IEnumerator TransAnimationEnd(float interval)
    {
        Animator anim = TargetPlayCharacter.GetComponent <Animator>();

        yield return(new WaitForSeconds(0.3f));

        // 参照用のステート変数にBase Layer (0)の現在のステートを設定する
        AnimatorStateInfo currentBaseState = anim.GetCurrentAnimatorStateInfo(0);

        while (currentBaseState.fullPathHash != idleState)
        {
            if (Input.GetKeyDown(KeyControlInformation.Info.MenuOk) ||
                KeyControlInformation.Info.OnLeftClick())
            {
                break;
            }

            yield return(null);

            currentBaseState = anim.GetCurrentAnimatorStateInfo(0);
        }

        //yield return new WaitForSeconds(0.5f);

        _state = SelectTurnState.DungeonSelectStart;
    }
Пример #2
0
    private void CancelDungeon()
    {
        //サウンドを鳴らす
        SoundInformation.Sound.Play(SoundInformation.SoundType.MenuCancel);

        InitialzeContent(Characters, SelectCharacter);
        _state = SelectTurnState.CharacterSelect;
    }
Пример #3
0
 private SelectTurnState ExeItemMenu(SelectTurnState nowState, PlayerCharacter player)
 {
     //ドライブを見るの場合無視
     if (nowState == SelectTurnState.LookDrive)
     {
     }
     //表示リストが0だったら無視
     else if (_ListViewItemUnits.Count == 0)
     {
     }
     else
     {
     }
     return(nowState);
 }
Пример #4
0
    private void DecisionCharacter()
    {
        //キャラクタ情報を格納
        PlayerInformation.Info = Characters[SelectCharacter];

        //サウンドを鳴らす
        SoundInformation.Sound.Play(SoundInformation.SoundType.MenuOk);

        //ボイスを鳴らす
        VoiceInformation.Voice.Play(PlayerInformation.Info.PType, VoiceInformation.VoiceType.Start);

        Animator anim = TargetPlayCharacter.GetComponent <Animator>();

        anim.SetBool("IsStart", true);

        StartCoroutine(TransAnimationEnd(4f));

        _state = SelectTurnState.CharacterAnimation;
    }
Пример #5
0
        public SelectTurnState UpdateDisplay(SelectTurnState nowState, PlayerCharacter player)
        {
            TempState = nowState;
            if (_wait > 0)
            {
                _wait--;
                return(nowState);
            }

            switch (nowState)
            {
            case SelectTurnState.MenuWarehouseOutStart:
                nowState = SelectTurnState.MenuWarehouseOut;
                TempMain = nowState;
                break;

            case SelectTurnState.MenuWarehouseOut:
                nowState = UpdateItemMenu(nowState, player);
                break;

            case SelectTurnState.MenuWarehouseInStart:
                nowState = SelectTurnState.MenuWarehouseOut;
                TempMain = nowState;
                break;

            case SelectTurnState.MenuWarehouseIn:
                nowState = UpdateItemMenu(nowState, player);
                break;

            case SelectTurnState.FinishMenu:

                FinishMenu();
                nowState = SelectTurnState.DungeonSelect;
                break;

            default:
                break;
            }

            return(nowState);
        }
Пример #6
0
    /// <summary>
    /// シーン遷移用コルーチン
    /// </summary>
    /// <param name='scene'>シーン名</param>
    /// <param name='interval'>暗転にかかる時間(秒)</param>
    private IEnumerator TransSceneStart(float interval)
    {
        //CanvasGroup cv = GameObject.Find("Canvas").GetComponent<CanvasGroup>();
        //cv.alpha = 0;
        //だんだん暗く
        this.isFading = true;

        float time = 0;

        //0.5秒待つ
        while (time <= 0.5f)
        {
            time += CommonFunction.GetDelta(1);
            yield return(null);
        }

        _state        = SelectTurnState.CharacterSelect;
        this.isFading = false;


        ////だんだん明るく
        //time = 0;
        //while (time <= interval)
        //{
        //    time += CommonFunction.GetDelta(1);
        //    yield return null;
        //}


        //float cva = 0.02f;

        //while (cv.alpha != 1)
        //{
        //    cv.alpha = Mathf.Clamp(cv.alpha + cva, 0f, 1f);
        //    time += Time.deltaTime;
        //    yield return 0;
        //}
    }
Пример #7
0
        private SelectTurnState UpdateItemMenu(SelectTurnState nowState, PlayerCharacter player)
        {
            //上
            if (KeyControlInformation.Info.OnMoveUp())
            {
                //表示リストが0だったら無視
                if (_ListViewItemUnits.Count == 0)
                {
                }
                //最初の項目だったら無視
                else if (_ListViewItemUnits.Keys.First() == _LastTarget[nowType])
                {
                }
                //それ以外だったら1つ上の項目に移動
                else
                {
                    //サウンドを鳴らす
                    SoundInformation.Sound.Play(SoundInformation.SoundType.MenuMove);

                    ManageWait.Info.WaitSelect();
                    CommonFunction.SetItemUnSelectBack(_ListViewItemUnits[_LastTarget[nowType]]);
                    //選択中の番号を取得
                    int index = _ListViewItemUnits.Keys.ToList().IndexOf(_LastTarget[nowType]);
                    index--;
                    _LastTarget[nowType] = _ListViewItemUnits.Keys.ElementAt(index);
                    //詳細の更新
                    SetDetailDisplay(_LastTarget[nowType]);
                    CommonFunction.SetItemSelectBack(_ListViewItemUnits[_LastTarget[nowType]]);


                    float height = _ListViewItemUnits.Count * ViewItemUnitHeight;
                    int   n      = _ListViewItemUnits.Count;
                    CommonFunction.SetCenterViewItem(height, _scrollItemView, index, n);
                }
            }
            //下
            else if (KeyControlInformation.Info.OnMoveDown())
            {
                //表示リストが0だったら無視
                if (_ListViewItemUnits.Count == 0)
                {
                }
                //最後の項目だったら無視
                else if (_ListViewItemUnits.Keys.Last() == _LastTarget[nowType])
                {
                }
                //それ以外だったら1つ下の項目に移動
                else
                {
                    //サウンドを鳴らす
                    SoundInformation.Sound.Play(SoundInformation.SoundType.MenuMove);

                    ManageWait.Info.WaitSelect();
                    CommonFunction.SetItemUnSelectBack(_ListViewItemUnits[_LastTarget[nowType]]);
                    //選択中の番号を取得
                    int index = _ListViewItemUnits.Keys.ToList().IndexOf(_LastTarget[nowType]);
                    index++;
                    _LastTarget[nowType] = _ListViewItemUnits.Keys.ElementAt(index);
                    //詳細の更新
                    SetDetailDisplay(_LastTarget[nowType]);
                    CommonFunction.SetItemSelectBack(_ListViewItemUnits[_LastTarget[nowType]]);

                    float height = _ListViewItemUnits.Count * ViewItemUnitHeight;
                    int   n      = _ListViewItemUnits.Count;
                    CommonFunction.SetCenterViewItem(height, _scrollItemView, index, n);
                }
            }
            //左
            else if (KeyControlInformation.Info.OnMoveLeft())
            {
                //ドライブを見るの場合無視
                if (nowState == SelectTurnState.LookDrive)
                {
                }
                //最初の項目だったら無視
                else if (nowType == 1)
                {
                }
                //それ以外だったら1つ左のタブに移動
                else
                {
                    //サウンドを鳴らす
                    SoundInformation.Sound.Play(SoundInformation.SoundType.MenuMove);

                    ManageWait.Info.WaitSelect();
                    SetTabUnSelect(nowType);
                    nowType--;
                    InitializeItemMenu();
                }
            }
            //右
            else if (KeyControlInformation.Info.OnMoveRight())
            {
                //ドライブを見るの場合無視
                if (nowState == SelectTurnState.LookDrive)
                {
                }
                //最後の項目だったら無視
                else if (nowType == ItemMenuTabsCount)
                {
                }
                //それ以外だったら1つ右のタブに移動
                else
                {
                    //サウンドを鳴らす
                    SoundInformation.Sound.Play(SoundInformation.SoundType.MenuMove);

                    ManageWait.Info.WaitSelect();
                    SetTabUnSelect(nowType);
                    nowType++;
                    InitializeItemMenu();
                }
            }
            //キャンセル
            else if (KeyControlInformation.Info.OnKeyDownMenu(KeyType.MenuCancel))
            {
                //ManageWait.Info.Wait(CommonConst.Wait.MenuMove);

                //ドライブを見るの場合
                if (nowState == SelectTurnState.LookDrive)
                {
                    //サウンドを鳴らす
                    SoundInformation.Sound.Play(SoundInformation.SoundType.MenuCancel);

                    nowType = beforeType;
                    _LastTarget[nowType] = beforeTarget;
                    nowState             = TempMain;
                    InitializeItemMenu();
                    FinishSub();
                }
                else
                {
                    //サウンドを鳴らす
                    SoundInformation.Sound.Play(SoundInformation.SoundType.MenuCancel);

                    nowState = SelectTurnState.FinishMenu;
                }
            }
            //オプション参照
            else if (KeyControlInformation.Info.OnKeyDownMenu(KeyType.LookOption))
            {
                if (CommonFunction.IsNull(_ViesOptions) == false &&
                    _ViesOptions.Count >= 1)
                {
                    //サウンドを鳴らす
                    SoundInformation.Sound.Play(SoundInformation.SoundType.MenuOk);

                    InitializeOption();
                    nowState = SelectTurnState.ItemOption;
                }
            }
            //ソート
            else if (KeyControlInformation.Info.OnKeyDownMenu(KeyType.ItemSort))
            {
                //サウンドを鳴らす
                SoundInformation.Sound.Play(SoundInformation.SoundType.MenuOk);

                //ManageWait.Info.Wait(CommonConst.Wait.MenuMove);

                SetTabUnSelect(nowType);
                InitializeItemMenu(true);
            }
            //複数選択
            else if (KeyControlInformation.Info.OnKeyDownMenu(KeyType.MenuMultiSelectOk))
            {
                //表示リストが0だったら無視
                if (_ListViewItemUnits.Count == 0)
                {
                }
                else if (nowState != SelectTurnState.LookDrive)
                {
                    SetItemValue(_ListViewItemUnits[_LastTarget[nowType]], _LastTarget[nowType], _ListViewItemUnits.Keys.ToList().IndexOf(_LastTarget[nowType]));
                }
            }
            //決定
            else if (KeyControlInformation.Info.OnKeyDownMenu(KeyType.MenuOk))
            {
                nowState = ExeItemMenu(nowState, player);
            }

            return(nowState);
        }
Пример #8
0
    private void StartMain()
    {
        GameObject gm = new GameObject("FloorChanger");

        _manageFade = gm.AddComponent <ManageFade>();
        _manageFade.SetupFade();
        _manageFade.Wait = 0.01f;
        _manageFade.PlayFadeOut(false);

        GameObject.Find("OnBGMCheck").GetComponent <Toggle>().isOn =
            MusicInformation.Music.IsMusicOn;

        GameObject.Find("OnSoundCheck").GetComponent <Toggle>().isOn =
            SoundInformation.Sound.IsPlay;

        GameObject.Find("OnVoiceCheck").GetComponent <Toggle>().isOn =
            VoiceInformation.Voice.IsPlay;

        if (KeyControlInformation.Info.OpMode == OperationMode.UseMouse)
        {
            GameObject.Find("UseMouse").GetComponent <Toggle>().isOn =
                true;
        }

        if (ScoreInformation.Info.PlayerNameBase != CommonConst.Message.UnityChanName && ScoreInformation.Info.PlayerNameBase != CommonConst.Message.StellaChanName)
        {
            GameObject.Find("NameInputField").GetComponent <InputField>().text = ScoreInformation.Info.PlayerNameBase;
        }
        else
        {
            GameObject.Find("NameInputField").GetComponent <InputField>().text = "";
        }

        //MusicInformation.Music.Setup(MusicInformation.MusicType.CharacterSelect);

        ScrollViewSelected         = GameObject.Find("SelectTargetScrollView");
        ScrollViewSelectedUnit     = GameObject.Find("SelectUnit");
        ScrollViewSelectedContents = GameObject.Find("SelectTargetContent");

        _keyDisp = GameObject.Find("KeyDisplayPanel");

        CharacterStatusPanel = GameObject.Find("CharacterStatusPanel");
        DungeonStatusPanel   = GameObject.Find("DungeonStatusPanel");

        ScrollViewSelectedUnit.SetActive(false);
        DungeonStatusPanel.SetActive(false);

        SelectedList = new Dictionary <long, GameObject>();

        _state = SelectTurnState.ManageStart;

        _keyDisp.SetActive(false);


        //ダンジョンデータを読み込み
        Dungeons = TableDungeonMaster.GetAllValue();
        //キャラクターデータを読み込み
        Characters = TablePlayer.GetAllValue();
        //初期選択を格納
        SelectCharacter = Characters.First().Value.ObjNo;
        InitialzeContent(Characters, SelectCharacter);

        MainThreadDispatcher.StartUpdateMicroCoroutine(TransSceneStart(1f));
    }
Пример #9
0
    private void UpdateMain()
    {
        if (ManageWait.Info.IsWait == true)
        {
            return;
        }
        if (isFading == true)
        {
            return;
        }


        _keyDisp.SetActive(false);
        //キー表示の場合はキー表示を優先する
        if (Input.GetKey(KeyControlInformation.Info.KeyDisplay))
        {
            SetKeyDisplay();
        }
        //キャラクター選択の時
        else if (_state == SelectTurnState.CharacterSelect)
        {
            if (UnityEngine.EventSystems.EventSystem.current.currentSelectedGameObject == GameObject.Find("NameInputField"))
            {
                return;
            }

            //上
            if (KeyControlInformation.Info.OnMoveUp())
            {
                SelectCharacter = SelectUp(SelectedList, SelectCharacter);

                //詳細の更新
                SetCharacterDetail(SelectCharacter);
            }
            //下
            else if (KeyControlInformation.Info.OnMoveDown())
            {
                SelectCharacter = SelectDown(SelectedList, SelectCharacter);

                //詳細の更新
                SetCharacterDetail(SelectCharacter);
            }
            else if (Input.GetKeyDown(KeyControlInformation.Info.MenuOk))
            {
                DecisionCharacter();
            }
        }
        //アクション選択の時
        else if (_state == SelectTurnState.ActionSelectStart)
        {
        }
        //キャラクターアニメーションの時
        else if (_state == SelectTurnState.CharacterAnimation)
        {
            Animator anim = TargetPlayCharacter.GetComponent <Animator>();

            // 参照用のステート変数にBase Layer (0)の現在のステートを設定する
            AnimatorStateInfo currentBaseState = anim.GetCurrentAnimatorStateInfo(0);

            if (currentBaseState.fullPathHash != idleState)
            {
                anim.SetBool("IsStart", false);
            }
        }
        //ダンジョン選択前処理
        else if (_state == SelectTurnState.DungeonSelectStart)
        {
            InitialzeContent(Dungeons, Dungeons.First().Value.DungeonObjNo);
            _state = SelectTurnState.DungeonSelect;
        }
        else if (_state == SelectTurnState.DungeonSelect)
        {
            if (UnityEngine.EventSystems.EventSystem.current.currentSelectedGameObject == GameObject.Find("NameInputField"))
            {
                return;
            }

            //上
            if (KeyControlInformation.Info.OnMoveUp())
            {
                SelectDungeon = SelectUp(SelectedList, SelectDungeon);

                //詳細の更新
                SetDungeonDetail(SelectDungeon);
            }
            //下
            else if (KeyControlInformation.Info.OnMoveDown())
            {
                SelectDungeon = SelectDown(SelectedList, SelectDungeon);

                //詳細の更新
                SetDungeonDetail(SelectDungeon);
            }
            //ダンジョン決定 シーン移動
            else if (Input.GetKeyDown(KeyControlInformation.Info.MenuOk))
            {
                DecisionDungeon();
            }
            if (Input.GetKeyDown(KeyControlInformation.Info.MenuCancel))
            {
                CancelDungeon();
            }
        }
    }