Пример #1
0
    private void OnCollisionEnter(Collision collision)
    {
        if (collision.impulse.magnitude > m_breaking_impulse)
        {
            if (collision.gameObject.CompareTag("Player"))
            {
                DestructibleDestroyedEvent e;
                e.destructible = gameObject;
                GameEvent <DestructibleDestroyedEvent> .PostTargeted(gameObject, e);

                GameEvent <DestructibleDestroyedEvent> .Post(e);

                SpawnHusk();
                Destroy(gameObject);

                if (m_explosion_audio != null)
                {
                    DestructibleAudioManager.PlayDestrucibleAudio(m_explosion_audio);
                }
            }
        }
    }
Пример #2
0
 private void Awake()
 {
     m_Inst = this;
 }