using DG.Tweening;
|
using System.Collections;
|
using System.Collections.Generic;
|
using UnityEngine;
|
using UnityEngine.UI;
|
|
public class TowerBloodVis : MonoBehaviour
|
{
|
/// <summary>
|
/// 背景图片
|
/// </summary>
|
public Image bgImage;
|
|
// Start is called before the first frame update
|
void Start()
|
{
|
}
|
|
/// <summary>
|
/// 设置当前的Health Scale.
|
/// </summary>
|
/// <param name="scale"></param>
|
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()
|
{
|
|
}
|
}
|