コード例 #1
0
    void IBreakable.Damage(float damage, BaseEnemy interfacingEnemy)
    {
        parentLamp.DamageLamp(damage);
        if (damageVFX)
        {
            SpawnDamgeVFX(interfacingEnemy.transform);
        }

        IAudio audioPlayer = ObjectPoolManager.Spawn(audioPlayerPrefab, transform.position).GetComponent <IAudio>();

        audioPlayer.SetUpAudioSource(AudioManager.instance.GetSound("ApplianceAttacked"));
        audioPlayer.Play();
        if (!parentLamp.GetIsLampWorking())
        {
            interfacingEnemy.GetComponent <IBreakable>().ObjectIsBroken();
        }
    }