public void PlayEmote(IKAnimation ikObj) { if ((currentPose) && ikObj.iD == currentPose.ID) { return; } ClearIKPoses(); Pose pose = Instantiate(ikObj.prefab, ikSpawn).GetComponent <Pose>(); pose.Init(); Player otherPlayer; if (ikObj.offerAnimation != IKAnimation.IK_Animation_ID.none) { playerInteractionManager.SetOfferEmote(ikObj.offerAnimation); } if (PlayersManager.Instance.CanPlayerInteract(player, out otherPlayer)) { foreach (var point in ikObj.playerInteractionTargets) { Transform playerPoint = otherPlayer.iKAnimationManager.GetIKPoint(point.playerPoint); pose.targetDictionary[point.effector].transform.SetParent(playerPoint); pose.targetDictionary[point.effector].transform.localPosition = new Vector3(0, 0, 0); } } UnityAction emoteAction = emoteManager.GetEmoteAction(ikObj.iD); if (emoteAction != null) { emoteAction.Invoke(); } currentPose = pose; }
public void SetOfferEmote(IKAnimation.IK_Animation_ID id) { _offerAnimation = iKAnimationManager.GetIKAnim(id); }
public void StopOffer() { StopEmote(); _offerAnimation = null; }
private void Play() { IKAnimation animation = iKAnimationDataBase.GetAnimation(selectedEmote.id); playersManager.GetActivePlayer().iKAnimationManager.PlayEmote(animation); }