예제 #1
0
 private void OnTriggerExit2D(Collider2D collision)
 {
     if (collision.CompareTag("Player"))
     {
         Character1.IndicatorOff();
     }
 }
예제 #2
0
 private void OnTriggerExit2D(Collider2D col)
 {
     if ((type == 2 || type == 5 || type == 6) && col.CompareTag(tagg))
     {
         Character1.IndicatorOff();
     }
 }
예제 #3
0
 void Update()
 {
     if (Vector2.Distance(Player.transform.position, transform.position) < 0.7f)
     {
         IsPlayerExited = false;
         Character1.IndicatorOn();
         if (moveScript.activate)
         {
             GameObject.Find("AudioSystem").GetComponent <AudioSystem>().CallSound(1, 0.8f);
             moveScript.activate = false;
             if (On == false)
             {
                 Anim.SetBool("On", true);
                 On = true;
             }
             else
             {
                 Anim.SetBool("On", false);
                 On = false;
             }
         }
     }
     else if (!IsPlayerExited)
     {
         IsPlayerExited = true;
         Character1.IndicatorOff();
     }
 }
예제 #4
0
    void Update() //Обновление скрипта
    {
        if ((Vector2.Distance(heartPos.position, playerPos.position) < 1f))
        {
            IsPlayerExited = false;
            Character1.IndicatorOn();
            if (Input.GetKeyDown(KeyCode.E) || moveScript.activate)
            {
                {
                    Heart.SetBool("Heart", false);
                    Character1.HP = 100;
                    GameObject.Find("AudioSystem").GetComponent <AudioSystem>().CallSound(1, 0.8f);
                    Character1.IndicatorOff();
                    Destroy(this);
                }
            }
        }
        else if (!IsPlayerExited)
        {
            IsPlayerExited = true;
            Character1.IndicatorOff();
        }

        //если дистанция между игроком и сердцем меньше 0.6 юнита И кнопка "Е" нажат, то
    }
예제 #5
0
 void OnTriggerExit2D(Collider2D col)
 {
     if (col.CompareTag("Player"))
     {
         CanDo = false;
         Character1.IndicatorOff();
     }
 }
예제 #6
0
 private void OnTriggerStay2D(Collider2D collision)
 {
     if (collision.CompareTag("Player"))
     {
         Character1.IndicatorOn();
         if (moveScript.activate)
         {
             moveScript.activate = false;
             EventSavingSystem.SaveAll(collision.gameObject.transform.position.x, collision.gameObject.transform.position.y);
             GameObject.Find("AudioSystem").GetComponent <AudioSystem>().CallSound(2, 0.8f);
             gameObject.GetComponent <Animator>().SetBool("Saved", true);
             titre.SetActive(true);
             Character1.IndicatorOff();
             Destroy(this);
         }
     }
 }
예제 #7
0
 void Update() //Обновление скрипта
 {
     if (Vector2.Distance(transform.position, playerPos.position) < 0.9f)
     {
         Character1.IndicatorOn();
         IsPlayerExited = false;
         if ((Input.GetKeyDown(KeyCode.E) || moveScript.activate && !Enabled))
         {
             totem.SetBool("fired", true);
             GameObject.Find("AudioSystem").GetComponent <AudioSystem>().CallSound(7, 0.8f);
             Enabled        = true;
             Wall.counttoop = Wall.counttoop * 10 + key;
             if (Wall.countconst == Wall.counttoop)
             {
                 GameObject.Find("AudioSystem").GetComponent <AudioSystem>().CallSound(10, 0.8f);
                 Wall.Open();
             }
             moveScript.activate = false;
             return;
         }
     }
     else if (!IsPlayerExited)
     {
         IsPlayerExited = true;
         Character1.IndicatorOff();
     }
     if (Vector2.Distance(transform.position, playerPos.position) < 0.9f)
     {
         Character1.IndicatorOn();
         IsPlayerExited = false;
         if ((Input.GetKeyDown(KeyCode.E) || moveScript.activate && Enabled))
         {
             totem.SetBool("fired", false);
             Wall.counttoop      = Wall.counttoop / 10;
             Enabled             = false;
             moveScript.activate = false;
             return;
         }
     }
     else if (!IsPlayerExited)
     {
         IsPlayerExited = true;
         Character1.IndicatorOff();
     }
     ChangeOrder.ChangeLayerOrder(rend, transform, playerPos);
 }