Exemplo n.º 1
0
 // Use this for initialization
 void Start()
 {
     textSprite   = (exSpriteFont)this.gameObject.GetComponent <exSpriteFont>();
     common       = (CommonScript)GameObject.Find("Common").GetComponent <CommonScript>();
     screenWidth  = Screen.width;
     screenHeight = Screen.height;
 }
Exemplo n.º 2
0
 public ScriptTokenProcessor(CommonScript script, ScriptDbObject dbObject, DbInterpreter sourceInterpreter, DbInterpreter targetInterpreter)
 {
     this.Script            = script;
     this.DbObject          = dbObject;
     this.SourceInterpreter = sourceInterpreter;
     this.TargetInterpreter = targetInterpreter;
 }
Exemplo n.º 3
0
        void Start()
        {
            var player = PlayerIndexes.FromArrayIndex(this.playerIndex);

            mainCameraScript = GameObject.Find("Main Camera").GetComponent <CameraBehaviour>();
            #region 当たり判定
            opponent          = CommonScript.ReverseTeban(player);
            opponentHitboxTag = ThisSceneDto.HitboxTags[this.Opponent][(int)HitboxIndex.Hitbox];

            hitboxsSpriteRenderer = new SpriteRenderer[] {
                GameObject.Find(ThisSceneDto.HitboxPaths[player][(int)HitboxIndex.Hitbox]).GetComponent <SpriteRenderer>(),
                GameObject.Find(ThisSceneDto.HitboxPaths[player][(int)HitboxIndex.Weakbox]).GetComponent <SpriteRenderer>(),
                GameObject.Find(ThisSceneDto.HitboxPaths[player][(int)HitboxIndex.Strongbox]).GetComponent <SpriteRenderer>(),
            };
            weakboxCollider2D = GameObject.Find(ThisSceneDto.HitboxPaths[player][(int)HitboxIndex.Weakbox]).GetComponent <BoxCollider2D>();
            #endregion
            #region ジャンプ
            groundLayer = LayerMask.GetMask("Ground");
            Rigidbody2D = GetComponent <Rigidbody2D>();
            animator    = GetComponent <Animator>();
            #endregion

            // x位置を共有できるようにするぜ☆
            ThisSceneDto.PlayerToTransform[player] = transform;
        }
Exemplo n.º 4
0
 // Use this for initialization
 void Start()
 {
     textSprite = (exSpriteFont)this.gameObject.GetComponent<exSpriteFont>();
     common = (CommonScript)GameObject.Find("Common").GetComponent<CommonScript>();
     screenWidth = Screen.width;
     screenHeight = Screen.height;
 }
 FacingOpponentLR GetFacingOfOpponentLR()
 {
     // 自分と相手の位置(相手が右側にいるとき正となるようにする)
     if (0 <= SceneCommon.Player_to_transform[(int)CommonScript.ReverseTeban((PlayerIndex)playerIndex)].position.x - transform.position.x)
     {
         return(FacingOpponentLR.Right);
     }
     return(FacingOpponentLR.Left);
 }
Exemplo n.º 6
0
        FacingOpponentLR GetFacingOfOpponentLR()
        {
            var player = PlayerIndexes.FromArrayIndex(this.playerIndex);

            // 自分と相手の位置(相手が右側にいるとき正となるようにする)
            if (0 <= ThisSceneDto.PlayerToTransform[CommonScript.ReverseTeban(player)].position.x - transform.position.x)
            {
                return(FacingOpponentLR.Right);
            }
            return(FacingOpponentLR.Left);
        }
