Ejemplo n.º 1
0
    void Start()
    {
        playerController = transform.parent.gameObject.GetComponent <scr_PlayerController>();

        attackCooldown      = 0.5f;
        attackCooldownTimer = 0f;
    }
Ejemplo n.º 2
0
 void Start()
 {
     playerController    = GameObject.Find("obj_Player").GetComponent <scr_PlayerController>();
     rigidbody2d         = GetComponent <Rigidbody2D>();
     attackCooldownTimer = Random.Range(attackCooldown - 0.25f, attackCooldown + 0.25f);
     currentHP           = maxHP;
     sentryPosition      = transform.position;
     playerClose         = false;
 }
Ejemplo n.º 3
0
    void OnCollisionEnter2D(Collision2D other)
    {
        scr_PlayerController player = other.gameObject.GetComponent <scr_PlayerController>();

        if (player != null)
        {
            player.ChangeHealth(-25);
            Die();
        }
    }
Ejemplo n.º 4
0
    void NoBullets()
    {
        scr_PlayerController p = GameObject.FindGameObjectWithTag("Player").GetComponent <scr_PlayerController>();

        if ((p != null) && (p.canShoot == 0))
        {
            p.CanShoott(1);
        }
        Destroy(gameObject);
    }
Ejemplo n.º 5
0
    //public AudioClip collectedClip;
    void OnTriggerEnter2D(Collider2D other)
    {
        scr_PlayerController controller = other.GetComponent <scr_PlayerController>();

        if (controller != null)
        {
            if (controller.health < controller.maxHealth)
            {
                controller.ChangeHealth(50);
                Destroy(gameObject);

                //controller.PlaySound(collectedClip);
            }
        }
    }
Ejemplo n.º 6
0
 void Start()
 {
     playerController = transform.parent.GetComponent <scr_PlayerController>();
 }