// Update is called once per frame void Update() { ep = Squid.GetComponent <EnemyParameter>(); if (ep.hp <= (SquidSc.GetHp() / 2)) { material.SetFloat(propID_h, 0.45f); } Tentacle_Y += i; if (Tentacle_Y > 5.0f) { // 反転 i = -0.12f; } if (Tentacle_Y < -7.0f) { Destroy(this.gameObject); } this.gameObject.transform.position = new Vector3(this.transform.position.x, Tentacle_Y, this.transform.position.z); }
// Start is called before the first frame update void Start() { Squid = GameObject.Find("Squid"); SquidSc = Squid.GetComponent <Squid>(); slider.maxValue = SquidSc.GetHp(); }
// Update is called once per frame void Update() { if (AniCnt <= 50) { AniCnt++; } else { Hpani.SetActive(false); HpFrame.SetActive(true); sliderObj.SetActive(true); } // HPゲージに値を設定 slider.value = SquidSc.GetEp().hp; Debug.Log(SquidSc.GetEp().hp); Debug.Log(SquidSc.GetHp()); }