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;
    }
Exemplo n.º 2
0
 public void SetOfferEmote(IKAnimation.IK_Animation_ID id)
 {
     _offerAnimation = iKAnimationManager.GetIKAnim(id);
 }
Exemplo n.º 3
0
 public void StopOffer()
 {
     StopEmote();
     _offerAnimation = null;
 }
Exemplo n.º 4
0
    private void Play()
    {
        IKAnimation animation = iKAnimationDataBase.GetAnimation(selectedEmote.id);

        playersManager.GetActivePlayer().iKAnimationManager.PlayEmote(animation);
    }