Example #1
0
 public void PassViewOpen(Result.VictoryPlayer Victory, Result.HitPosition[] HitPos, float[] HitTime, int AfterLife = 0)
 {
     Debug.Log(Victory + "," + HitPos[0] + "," + HitTime[0] + "," + AfterLife);
     Debug.Log(Victory + "," + HitPos[1] + "," + HitTime[1] + "," + AfterLife);
     uiArrow.SetBool("isStart", true);
     photonView.RPC("ViewOpen", PhotonTargets.AllViaServer, Victory, HitPos, HitTime, AfterLife);
 }
Example #2
0
    public void ViewOpen(Result.VictoryPlayer Victory, Result.HitPosition[] HitPos, float[] HitTime, int AfterLife = 0)
    {
        Player1.hitTime     = HitTime[0];
        Player2.hitTime     = HitTime[1];
        Player1.hitPosition = HitPos[0];
        Player2.hitPosition = HitPos[1];

        // uiStringの7,8番目はヒットタイムが入る
        uiString[7] = (Mathf.Floor(Player1.hitTime * 100) / 100).ToString() + "s!";
        uiString[8] = (Mathf.Floor(Player2.hitTime * 100) / 100).ToString() + "s!";

        // ここにuiStringを見て値をセットするとその文字が出る
        //                  {hitpos, time, victriyPlayer}の順
        int[] stringNum1P = null;
        int[] stringNum2P = null;
        int   p1          = (int)Player1.hitPosition + 3;
        int   p2          = (int)Player2.hitPosition + 3;

        Debug.Log(p1 + " " + p2);
        switch (Victory)
        {
        case Result.VictoryPlayer.None:     // 引き分け
            stringNum1P = new int[] { p1, 7, 0 };
            stringNum2P = new int[] { p2, 8, 0 };
            break;

        case Result.VictoryPlayer.Player1:
            stringNum1P         = new int[] { p1, 7, 1 };
            stringNum2P         = new int[] { p2, 9, 2 };
            Player2.hitPosition = Result.HitPosition.Null;
            Player2.life        = AfterLife;
            break;

        case Result.VictoryPlayer.Player2:
            stringNum1P         = new int[] { p1, 9, 2 };
            stringNum2P         = new int[] { p2, 8, 1 };
            Player1.hitPosition = Result.HitPosition.Null;
            Player1.life        = AfterLife;
            break;

        default:
            Debug.LogError("Victoryエラー");
            break;
        }
        StartCoroutine(BodyBrenk(Player1));
        StartCoroutine(BodyBrenk(Player2));
        ScoreTextUISet(Player1, stringNum1P);
        ScoreTextUISet(Player2, stringNum2P);
    }
Example #3
0
    private ResultEvent fadeImage;                                  //resultの上にフェードインで表示する看板の画像

    //***********************************************************************************************************************************

    /// <summary>
    /// リザルトを開く
    /// </summary>
    /// <param name="HitPos">命中箇所</param>
    /// <param name="HitTime">命中までの時間</param>
    /// <param name="Victory">勝者</param>
    /// <param name="AfterLife">変動した後のライフ</param>
    public void ViewOpen(Result.HitPosition HitPos, float HitTime, Result.VictoryPlayer Victory, int AfterLife)
    {
        StartCoroutine(ViewClose());

        switch (HitPos)
        {
        case Result.HitPosition.Null:

            hitPositionText.SetText("Miss...", -1, 1.5f);
            break;

        case Result.HitPosition.Legs:
            hitPositionText.SetText("Hit!Legs!", -1, 1.5f);
            break;

        case Result.HitPosition.Arms_Body:
            hitPositionText.SetText("Great!  Arms or Body!", -1, 1.5f);
            break;

        case Result.HitPosition.Head:
            hitPositionText.SetText("Exciting!  HeadShot!", -1, 1.5f);
            break;
        }
        if (HitPos != Result.HitPosition.Null)
        {
            playerHitTimeText[0].SetText("YourHitTime is ... ", -1, 2.5f);
            playerHitTimeText[1].SetText(HitTime.ToString() + "s!", -1f, 3);
        }
        else
        {
            for (int i = 0; i < 2; i++)
            {
                playerHitTimeText[i].SetText(" ", 0, 2.5f);
            }
        }
        if (HitPos != Result.HitPosition.Null)
        {
            enemyHitTimeText[0].SetText("EnemyHitTime is ...", -1, 4);
            enemyHitTimeText[1].SetText(HitTime.ToString() + "s!", -1f, 4.5f);
        }
        else
        {
            for (int i = 0; i < 2; i++)
            {
                enemyHitTimeText[i].SetText(" ", 0, 4f);
            }
        }
        switch (Victory)
        {
        case Result.VictoryPlayer.None:
            victoryText.SetText("Draw", 2, 6f);
            break;

        case Result.VictoryPlayer.Player1:
            victoryText.SetText("Victory!!!", 2, 6f);
            lifeText[0].SetText(null, -1f, 8);
            lifeText[1].SetText(AfterLife.ToString(), -1f, 8);
            break;

        default:
            victoryText.SetText("Lose...", 2, 6f);
            lifeText[0].SetText(AfterLife.ToString(), -1f, 8);
            lifeText[1].SetText(null, -0.5f, 8);
            break;
        }
    }