Пример #1
0
    void Start()
    {
        OnWeaponUsedCallback += UpdateUI;
        reloadTimer.gameObject.SetActive(false);
        DisableAmmo();

        if (OnWeaponUsedCallback != null)
        {
            OnWeaponUsedCallback.Invoke();
        }
    }
Пример #2
0
    IEnumerator WaitAndDestroy()
    {
        yield return(new WaitForSeconds(weaponUseTime));

        CameraShake.Shake();
        for (int x = -1; x <= 1; x++)
        {
            for (int y = -1; y <= 1; y++)
            {
                if (x != 0 && y != 0)
                {
                    continue;
                }

                GameObject   obj          = SimplePool.Spawn(bombEffectPrefab, transform.position + Vector3.right * x + Vector3.up * y, Quaternion.identity);
                SelfDestruct selfDestruct = obj.GetComponent <SelfDestruct>();
                selfDestruct.selfDestructTime = damageDurationTime;
            }
        }
        OnWeaponUsed?.Invoke(this);
        SimplePool.Despawn(gameObject);
    }