RiftMayhem/Assets/Scripts/CharacterAnimatorParent.cs

29 lines
761 B
C#

using Photon.Pun;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class CharacterAnimatorParent : MonoBehaviour
{
PhotonView photonView;
CharacterAnimatorController animatorController;
private void Awake()
{
photonView = GetComponent<PhotonView>();
animatorController = GetComponentInChildren<CharacterAnimatorController>();
}
public void SetRemoteTriggerBasedOnAbility(int animationType)
{
photonView.RPC(nameof(RPC_SetTriggerBasedOnAbility), RpcTarget.Others, animationType);
}
[PunRPC]
private void RPC_SetTriggerBasedOnAbility(int animationType)
{
animatorController.SetTriggerBasedOnAbility((AbilityAnimationType)animationType);
}
}