Exemplo n.º 1
0
    IEnumerator Changestate(float waitime)
    {
        yield return(new WaitForSeconds(waitime));

        isDeadUIShowing           = false;
        PlayerController.DeadType = 0;
        DeadUI.SetActive(false);
    }
Exemplo n.º 2
0
 // Use this for initialization
 void Start()
 {
     facingRight  = true;
     myRigidbody  = GetComponent <Rigidbody2D>();
     myAnimator   = GetComponent <Animator>();
     ourHealth    = maxHealth;
     gm           = GameObject.FindGameObjectWithTag("gamemaster").GetComponent <Gamemaster>();
     soundManager = GameObject.FindGameObjectWithTag("Sounds").GetComponent <SoundManager>();
     at           = GameObject.FindGameObjectWithTag("attri").GetComponent <AttackPlayer>();
     te           = GameObject.FindGameObjectWithTag("Enemy").GetComponent <TestEnemy>();
     eyybd        = GameObject.FindGameObjectWithTag("Enemy1").GetComponent <EnemyyBlood>();
     // ob = GameObject.FindGameObjectWithTag("Oc").GetComponent<OcBlood>();
     // ns = GameObject.FindGameObjectWithTag("Nhim").GetComponent<NhimScrips>();
     dead = GameObject.FindGameObjectWithTag("MainCamera").GetComponent <DeadUI>();
 }
Exemplo n.º 3
0
    // 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);
    }
 private void Awake()
 {
     instance = this;
     gameObject.SetActive(false);
 }
Exemplo n.º 5
0
 public void PlayerDied()
 {
     RaceMode = RaceMode.Dead;
     DeadUI.Show();
     StartCoroutine(ResetRoutine());
 }