Exemplo n.º 7
0
        public void SetScriptName(CommonScript script, FullIdContext idContext)
        {
            UidContext[] ids = idContext.uid();

            var name = ids.Last();

            script.Name = new TokenInfo(name);

            if (ids.Length > 1)
            {
                script.Owner = new TokenInfo(ids.First());
            }
        }
        ///// <summary>
        ///// 現在のアニメーション・クリップに対応したデータを取得。
        ///// </summary>
        ///// <returns></returns>
        //public CliptypeExRecordable GetCurrentCliptypeExRecord(CliptypeExTable cliptypeExTable)
        //{
        //    AnimatorStateInfo animeStateInfo = animator.GetCurrentAnimatorStateInfo(0);

        //    CliptypeIndex aclipType = (CliptypeIndex)((StateExRecord)StateExTable.Instance.index_to_exRecord[StateExTable.Instance.hash_to_index[animeStateInfo.fullPathHash]]).Cliptype;

        //    if (cliptypeExTable.index_to_exRecord.ContainsKey((int)aclipType))
        //    {
        //        return cliptypeExTable.index_to_exRecord[(int)aclipType];
        //    }

        //    throw new UnityException("aclipType = [" + aclipType + "]に対応するアニメーション・クリップのレコードが無いぜ☆");
        //}


        /// <summary>
        /// 相手に向かって進んでいるか、相手から離れているか、こっちからは動いていないかを判定する。
        /// </summary>
        /// <param name="leverX"></param>
        /// <returns></returns>
        public FacingOpponentMoveFwBkSt GetFacingOpponentMoveFwBkSt(float leverX)
        {
            if (0.0f == leverX)
            {
                return(FacingOpponentMoveFwBkSt.Stay);
            }
            if (Mathf.Sign(SceneCommon.Player_to_transform[(int)CommonScript.ReverseTeban((PlayerIndex)playerIndex)].position.x - transform.position.x)
                ==
                Mathf.Sign(leverX)
                )
            {
                return(FacingOpponentMoveFwBkSt.Forward);
            }
            return(FacingOpponentMoveFwBkSt.Back);
        }
Exemplo n.º 9
0
        ///// <summary>
        ///// 現在のアニメーション・クリップに対応したデータを取得。
        ///// </summary>
        ///// <returns></returns>
        //public CliptypeExRecordable GetCurrentCliptypeExRecord(CliptypeExTable cliptypeExTable)
        //{
        //    AnimatorStateInfo animeStateInfo = animator.GetCurrentAnimatorStateInfo(0);

        //    CliptypeIndex aclipType = (CliptypeIndex)((StateExRecord)StateExTable.Instance.index_to_exRecord[StateExTable.Instance.hash_to_index[animeStateInfo.fullPathHash]]).Cliptype;

        //    if (cliptypeExTable.index_to_exRecord.ContainsKey((int)aclipType))
        //    {
        //        return cliptypeExTable.index_to_exRecord[(int)aclipType];
        //    }

        //    throw new UnityException("aclipType = [" + aclipType + "]に対応するアニメーション・クリップのレコードが無いぜ☆");
        //}


        /// <summary>
        /// 相手に向かって進んでいるか、相手から離れているか、こっちからは動いていないかを判定する。
        /// </summary>
        /// <param name="leverX"></param>
        /// <returns></returns>
        public FacingOpponentMoveFwBkSt GetFacingOpponentMoveFwBkSt(float leverX)
        {
            if (0.0f == leverX)
            {
                return(FacingOpponentMoveFwBkSt.Stay);
            }

            var player = PlayerIndexes.FromArrayIndex(this.playerIndex);

            if (Mathf.Sign(ThisSceneDto.PlayerToTransform[CommonScript.ReverseTeban(player)].position.x - transform.position.x)
                ==
                Mathf.Sign(leverX)
                )
            {
                return(FacingOpponentMoveFwBkSt.Forward);
            }
            return(FacingOpponentMoveFwBkSt.Back);
        }
