using DG.Tweening; using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.UI; public class TowerBloodVis : MonoBehaviour { /// /// 背景图片 /// public Image bgImage; // Start is called before the first frame update void Start() { } /// /// 设置当前的Health Scale. /// /// public void SetHealthScale( float scale) { if( scale == 0.0f) { Destroy(this); } else if( scale < 0.34f) { bgImage.rectTransform.DOScaleX( 0.666666f,0.3f ); } else if( scale < 0.67f) { bgImage.rectTransform.DOScaleX( 0.333333f, 0.3f); } else { bgImage.rectTransform.DOScaleX(0.0f, 0.3f); } } // Update is called once per frame void Update() { } }