/// <summary> /// задает изначальную цель бота и инициализирует переменные /// </summary> void Start() { target = homePoint[1]; motor = this.GetComponent<BotMovement>(); eh = this.GetComponent<BotHealth>(); }
private void Awake() { sfx = GetComponent <BotSFX>(); Health = GetComponent <BotHealth>(); GetComponent <CharacterInputs>().OnMove += Move; anims = GetComponentInChildren <Animator>(); //GetComponent<CharacterInputs>().OnInteract += Interact; CanMove = false; }
private void OnBotSpawned(PlayerControls bot) { if (bot.BotType != botType) { return; } priceLabel.SetActive(false); healthBar.SetActive(true); botHealth = bot.GetComponent <BotHealth>(); botHealth.TakenDamage += OnDamageTaken; ToggleSelector(); UpdateHealthbar(); }
private void trapped(GameObject obj) { if (!jugadorEntro) { jugadorEntro = true; ReproducirSonido(true); //obtiene los compoenentes del bot que vienen desde el delegado de detector players if (CambiarVelocidad == null) { CambiarVelocidad = obj.GetComponent <BotEngine>(); QuitarVida = obj.GetComponent <BotHealth>(); characterInputs = obj.GetComponent <CharacterInputs>(); } originalSpeed = CambiarVelocidad.Velocidad; //obtiene la velocidad el bot CambiarVelocidad.ChangeSpeed(originalSpeed / 2); //cambia la velocidad del bot Invoke("JugadorDentro", 0.5f); } }
void Search() { target = GetClosest(GameObject.FindObjectsOfType <CustomBotHandler>()); targetHealth = target.GetComponent <BotHealth>(); }
private void OnDamageTaken(BotHealth healthComponent) { UpdateHealthbar(); }