diff options
| author | chai <215380520@qq.com> | 2024-05-20 22:35:55 +0800 |
|---|---|---|
| committer | chai <215380520@qq.com> | 2024-05-20 22:35:55 +0800 |
| commit | 1cefa46d7cbff46fc14c44ab36b4976047b98c70 (patch) | |
| tree | 49c376cfd996749de8ec2b8e08456ec46cfc2b3b /Valheim_v202102/Valheim/assembly_valheim/CharacterTimedDestruction.cs | |
| parent | db64ca2ebcfc2239702ba53e3497b44cd14d8c27 (diff) | |
*rename
Diffstat (limited to 'Valheim_v202102/Valheim/assembly_valheim/CharacterTimedDestruction.cs')
| -rw-r--r-- | Valheim_v202102/Valheim/assembly_valheim/CharacterTimedDestruction.cs | 48 |
1 files changed, 0 insertions, 48 deletions
diff --git a/Valheim_v202102/Valheim/assembly_valheim/CharacterTimedDestruction.cs b/Valheim_v202102/Valheim/assembly_valheim/CharacterTimedDestruction.cs deleted file mode 100644 index f4382e2..0000000 --- a/Valheim_v202102/Valheim/assembly_valheim/CharacterTimedDestruction.cs +++ /dev/null @@ -1,48 +0,0 @@ -using UnityEngine; - -public class CharacterTimedDestruction : MonoBehaviour -{ - public float m_timeoutMin = 1f; - - public float m_timeoutMax = 1f; - - public bool m_triggerOnAwake; - - private ZNetView m_nview; - - private Character m_character; - - private void Awake() - { - m_nview = GetComponent<ZNetView>(); - if (m_triggerOnAwake) - { - Trigger(); - } - } - - public void Trigger() - { - InvokeRepeating("DestroyNow", Random.Range(m_timeoutMin, m_timeoutMax), 1f); - } - - public void Trigger(float timeout) - { - InvokeRepeating("DestroyNow", timeout, 1f); - } - - private void DestroyNow() - { - if (m_nview.IsValid() && m_nview.IsOwner()) - { - GetComponent<Character>().ApplyDamage(new HitData - { - m_damage = - { - m_damage = 99999f - }, - m_point = base.transform.position - }, showDamageText: false, triggerEffects: true); - } - } -} |
