Ejemplo n.º 1
0
    private void Awake()
    {
        ptp                  = selectTankObject.GetComponent <PlayerTankParameter>();
        psui                 = transform.parent.transform.parent.gameObject.GetComponent <PlayerSelectUI>();
        lifeNumText          = parameterPanel.transform.Find("Life").gameObject.GetComponent <Text>();
        moveSpeedText        = parameterPanel.transform.Find("MoveSpeed").gameObject.GetComponent <Text>();
        shotSpeedText        = parameterPanel.transform.Find("ShotSpeed").gameObject.GetComponent <Text>();
        bulletNumText        = parameterPanel.transform.Find("BulletNum").gameObject.GetComponent <Text>();
        descriptionText      = parameterPanel.transform.Find("Description").gameObject.GetComponent <Text>();
        announceText         = parameterPanel.transform.Find("Announce").gameObject.GetComponent <Text>();
        releaseConditionText = parameterPanel.transform.Find("ReleaseCondition").gameObject.GetComponent <Text>();

        int moveS = (int)(ptp.GetMoveSpeedMagni() * 100);
        int shotS = (int)(ptp.GetShotSpeedMagni() * 100);

        if (moveS % 5 != 0)
        {
            moveS++;
        }
        if (shotS % 5 != 0)
        {
            shotS++;
        }

        lifeNum     = "ライフ: " + ptp.GetLifeNum();
        moveSpeed   = "移動速度: " + moveS;
        shotSpeed   = "発射速度: " + shotS;
        bulletNum   = "装弾数: " + ptp.GetShotAbleBulletNum();
        description = "特徴: " + ptp.GetDescription();
        if (ptp.GetTankNumber() >= 21 && PlayerPrefs.GetInt("UseableTank" + ptp.GetTankNumber(), 0) == 0)
        {
            releaseCondition = ptp.GetReleaseCondition();
        }
        else if (MainGameController.gameNumber == 2)
        {
            announce = ptp.GetAnnounce();
        }
    }
Ejemplo n.º 2
0
 public void OnPress()
 {
     if (ptp.GetTankNumber() >= 21)
     {
         //戦車がまだ解放されていなかったら選べない
         if (PlayerPrefs.GetInt("UseableTank" + ptp.GetTankNumber(), 0) != 1)
         {
             SEManager.PlaySound(SEManager.cannotSound);
             return;
         }
     }
     SEManager.PlaySubmitSound();
     if (MainGameController.gameNumber == 1)
     {
         SingleMissionStaticData.selectTankNumber = ptp.GetTankNumber();
         SingleMissionStaticData.playerLife       = ptp.GetLifeNum();
     }
     else if (MainGameController.gameNumber == 2)
     {
         SingleSurvivalStaticData.selectTankNumber = ptp.GetTankNumber();
     }
     psui.SetSelectTankNum(ptp.GetTankNumber());
     psui.PressTankButton();
 }