コード例 #1
0
    // Token: 0x060053ED RID: 21485 RVA: 0x001CF7A8 File Offset: 0x001CDBA8
    private IEnumerator Die()
    {
        this._dead = true;
        if (!base.isMine)
        {
            yield break;
        }
        Debug.Log("Local Death");
        InputStateControllerManager inputControllerManager = VRCPlayer.Instance.GetComponent <InputStateControllerManager>();

        inputControllerManager.PushInputController("ImmobileInputController");
        VRC.Network.RPC(VRC_EventHandler.VrcTargetType.All, base.gameObject, "ShowDeath", new object[0]);
        yield return(new WaitForSeconds(RagdollController.DeathTime));

        inputControllerManager.PopInputController();
        VRCPlayerModFactory.HealthOnDeathAction healthOnDeathAction = this.mOnDeathAction;
        if (healthOnDeathAction != VRCPlayerModFactory.HealthOnDeathAction.Respawn)
        {
            if (healthOnDeathAction != VRCPlayerModFactory.HealthOnDeathAction.Kick)
            {
            }
            Debug.Log("Local Nothing");
            this.ResetHealth();
            SpawnManager.Instance.RespawnPlayerUsingOrder(base.Owner.vrcPlayer);
        }
        else
        {
            Debug.Log("Local Respawn");
            this.ResetHealth();
            SpawnManager.Instance.RespawnPlayerUsingOrder(base.Owner.vrcPlayer);
        }
        Debug.Log("Local Complete");
        this.DeathCoroutine = null;
        yield break;
    }
コード例 #2
0
    // Token: 0x06005AC3 RID: 23235 RVA: 0x001FA750 File Offset: 0x001F8B50
    private void DetachInputControllerFrom(GameObject player)
    {
        InputStateControllerManager component = player.GetComponent <InputStateControllerManager>();

        if (component != null && this.isImmobilized)
        {
            component.PopInputController();
        }
    }
コード例 #3
0
 // Token: 0x06005ABF RID: 23231 RVA: 0x001FA640 File Offset: 0x001F8A40
 private void AttachInputControllerTo(VRC.Player player, string inputControllerName)
 {
     if (player.isLocal)
     {
         InputStateControllerManager component = player.GetComponent <InputStateControllerManager>();
         if (component != null && this.isImmobilized)
         {
             component.PushInputController(inputControllerName);
         }
     }
 }
コード例 #4
0
    private void Respawn()
    {
        InputStateControllerManager component = VRCPlayer.Instance.GetComponent <InputStateControllerManager>();

        component.PopInputController();
        Networking.LocalPlayer.EnablePickups(true);
        Debug.Log("Local Respawn");
        VRC.Network.RPC(VRC_EventHandler.VrcTargetType.All, base.gameObject, "EndDeath", new object[0]);
        if (this.theCombatSystem.resetHealthOnRespawn)
        {
            this.ResetHealth();
        }
        if (this.theCombatSystem.respawnPoint != null)
        {
            Networking.LocalPlayer.TeleportTo(this.theCombatSystem.respawnPoint.position, this.theCombatSystem.respawnPoint.rotation);
        }
    }
コード例 #5
0
    // Token: 0x06005424 RID: 21540 RVA: 0x001D0E1C File Offset: 0x001CF21C
    private IEnumerator Die()
    {
        if (!base.photonView.isMine)
        {
            yield break;
        }
        VRC_PlayerApi localPlayerApi = base.GetComponent <VRC_PlayerApi>();

        Debug.Log("Local Death");
        InputStateControllerManager inputControllerManager = VRCPlayer.Instance.GetComponent <InputStateControllerManager>();

        inputControllerManager.PushInputController("ImmobileInputController");
        VRC.Network.RPC(VRC_EventHandler.VrcTargetType.All, base.gameObject, "ShowDeath", new object[0]);
        VRC_Pickup leftPickup = localPlayerApi.GetPickupInHand(VRC_Pickup.PickupHand.Left);

        if (leftPickup != null)
        {
            leftPickup.Drop();
        }
        VRC_Pickup rightPickup = localPlayerApi.GetPickupInHand(VRC_Pickup.PickupHand.Right);

        if (rightPickup != null)
        {
            rightPickup.Drop();
        }
        localPlayerApi.EnablePickups(false);
        if (this.theCombatSystem.onPlayerKilled != null)
        {
            this.theCombatSystem.onPlayerKilled(base.GetComponent <VRC_PlayerApi>());
        }
        if (this.theCombatSystem.respawnOnDeath)
        {
            yield return(new WaitForSeconds(this.theCombatSystem.respawnTime));

            this.Respawn();
        }
        else
        {
            yield return(null);
        }
        this.DeathCoroutine = null;
        yield break;
    }