Exemplo n.º 10
0
 public override string GenerateScripts(CommonScript script)
 {
     if (script is RoutineScript routineScript)
     {
         return(this.GenerateRoutineScripts(routineScript));
     }
     else if (script is ViewScript viewScript)
     {
         return(this.GenearteViewScripts(viewScript));
     }
     else if (script is TriggerScript triggerScript)
     {
         return(this.GenearteTriggerScripts(triggerScript));
     }
     else
     {
         throw new NotSupportedException($"Not support generate scripts for type: {script.GetType()}.");
     }
 }
Exemplo n.º 11
0
        public virtual void ExtractFunctions(CommonScript script, ParserRuleContext node)
        {
            if (node == null || node.children == null)
            {
                return;
            }

            foreach (var child in node.children)
            {
                if (this.IsFunction(child))
                {
                    script.Functions.Add(new TokenInfo(child as ParserRuleContext));
                }
                else if (child is ParserRuleContext)
                {
                    this.ExtractFunctions(script, child as ParserRuleContext);
                }
            }
        }
        void Start()
        {
            mainCameraScript = GameObject.Find("Main Camera").GetComponent <Main_CameraScript>();
            #region 当たり判定
            opponent          = CommonScript.ReverseTeban((PlayerIndex)playerIndex);
            opponentHitboxTag = SceneCommon.PlayerAndHitbox_to_tag[(int)this.Opponent, (int)HitboxIndex.Hitbox];

            hitboxsSpriteRenderer = new SpriteRenderer[] {
                GameObject.Find(SceneCommon.PlayerAndHitbox_to_path[playerIndex, (int)HitboxIndex.Hitbox]).GetComponent <SpriteRenderer>(),
                GameObject.Find(SceneCommon.PlayerAndHitbox_to_path[playerIndex, (int)HitboxIndex.Weakbox]).GetComponent <SpriteRenderer>(),
                GameObject.Find(SceneCommon.PlayerAndHitbox_to_path[playerIndex, (int)HitboxIndex.Strongbox]).GetComponent <SpriteRenderer>(),
            };
            weakboxCollider2D = GameObject.Find(SceneCommon.PlayerAndHitbox_to_path[playerIndex, (int)HitboxIndex.Weakbox]).GetComponent <BoxCollider2D>();
            #endregion
            #region ジャンプ
            groundLayer = LayerMask.GetMask("Ground");
            Rigidbody2D = GetComponent <Rigidbody2D>();
            animator    = GetComponent <Animator>();
            #endregion

            // x位置を共有できるようにするぜ☆
            SceneCommon.Player_to_transform[playerIndex] = transform;
        }
