using Photon.Pun;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class CharacterAnimatorParent : MonoBehaviour
{
    PhotonView photonView;
    CharacterAnimatorController animatorController;
    public CastingStateController castingStateController;

    private void Awake()
    {
        photonView = GetComponent<PhotonView>();
        animatorController = GetComponentInChildren<CharacterAnimatorController>();
        castingStateController = GetComponentInChildren<CastingStateController>();
    }


    public void SetRemoteTriggerBasedOnAbility(int animationType)
    {
        photonView.RPC(nameof(RPC_SetTriggerBasedOnAbility), RpcTarget.Others, animationType);
    }

    [PunRPC]
    private void RPC_SetTriggerBasedOnAbility(int animationType)
    {
        animatorController.SetTriggerBasedOnAbility((AbilityAnimationType)animationType);
    }
}
