IEnumerator Changestate(float waitime) { yield return(new WaitForSeconds(waitime)); isDeadUIShowing = false; PlayerController.DeadType = 0; DeadUI.SetActive(false); }
// Update is called once per frame void Update() { //print(PlayerController.DeadType); InkMelt.SetFloat("_Threshold", 1 - GameController.InkDistance / GameController.InkTotalDistance); if (PlayerController.DeadType == 1 || PlayerController.DeadType == 2) { if (!isDeadUIShowing) { DeadInk.GetComponent <Animator>().SetBool("isDead", true); currentShowingText = getDeadTextFromPlayerState(); StartCoroutine(showText(currentShowingText, 10f)); StartCoroutine(EnDisableRestartButton(true, 0.5f)); DeadUI.SetActive(true); } else { DeadInk.GetComponent <Animator>().SetBool("isDead", false); StartCoroutine(EnDisableRestartButton(false, 0.1f)); player = GameObject.FindGameObjectWithTag("Player").gameObject; player.transform.position = GetNewestCheckPoint(); currentShowingText.color = transColor; } DeadUI.SetActive(true); } if (PlayerController.DeadType == 3) { if (!isDeadUIShowing) { DeadInk.GetComponent <Animator>().SetBool("isDead", true); currentShowingText = getDeadTextFromPlayerState(); StartCoroutine(showText(currentShowingText, 10f)); StartCoroutine(EnDisableRestartButton(true, 0.5f)); } else { DeadInk.GetComponent <Animator>().SetBool("isDead", false); StartCoroutine(EnDisableRestartButton(false, 0.1f)); currentShowingText.color = transColor; } DeadUI.SetActive(true); } print("可以画黑画笔吗" + DrawLine2D.can_draw_black); //print("黑" + DrawLine2D.can_draw_black + "蓝" + // DrawBlueLine.can_draw_blue + "红" + // DrawRedLine.can_draw_red); }