示例#1
0
    // TODO if(&& anySoundIsPlaying) steps etc
    void Update()
    {
        player = GameObject.FindGameObjectWithTag("Player").gameObject;
        if (player.name.Equals("Lolo"))
        {
            if (player.GetComponent <LoloSkills>().curState == LoloSkills.State.SilentWalk)
            {
                isLolo = true;
            }
        }
        else
        {
            isLolo = false;
        }

        if (player != null && !isLolo)
        {
            if (Mathf.Abs(player.transform.position.x - gameObject.transform.position.x) < rangeToBear && Mathf.Abs(player.transform.position.y - gameObject.transform.position.y) < rangeToBear / 2)
            {
                wakedUp = true;
                deathScreen.SetActive(true);
                gameManager.DisableMovement();
                Invoke("ActivateFailedUI", 4.5f);
            }
        }
    }
 private void Update()
 {
     if (door.doorOpened)
     {
         WinLevel();
         levelPassed.SetActive(true);
         gameManagerr.DisableMovement();
     }
 }
 private void OnTriggerEnter2D(Collider2D collision)
 {
     if (collision.gameObject.name.Equals("Karyak") && state.curState == KaryakSkills.State.Invisible)
     {
         return;
     }
     if (collision.gameObject.CompareTag("Player"))
     {
         failedUI.SetActive(true);
         gameManagerr.DisableMovement();
         icicleRB.bodyType = RigidbodyType2D.Static;
         if (collision.gameObject.name.Equals("Karyak"))
         {
             state.curState = KaryakSkills.State.Normal;
         }
         Debug.Log("Killed by icicle");
     }
 }