Exemplo n.º 13
0
    // Use this for initialization
    void Start()
    {
        // Disable rendering of all child items
        foreach (Component component in this.GetComponentsInChildren <Component>())
        {
            if (component.gameObject.renderer != null)
            {
                component.gameObject.renderer.enabled = false;
            }
        }

        fadeTimerStart = 0;
        fadeDone       = true;

        submitButton       = GameObject.Find("SubmitButton").GetComponent <exSprite>();
        submitLabel        = GameObject.Find("SubmitLabel").GetComponent <exSpriteFont>();
        submitButtonActive = false;

        // Disable the submit button to avoid collisions
        submitButton.gameObject.active = false;

        common = (CommonScript)GameObject.Find("Common").GetComponent <CommonScript>();
    }
        /// <summary>
        /// 手番を変えるぜ☆
        /// </summary>
        /// <param name="teban"></param>
        public void SetTeban(PlayerIndex teban)
        {
            CommonScript.Teban = teban;
            PlayerIndex opponent = CommonScript.ReverseTeban(teban);
            //Debug.Log("Teban = " + teban.ToString() + " Opponent = " + opponent.ToString());

            // 先手の色
            {
                player_to_turn[(int)teban].color = Color.white;
                player_to_time[(int)teban].color = Color.white;

                Color outlineColor;
                if (ColorUtility.TryParseHtmlString("#776DC180", out outlineColor))
                {
                    player_to_turnOutline[(int)teban].effectColor = outlineColor;
                    player_to_timeOutline[(int)teban].effectColor = outlineColor;
                }
            }

            // 後手の色
            {
                Color fontColor;
                if (ColorUtility.TryParseHtmlString("#A5A9A9FF", out fontColor))
                {
                    player_to_turn[(int)opponent].color = fontColor;
                    player_to_time[(int)opponent].color = fontColor;
                }

                Color outlineColor;
                if (ColorUtility.TryParseHtmlString("#35298E80", out outlineColor))
                {
                    player_to_turnOutline[(int)opponent].effectColor = outlineColor;
                    player_to_timeOutline[(int)opponent].effectColor = outlineColor;
                }
            }
        }
        // Update is called once per frame
        void Update()
        {
            #region 対局開始表示
            ReadyingTime++;
            if (SceneCommon.READY_TIME_LENGTH == ReadyingTime)
            {
                fight0.SetActive(false);
                fight1.SetActive(false);
            }
            #endregion

            #region 投了判定
            for (int iLoser = (int)PlayerIndex.Player1; iLoser < (int)PlayerIndex.Num; iLoser++)
            {
                if (player_to_charScript[iLoser].IsResign)
                {
                    player_to_charScript[iLoser].IsResign = false;

                    PlayerIndex winner = CommonScript.ReverseTeban((PlayerIndex)iLoser);
                    player_to_winCount[(int)winner]++;

                    if ((int)PlayerIndex.Player1 == iLoser)
                    {
                        // 1プレイヤーの投了
                        CommonScript.Result = Result.Player2_Win;
                    }
                    else if ((int)PlayerIndex.Player2 == iLoser)
                    {
                        // 2プレイヤーの投了
                        CommonScript.Result = Result.Player1_Win;
                    }
                    else
                    {
                        throw new UnityException("どっちが勝ったんだぜ☆?");
                    }

                    // 現在、何ラウンドか☆
                    int round;
                    if (!playerAndRound_to_result[iLoser, 0].activeSelf)//1ラウンド目の星が表示されていないとき。
                    {
                        round = 0;
                    }
                    else if (!playerAndRound_to_result[iLoser, 1].activeSelf)//2ラウンド目の星が表示されていないとき。
                    {
                        round = 1;
                        if (1 < player_to_winCount[(int)winner])//2本先取
                        {
                            SceneManager.LoadScene(CommonScript.Scene_to_name[(int)SceneIndex.Result]);
                            return;
                        }
                    }
                    else//星が2ラウンド目まで表示されているとき☆
                    {
                        round = 2;
                        SceneManager.LoadScene(CommonScript.Scene_to_name[(int)SceneIndex.Result]);
                        return;
                    }

                    //if (round < 2)
                    {
                        playerAndRound_to_result[(int)PlayerIndex.Player1, round].SetActive(true);
                        playerAndRound_to_result[(int)PlayerIndex.Player2, round].SetActive(true);

                        Sprite[] sprites = Resources.LoadAll <Sprite>("Sprites/ResultMark0");
                        if (PlayerIndex.Player1 == winner)
                        {
                            playerAndRound_to_result[(int)PlayerIndex.Player1, round].GetComponent <Image>().sprite = System.Array.Find <Sprite>(sprites, (sprite) => sprite.name.Equals("ResultMark0_0"));
                            playerAndRound_to_result[(int)PlayerIndex.Player2, round].GetComponent <Image>().sprite = System.Array.Find <Sprite>(sprites, (sprite) => sprite.name.Equals("ResultMark0_1"));
                        }
                        else if (PlayerIndex.Player2 == winner)
                        {
                            playerAndRound_to_result[(int)PlayerIndex.Player1, round].GetComponent <Image>().sprite = System.Array.Find <Sprite>(sprites, (sprite) => sprite.name.Equals("ResultMark0_1"));
                            playerAndRound_to_result[(int)PlayerIndex.Player2, round].GetComponent <Image>().sprite = System.Array.Find <Sprite>(sprites, (sprite) => sprite.name.Equals("ResultMark0_0"));
                        }

                        InitTime();
                        InitBar();
                        isRoundFinished = false;
                        IsResignCalled  = false;
                        resign0.SetActive(false);
                        player_to_playerChar[(int)PlayerIndex.Player1].transform.position = new Vector3(2.52f, 0.0f);
                        player_to_playerChar[(int)PlayerIndex.Player2].transform.position = new Vector3(-2.52f, 0.0f);
                        ReadyingTime = 0;
                        fight0.SetActive(true);
                        fight1.SetActive(true);
                    }
                }
            }
            #endregion

            #region 時間制限
            if (!isRoundFinished)
            {
                // カウントダウン
                player_to_timeCount[(int)CommonScript.Teban] -= Time.deltaTime; // 前のフレームからの経過時間を引くぜ☆
                player_to_time[(int)CommonScript.Teban].text  = ((int)player_to_timeCount[(int)CommonScript.Teban]).ToString();
            }
            #endregion

            #region HP、残り時間判定
            if (!isRoundFinished)
            {
                //if (bar1_rt.sizeDelta.x <= 0 && bar2_rt.sizeDelta.x <= 0)
                //{
                //    // ダブル・ノックアウト
                //}
                //else
                PlayerIndex loser = PlayerIndex.Num;
                if (player_to_barTransform[(int)PlayerIndex.Player2].sizeDelta.x <= player_to_barTransform[(int)PlayerIndex.Player1].sizeDelta.x ||
                    player_to_timeCount[(int)PlayerIndex.Player2] < 1.0f)
                {
                    // 1プレイヤーの勝ち
                    loser = PlayerIndex.Player2;
                }
                else if (player_to_barTransform[(int)PlayerIndex.Player1].sizeDelta.x <= 0 ||
                         player_to_timeCount[(int)PlayerIndex.Player1] < 1.0f)
                {
                    // 2プレイヤーの勝ち
                    loser = (int)PlayerIndex.Player1;
                }

                if (PlayerIndex.Num != loser)
                {
                    isRoundFinished = true;
                    player_to_charScript[(int)loser].Pull_ResignByLose();
                }
            }
            #endregion
        }
