Esempio n. 1
0
    public void Shoot()
    {
        if (currentStriker == null)
        {
            return;
        }

        IShootable shootable = currentStriker.transform.GetComponent <IShootable>();

        if (shootable != null)
        {
            shootable.TakeShot(shootPoint.forward, shootForce, forceMode);
            MakeExplosion();
            currentStriker.transform.SetParent(null);
            currentStriker     = null;
            timeToSpawnStriker = Time.time + 1 / shootingRate;
        }
        else
        {
            Debug.Log("No shootable target");
        }
    }