Example #1
0
    // Update is called once per frame
    void Update()
    {
        if (shootCooldown > 0)
        {
            shootCooldown -= Time.deltaTime;
        }
        bool shoot = Input.GetButtonDown("Fire1");

        shoot |= Input.GetButtonDown("Fire2");
        if (shoot)
        {
            WeaponScript weapon = GetComponent <WeaponScript> ();
            if (weapon != null)
            {
                weapon.Attak(false);
            }
        }
    }