Пример #1
0
        private void Awake()
        {
            ragdollRigidbodies = GetComponentsInChildren <Rigidbody>();
            allColliders.AddRange(GetComponentsInChildren <Collider>());

            m_AudioManager = GetComponent <CharacterAudioManager>();

            m_CurrentHealth = m_MaxHealth;

            GlobalEvents.AddEvent("Damage", Damage);
            GlobalEvents.AddEvent("Restart", RespawnCharacter);
            GlobalEvents.AddEvent("RestoreHealth", RestoreHealth);

            DisableRagdoll();
        }
 /// <summary>
 /// Execute an animation event called by animation
 /// </summary>
 /// <param name="eventName"></param>
 public void ExecuteAnimationEvent(string eventName)
 {
     GlobalEvents.ExecuteEvent(eventName, gameObject, null);
 }
Пример #3
0
        private IEnumerator RestartCharacter()
        {
            yield return(new WaitForSeconds(m_WaitToRestart));

            GlobalEvents.ExecuteEvent("Restart", null, null);
        }