Ejemplo n.º 1
0
    public void PlayerRecovery(int recoveryValue)
    {
        player_HP += recoveryValue;
        if (player_HP > PLAYER_HPMAX)
        {
            player_HP = PLAYER_HPMAX;
        }
        gauge_HP.rectTransform.localScale = new Vector2(player_HP / PLAYER_HPMAX, 1.0f);
        GaugeColorChanger gcc = gauge_HP.GetComponent <GaugeColorChanger>();

        gcc.ColorChange();
    }
Ejemplo n.º 2
0
    public void PlayerDamage(int damage)
    {
        player_HP -= damage;
        if (player_HP <= 0)
        {
            player_HP      = 0;
            gameObject.tag = "DownPlayer";
        }
        gauge_HP.rectTransform.localScale = new Vector2(player_HP / PLAYER_HPMAX, 1.0f);
        GaugeColorChanger gcc = gauge_HP.GetComponent <GaugeColorChanger>();

        gcc.ColorChange();
    }
Ejemplo n.º 3
0
    GaugeColorChanger gcc;           //ゲージの色を変化させてくれるやつ


    // Start is called before the first frame update
    void Start()
    {
        gcc       = colony_Value_Gauge.GetComponent <GaugeColorChanger>(); //GaugeColorChangerの取得
        colony_HP = (int)Data.COLONY_VALUE_MAX;                            //HPの最大値を取得
    }