public void SetActiveHand(DoubleHandController doubleHandController, NamedSlot SetActiv)
    {
        activeDoubleHandController.OrNull()?.Deactivate(ActiveHand);
        activeDoubleHandController = doubleHandController;
        ActiveHand = SetActiv;

        PlayerManager.LocalPlayerScript.playerNetworkActions.CmdSetActiveHand(
            activeDoubleHandController.GetHand(SetActiv).RelatedBodyPartUISlots.GameObject.NetId(), SetActiv);
        PlayerManager.LocalPlayerScript.playerNetworkActions.activeHand =
            activeDoubleHandController.GetHand(SetActiv).RelatedBodyPartUISlots.GameObject;
        PlayerManager.LocalPlayerScript.playerNetworkActions.CurrentActiveHand = SetActiv;
    }
Beispiel #2
0
 public void RemoveAllHands()
 {
     foreach (var HandStorage in DoubleHandControllers.ToArray())
     {
         Destroy(HandStorage.gameObject);
     }
     StorageToHands.Clear();
     AvailableLeftHand.Clear();
     AvailableRightHand.Clear();
     DoubleHandControllers.Clear();
     activeDoubleHandController = null;
     PlayerManager.LocalPlayerScript.playerNetworkActions.CmdSetActiveHand(0, NamedSlot.none);
     PlayerManager.LocalPlayerScript.playerNetworkActions.activeHand        = null;
     PlayerManager.LocalPlayerScript.playerNetworkActions.CurrentActiveHand = NamedSlot.none;
 }