Exemplo n.º 1
0
 private void Awake()
 {
     if (instance == null)
     {
         instance = this;
     }
 }
Exemplo n.º 2
0
    //hasar verme
    void Damage(Transform enemy)
    {
        Dusman e = enemy.GetComponent <Dusman>();

        if (e != null)
        {
            e.TakeDamage(damage);
        }
    }
Exemplo n.º 3
0
    public void AtesEt()
    {
        muzzleflash.Play();

        sfx.clip = ak;
        sfx.Play();

        Mermi_Sayisi--;
        mermisayisi.text = Mermi_Sayisi.ToString();

        anim.Play("Tepme");

        RaycastHit hit;

        if (Physics.Raycast(transform.position, transform.forward, out hit, Mesafe))
        {
            Dusman dusman = hit.transform.GetComponent <Dusman>();
            if (dusman != null)
            {
                dusman.HasarVer(Hasar);
            }
        }
    }