Exemplo n.º 16
0
 // Setup common and game state
 void SetupCommon()
 {
     common = (CommonScript)GameObject.Find("Common").GetComponent<CommonScript>();
 }
Exemplo n.º 17
0
    // Use this for initialization
    void Start()
    {
        // Disable rendering of all child items
        foreach (Component component in this.GetComponentsInChildren<Component>()) {
            if (component.gameObject.renderer != null) {
                component.gameObject.renderer.enabled = false;
            }
        }

        fadeTimerStart = 0;
        fadeDone = true;

        submitButton = GameObject.Find("SubmitButton").GetComponent<exSprite>();
        submitLabel = GameObject.Find("SubmitLabel").GetComponent<exSpriteFont>();
        submitButtonActive = false;

        // Disable the submit button to avoid collisions
        submitButton.gameObject.active = false;

        common = (CommonScript)GameObject.Find("Common").GetComponent<CommonScript>();
    }
Exemplo n.º 18
0
 public abstract string GenerateScripts(CommonScript script);
Exemplo n.º 19
0
        public override void Translate()
        {
            if (this.sourceDbInterpreter.DatabaseType == this.targetDbInterpreter.DatabaseType)
            {
                return;
            }

            if (this.hasError)
            {
                return;
            }

            this.LoadMappings();

            SqlAnalyserBase sourceAnalyser = this.GetSqlAnalyser(this.sourceDbInterpreter.DatabaseType);
            SqlAnalyserBase targetAnalyser = this.GetSqlAnalyser(this.targetDbInterpreter.DatabaseType);

            Action <T, CommonScript> processTokens = (dbObj, script) =>
            {
                if (typeof(T) == typeof(Function))
                {
                    AnalyseResult result = sourceAnalyser.AnalyseFunction(dbObj.Definition.ToUpper());

                    if (!result.HasError)
                    {
                        RoutineScript routine = result.Script as RoutineScript;

                        if (this.targetDbInterpreter.DatabaseType == DatabaseType.MySql && routine.ReturnTable != null)
                        {
                            routine.Type = RoutineType.PROCEDURE;
                        }
                    }
                }

                ScriptTokenProcessor tokenProcessor = new ScriptTokenProcessor(script, dbObj, this.sourceDbInterpreter, this.targetDbInterpreter);
                tokenProcessor.UserDefinedTypes = this.UserDefinedTypes;
                tokenProcessor.TargetDbOwner    = this.TargetDbOwner;

                tokenProcessor.Process();

                dbObj.Definition = targetAnalyser.GenerateScripts(script);
            };

            foreach (T dbObj in this.scripts)
            {
                if (this.hasError)
                {
                    break;
                }

                try
                {
                    Type type = typeof(T);

                    this.FeedbackInfo($"Begin to translate {type.Name} \"{dbObj.Name}\".");

                    bool tokenProcessed = false;

                    this.Validate(dbObj);

                    string originalDefinition = dbObj.Definition;

                    AnalyseResult result = sourceAnalyser.Analyse <T>(originalDefinition.ToUpper());

                    CommonScript script = result.Script;

                    bool replaced = false;

                    if (result.HasError)
                    {
                        #region Special handle for view
                        if (typeof(T) == typeof(View))
                        {
                            //Currently, ANTLR can't parse some complex tsql accurately, so it uses general strategy.
                            if (this.sourceDbInterpreter.DatabaseType == DatabaseType.SqlServer)
                            {
                                ViewTranslator viewTranslator = new ViewTranslator(this.sourceDbInterpreter, this.targetDbInterpreter, new List <View>()
                                {
                                    dbObj as View
                                }, this.TargetDbOwner)
                                {
                                    SkipError = this.SkipError
                                };
                                viewTranslator.Translate();

                                replaced = true;
                            }

                            //Currently, ANTLR can't parse some view correctly, use procedure to parse it temporarily.
                            if (this.sourceDbInterpreter.DatabaseType == DatabaseType.Oracle)
                            {
                                string oldDefinition = dbObj.Definition;

                                int asIndex = oldDefinition.IndexOf(" AS ", StringComparison.OrdinalIgnoreCase);

                                StringBuilder sbNewDefinition = new StringBuilder();

                                sbNewDefinition.AppendLine($"CREATE OR REPLACE PROCEDURE {dbObj.Name} AS");
                                sbNewDefinition.AppendLine("BEGIN");
                                sbNewDefinition.AppendLine($"{oldDefinition.Substring(asIndex + 5).TrimEnd(';') + ";"}");
                                sbNewDefinition.AppendLine($"END {dbObj.Name};");

                                dbObj.Definition = sbNewDefinition.ToString();

                                AnalyseResult procResult = sourceAnalyser.Analyse <Procedure>(dbObj.Definition.ToUpper());

                                if (!procResult.HasError)
                                {
                                    processTokens(dbObj, procResult.Script);

                                    tokenProcessed = true;

                                    dbObj.Definition = Regex.Replace(dbObj.Definition, " PROCEDURE ", " VIEW ", RegexOptions.IgnoreCase);
                                    dbObj.Definition = Regex.Replace(dbObj.Definition, @"(BEGIN[\r][\n])|(END[\r][\n])", "", RegexOptions.IgnoreCase);

                                    replaced = true;
                                }
                            }
                        }
                        #endregion
                    }

                    if (!result.HasError && !tokenProcessed)
                    {
                        processTokens(dbObj, script);
                    }

                    bool formatHasError = false;

                    string definition = this.ReplaceVariables(dbObj.Definition);

                    dbObj.Definition = definition; // this.FormatSql(definition, out formatHasError);

                    if (formatHasError)
                    {
                        dbObj.Definition = definition;
                    }

                    if (this.OnTranslated != null)
                    {
                        this.OnTranslated(this.targetDbInterpreter.DatabaseType, dbObj, new TranslateResult()
                        {
                            Error = result.Error, Data = dbObj.Definition
                        });
                    }

                    this.FeedbackInfo($"End translate {type.Name} \"{dbObj.Name}\", translate result: { (result.HasError ? "Error" : "OK") }.");

                    if (!replaced && result.HasError)
                    {
                        this.FeedbackError(this.ParseSqlSyntaxError(result.Error, originalDefinition).ToString(), this.SkipError);

                        if (!this.SkipError)
                        {
                            this.hasError = true;
                        }
                    }
                }
                catch (Exception ex)
                {
                    var sce = new ScriptConvertException <T>(ex)
                    {
                        SourceServer   = this.sourceDbInterpreter.ConnectionInfo.Server,
                        SourceDatabase = this.sourceDbInterpreter.ConnectionInfo.Database,
                        SourceObject   = dbObj.Name,
                        TargetServer   = this.targetDbInterpreter.ConnectionInfo.Server,
                        TargetDatabase = this.targetDbInterpreter.ConnectionInfo.Database,
                        TargetObject   = dbObj.Name
                    };

                    if (!this.SkipError)
                    {
                        this.hasError = true;
                        throw sce;
                    }
                    else
                    {
                        this.FeedbackError(ExceptionHelper.GetExceptionDetails(ex), this.SkipError);
                    }
                }
            }
        }
