private void Update() { CheckStage(); //Проверяем стадию босса /* if (Cast.Crutch && Crutch) * { * StopAllCoroutines(); * StartCoroutine(CircleAttack()); * Cast.Crutch = false; * Crutch = false; * }*/ BulletSpeed = BSpeed; //Скорость пуль if (sAgain) //КОСТЫЛЬ нужен для возобновления врага, думаю это временный костыль { StopAllCoroutines(); StartCoroutine(CircleAttack()); // Начинаем спамить, опять sAgain = false; // Костыль } if (AttackType == 0 || AttackType == 2) //Выключаем наш SIN-COS ад если используется атака другого типа { VectorTimer(); } if (EnHp == 0) //При смерти врага { GameObject[] bullets = GameObject.FindGameObjectsWithTag("bullets"); //КОСТЫЛЬ находим все пульки на экране foreach (GameObject i in bullets) // Просто удаляем ВСЕ(даже наши) пульки { Destroy(i.gameObject); } } ChangeOrder.ChangeLayerOrder(enemy.GetComponent <Renderer>(), transform, hero.transform); }
void Update() //Обновление скрипта { if (Vector2.Distance(transform.position, playerPos.position) < 2f && lampEnabled == false) { lamp.SetBool("on", true); } ChangeOrder.ChangeLayerOrder(lamprend, transform, playerPos); }
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); }
void Update() //Обновление скрипта { if (Vector2.Distance(transform.position, playerPos.position) < 0.9f && (Input.GetKeyDown(KeyCode.E) && !Enabled)) { totem.SetBool("fired", true); Enabled = true; Wall.counttoop = Wall.counttoop * 10 + key; Wall.Open(); return; } if (Vector2.Distance(transform.position, playerPos.position) < 0.9f && (Input.GetKeyDown(KeyCode.E) && Enabled)) { totem.SetBool("fired", false); Wall.counttoop = Wall.counttoop / 10; Enabled = false; return; } ChangeOrder.ChangeLayerOrder(rend, transform, playerPos); }