示例#1
0
    /// <summary>
    /// задает изначальную цель бота и инициализирует переменные 
    /// </summary>
    void Start()
    {
        target = homePoint[1];

        motor = this.GetComponent<BotMovement>();
        eh = this.GetComponent<BotHealth>();
    }
示例#2
0
    private void Awake()
    {
        sfx    = GetComponent <BotSFX>();
        Health = GetComponent <BotHealth>();
        GetComponent <CharacterInputs>().OnMove += Move;
        anims = GetComponentInChildren <Animator>();

        //GetComponent<CharacterInputs>().OnInteract += Interact;
        CanMove = false;
    }
示例#3
0
    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();
    }
示例#4
0
 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);
     }
 }
示例#5
0
 void Search()
 {
     target       = GetClosest(GameObject.FindObjectsOfType <CustomBotHandler>());
     targetHealth = target.GetComponent <BotHealth>();
 }
示例#6
0
 private void OnDamageTaken(BotHealth healthComponent)
 {
     UpdateHealthbar();
 }