Exemplo n.º 20
0
 public void SetScriptBody(CommonScript script, RoutineBodyContext body)
 {
     script.Statements.AddRange(this.ParseRoutineBody(body));
 }
Exemplo n.º 21
0
 // Setup common and game state
 void SetupCommon()
 {
     common = (CommonScript)GameObject.Find("Common").GetComponent <CommonScript>();
 }
Exemplo n.º 22
0
        // Update is called once per frame
        void Update()
        {
            #region 対局開始表示
            ReadyingTime++;
            if (ThisSceneDto.ReadyTimeLength == ReadyingTime)
            {
                fight0.SetActive(false);
                fight1.SetActive(false);
            }
            #endregion

            #region 投了判定
            foreach (var loser in PlayerIndexes.All)
            {
                if (this.PlayerDTOs[loser].PlayerCharScript.IsResign)
                {
                    this.PlayerDTOs[loser].PlayerCharScript.IsResign = false;

                    PlayerIndex winner = CommonScript.ReverseTeban(loser);
                    this.PlayerDTOs[winner].WinCount++;

                    if (PlayerIndex.Player1 == loser)
                    {
                        // 1プレイヤーの投了
                        CommonScript.Result = Result.Player2_Win;
                    }
                    else if (PlayerIndex.Player2 == loser)
                    {
                        // 2プレイヤーの投了
                        CommonScript.Result = Result.Player1_Win;
                    }
                    else
                    {
                        throw new UnityException("どっちが勝ったんだぜ☆?");
                    }

                    // 現在、何ラウンドか☆
                    int round;
                    if (!this.PlayerDTOs[loser].RoundsResult[0].activeSelf)//1ラウンド目の星が表示されていないとき。
                    {
                        round = 0;
                    }
                    else if (!this.PlayerDTOs[loser].RoundsResult[1].activeSelf)//2ラウンド目の星が表示されていないとき。
                    {
                        round = 1;
                        if (1 < this.PlayerDTOs[winner].WinCount)//2本先取
                        {
                            SceneManager.LoadScene(CommonScript.Scene_to_name[(int)SceneIndex.Result]);
                            return;
                        }
                    }
                    else//星が2ラウンド目まで表示されているとき☆
                    {
                        round = 2;
                        SceneManager.LoadScene(CommonScript.Scene_to_name[(int)SceneIndex.Result]);
                        return;
                    }

                    //if (round < 2)
                    {
                        this.PlayerDTOs[PlayerIndex.Player1].RoundsResult[round].SetActive(true);
                        this.PlayerDTOs[PlayerIndex.Player2].RoundsResult[round].SetActive(true);

                        Sprite[] sprites = Resources.LoadAll <Sprite>("Sprites/ResultMark0");
                        if (PlayerIndex.Player1 == winner)
                        {
                            this.PlayerDTOs[PlayerIndex.Player1].RoundsResult[round].GetComponent <Image>().sprite = System.Array.Find <Sprite>(sprites, (sprite) => sprite.name.Equals("ResultMark0_0"));
                            this.PlayerDTOs[PlayerIndex.Player2].RoundsResult[round].GetComponent <Image>().sprite = System.Array.Find <Sprite>(sprites, (sprite) => sprite.name.Equals("ResultMark0_1"));
                        }
                        else if (PlayerIndex.Player2 == winner)
                        {
                            this.PlayerDTOs[PlayerIndex.Player1].RoundsResult[round].GetComponent <Image>().sprite = System.Array.Find <Sprite>(sprites, (sprite) => sprite.name.Equals("ResultMark0_1"));
                            this.PlayerDTOs[PlayerIndex.Player2].RoundsResult[round].GetComponent <Image>().sprite = System.Array.Find <Sprite>(sprites, (sprite) => sprite.name.Equals("ResultMark0_0"));
                        }

                        InitTime();
                        InitBar();
                        isRoundFinished = false;
                        IsResignCalled  = false;
                        resign0.SetActive(false);
                        this.PlayerDTOs[PlayerIndex.Player1].PlayerChar.transform.position = new Vector3(2.52f, 0.0f);
                        this.PlayerDTOs[PlayerIndex.Player2].PlayerChar.transform.position = new Vector3(-2.52f, 0.0f);
                        ReadyingTime = 0;
                        fight0.SetActive(true);
                        fight1.SetActive(true);
                    }
                }
            }
            #endregion

            #region
            // 時間制限
            if (!isRoundFinished)
            {
                // カウントダウン
                this.PlayerDTOs[CommonScript.Teban].TimeCount -= Time.deltaTime; // 前のフレームからの経過時間を引くぜ☆
                this.PlayerDTOs[CommonScript.Teban].Time.text  = ((int)this.PlayerDTOs[CommonScript.Teban].TimeCount).ToString();
            }
            #endregion

            #region HP、残り時間判定
            if (!isRoundFinished)
            {
                //if (bar1_rt.sizeDelta.x <= 0 && bar2_rt.sizeDelta.x <= 0)
                //{
                //    // ダブル・ノックアウト
                //}
                //else
                PlayerIndex loser = PlayerIndex.None;
                if (this.PlayerDTOs[PlayerIndex.Player2].BarTransform.sizeDelta.x <= this.PlayerDTOs[PlayerIndex.Player1].BarTransform.sizeDelta.x ||
                    this.PlayerDTOs[PlayerIndex.Player2].TimeCount < 1.0f)
                {
                    // 1プレイヤーの勝ち
                    loser = PlayerIndex.Player2;
                }
                else if (this.PlayerDTOs[PlayerIndex.Player1].BarTransform.sizeDelta.x <= 0 ||
                         this.PlayerDTOs[PlayerIndex.Player1].TimeCount < 1.0f)
                {
                    // 2プレイヤーの勝ち
                    loser = PlayerIndex.Player1;
                }

                if (PlayerIndex.None != loser)
                {
                    isRoundFinished = true;
                    this.PlayerDTOs[loser].PlayerCharScript.Pull_ResignByLose();
                }
            }
            #endregion
        }