Ejemplo n.º 1
0
    public void Activate()
    {
        bikeBrain bb = owner.GetComponent <bikeBrain>();

        bb.health = bb.totalHealth;
        bb.UpdateHealth();
    }
Ejemplo n.º 2
0
    // This works by measuring the distance to ground with a
    // raycast then applying a force that decreases as the object
    // reaches the desired levitation height.
    // The greater the thrust, the more hover power/height you need;
    // Vary the parameters below to
    // get different control effects. For example, reducing the
    // hover damping will tend to make the object bounce if it
    // passes over an object underneath.

    void Start()
    {
        // Fairly high drag makes the object easier to control.
        attackAngle = attackAngle / 2;
        rb          = bike.GetComponent <Rigidbody>();
        en          = GetComponent <EnemyNavigation>();
        player      = GameObject.FindGameObjectWithTag("Player").GetComponent <bikeBrain>();
        sword.SetActive(false);
        rb.drag                = 0.5f;
        rb.angularDrag         = 0.5f;
        boosting               = false;
        attackCoroutineStarted = false;
        health       = totalHealth;
        canSeePlayer = false;
        layerMask    = 1 << LayerMask.NameToLayer("Terrain");

        engineSoundSource.clip = engineSound;
        swordHitSource.clip    = swordHit;
        swordSwingSource.clip  = swordSwing;
        explosionSource.clip   = explosion;

        engineSoundSource.Play();
    }
Ejemplo n.º 3
0
 private void Start()
 {
     menu       = transform.Find("UI/Navigation").gameObject;
     player     = GetComponent <bikeBrain>();
     flavorText = transform.Find("UI/Flavor").gameObject.GetComponent <TextMeshProUGUI>();
 }
Ejemplo n.º 4
0
    public void Activate()
    {
        bikeBrain bb = owner.GetComponent <bikeBrain>();

        bb.SetBoost(true, 10);
    }