示例#1
0
 public void OnHit(BulletHitInfo_AF info)
 {
     ragdollControl.shotByBullet = true;
     if (Flag != null)
     {
         Flag.Throw();
     }
     Flag = null;
     pickItem.OnHit(info);
     StartCoroutine(AddForceToLimb(info));
 }
示例#2
0
    IEnumerator Respawn(float time)
    {
        yield return(new WaitForFixedUpdate());

        if (!Respawnable)
        {
            Destroy(UI_copy);
        }
        Decal.SetActive(false);
        yield return(new WaitForFixedUpdate());

        ragdollControl.shotByBullet = true;
        ragdollControl.IsDead       = true;
        pickItem.OnHit();
        yield return(new WaitForFixedUpdate());

        if (Flag != null)
        {
            Flag.Throw();
        }
        Flag = null;
        yield return(new WaitForSeconds(time));

        if (Respawnable)
        {
            playerIdentity.Respawn();
            IsInvincible  = true;
            LastDamagedID = -1;
            ragdollControl.shotByBullet = true;
            Health = MaxHealth;
            OnHealthChanged?.Invoke(this, 0, Health);
            ragdollControl.IsDead = false;
        }
        yield return(new WaitForSeconds(4.5f));

        if (Respawnable)
        {
            Dead = false;
            Decal.SetActive(true);
            IsInvincible = false;
        }
        yield return(null);
    }