1234567891011121314151617181920212223242526272829303132 |
- using UnityEngine;
- using UnityEngine.UI;
- using System.Collections;
- public class SwapBtn : MonoBehaviour
- {
- public Image lightImage;
- private Craft craft;
- public void SetCraft(Craft craft)
- {
- this.craft = craft;
- FixedUpdate () ;
- }
-
- void FixedUpdate ()
- {
- if(craft != null)
- {
- if(craft.GetSwapManager().isPreparingSwap || !craft.IsLeaveDamage())
- {
- lightImage.fillAmount = 0;
- }
- else
- {
- lightImage.fillAmount = craft.GetSwapManager().GetSwapCoolDown() / SwapManager.SWAP_CD;
- }
- }
- }
- }
|