void Change_CD() { if (CD_UI.GetComponent <Image>().fillAmount > 0) { CD_UI.transform.Find("Text").gameObject.SetActive(true); CD_UI.GetComponent <Image>().fillAmount -= 0.01f; Change_CD_Text(); } else { CD_UI.GetComponent <Image>().fillAmount = 0; ship_cam.GetComponent <ShipCamControl>().cd = false; CD_UI.transform.Find("Text").gameObject.SetActive(false); Debug.Log("Cancel_CD_Change"); CancelInvoke("Change_CD"); } }
void Change_CD_Text() { CD_UI.transform.Find("Text").GetComponent <Text>().text = (int)(20 * CD_UI.GetComponent <Image>().fillAmount) + "S"; }
public void Fish_CD() { CD_UI.GetComponent <Image>().fillAmount = 1; ship_cam.GetComponent <ShipCamControl>().cd = false; InvokeRepeating("Change_CD", 0f, 0.2f); }