Пример #1
0
    public Text RightSelect()
    {
        //母音番号切り替え
        aiueoNo++;

        //右の行にいっちゃう
        if (aiueoNo >= 5)
        {
            //母音番号は最初から
            aiueoNo = 0;

            //行番号切り替え
            gyouNo++;

            //もし画面右から左の行に移動するなら特例処理
            if (gyouNo % 3 == 0)
            {
                gyouNo -= 3;
            }
        }

        //テキストデータスクリプトから情報取得
        type       = gyou[gyouNo].GetType();
        selectText = gyou[gyouNo].GetText(aiueoNo);

        //テキスト情報がなかった
        if (selectText == null)
        {
            //テキスト情報の入ったものが出るまで再帰処理
            selectText = RightSelect();
            return(selectText);
        }
        return(selectText);
    }
Пример #2
0
 // Use this for initialization
 void Awake()
 {
     aiueoNo    = 0;
     gyouNo     = 0;
     type       = ResultHiraganaData.EHiraganaType.TYPE_TEXT;
     selectText = selectText = gyou[gyouNo].GetText(aiueoNo);
 }
    //trueで終了押された
    public bool Select()
    {
        if (StartChecker == false)
        {
            return(false);
        }

        if (Input.GetKeyDown(KeyCode.RightArrow) && Fade.FadeEnd())
        {
            //色制御と選択
            SelectText.color   = NonSelectTextColor;
            SelectText         = hiraganaSelect.RightSelect();
            NonSelectTextColor = SelectText.color;
            SelectText.color   = SelectTextColor;

            type = hiraganaSelect.GetType();

            //SE
            if (BGMManager.Instance != null)
            {
                BGMManager.Instance.PlaySE("Cursor_Move");
            }
        }
        if (Input.GetKeyDown(KeyCode.LeftArrow) && Fade.FadeEnd())
        {
            //色制御と選択
            SelectText.color   = NonSelectTextColor;
            SelectText         = hiraganaSelect.LeftSelect();
            NonSelectTextColor = SelectText.color;
            SelectText.color   = SelectTextColor;

            type = hiraganaSelect.GetType();

            //SE
            if (BGMManager.Instance != null)
            {
                BGMManager.Instance.PlaySE("Cursor_Move");
            }
        }
        if (Input.GetKeyDown(KeyCode.UpArrow) && Fade.FadeEnd())
        {
            //色制御と選択
            SelectText.color   = NonSelectTextColor;
            SelectText         = hiraganaSelect.TopSelect();
            NonSelectTextColor = SelectText.color;
            SelectText.color   = SelectTextColor;

            type = hiraganaSelect.GetType();

            //SE
            if (BGMManager.Instance != null)
            {
                BGMManager.Instance.PlaySE("Cursor_Move");
            }
        }
        if (Input.GetKeyDown(KeyCode.DownArrow) && Fade.FadeEnd())
        {
            //色制御と選択
            SelectText.color   = NonSelectTextColor;
            SelectText         = hiraganaSelect.DownSelect();
            NonSelectTextColor = SelectText.color;
            SelectText.color   = SelectTextColor;

            type = hiraganaSelect.GetType();

            //SE
            if (BGMManager.Instance != null)
            {
                BGMManager.Instance.PlaySE("Cursor_Move");
            }
        }

        //カーソルスケール変更
        Vector3 scale = cursor.transform.localScale;

        scale.x = hiraganaSelect.GetScaleX();
        cursor.transform.localScale = scale;

        //カーソル位置変更
        cursor.transform.position = SelectText.transform.position;

        //アンダーバー制御
        if (textLength < 5)
        {
            InputString.text   = InputString.text.Replace("_", "");
            anderBarTimeCount += Time.deltaTime;

            if (anderBarTimeCount < ANDER_BAR_TIME * 0.5f)
            {
                InputString.text = InputString.text + "_";
            }
            if (anderBarTimeCount > ANDER_BAR_TIME)
            {
                anderBarTimeCount = 0.0f;
            }
        }

        //戻るキー押された
        if (Input.GetKeyDown(KeyCode.Escape))
        {
            //テキスト一文字削除
            if (textLength > 0)
            {
                InputString.text = InputString.text.Replace("_", "");
                InputString.text = InputString.text.Remove(textLength - 1);
                textLength--;
                //SE
                if (BGMManager.Instance != null)
                {
                    BGMManager.Instance.PlaySE("Cursor_Cancel");
                }
            }
        }

        //決定キー押された
        if (Input.GetKeyDown(KeyCode.Space) || Input.GetMouseButton(0) || Input.GetKeyDown(KeyCode.KeypadEnter) || Input.GetKeyDown(KeyCode.Joystick1Button0))
        {
            switch (type)
            {
            case ResultHiraganaData.EHiraganaType.TYPE_TEXT:
                if (InputString != null && textLength < 5)
                {
                    InputString.text = InputString.text.Replace("_", "");
                    InputString.text = InputString.text + SelectText.text;
                    textLength++;
                    //SE
                    if (BGMManager.Instance != null)
                    {
                        BGMManager.Instance.PlaySE("Cursor_Decision");
                    }
                }
                break;

            case ResultHiraganaData.EHiraganaType.TYPE_BACKSPACE:
                //テキスト一文字削除
                if (textLength > 0)
                {
                    InputString.text = InputString.text.Replace("_", "");
                    InputString.text = InputString.text.Remove(textLength - 1);
                    textLength--;
                    //SE
                    if (BGMManager.Instance != null)
                    {
                        BGMManager.Instance.PlaySE("Cursor_Cancel");
                    }
                }
                break;

            case ResultHiraganaData.EHiraganaType.TYPE_END:
                //テキスト入力終了(1文字以上ある場合)
                if (textLength > 0)
                {
                    InputString.text = InputString.text.Replace("_", "");
                    SaveName();
                    //SE
                    if (BGMManager.Instance != null)
                    {
                        BGMManager.Instance.PlaySE("Cursor_Decision");
                    }
                    return(true);
                }
                else
                {
                    //SE
                    if (BGMManager.Instance != null)
                    {
                        BGMManager.Instance.PlaySE("Cursor_Cancel");
                    }
                }
                break;
            }
        }

        return(false);
    }
Пример #4
0
 public ResultHiraganaData.EHiraganaType GetType()
 {
     //テキストデータスクリプトから情報取得
     type = gyou[gyouNo].GetType();
     return(type);
 }