Пример #1
0
 public void CustomUpdate()
 {
     if (!_user.Character.IsDead &&
         gameObject.transform.position.y <
         _settings.ArenaSettings.CharacterFallThreshold)
     {
         NetworkEvents.CharacterTakeDamage(new UserTakeDamage
         {
             Damage = 100000,
             UserId = UserData.Instance.User.Id
         });
         //Die();
     }
 }
 private void SubscribeToAllPlayers(PlayerFacade facade)
 {
     Debug.Log("SubscribeToPlayer - " + facade.User.Name);
     facade.Health.OnTakeDamage += (damage, user) =>
     {
         NetworkEvents.CharacterTakeDamage(new UserTakeDamage {
             UserId = user.Id, Damage = damage
         });
     };
     facade.OnPushed += (direction) =>
     {
         NetworkEvents.CharacterPush(new UserPush
         {
             UserId    = UserData.Instance.User.Id,
             TargetId  = facade.User.Id,
             Direction = direction
         });
     };
 }