- Players can now die (finally) - Solo players have a single cheat death per scene (reviving automatically after the first death) - group players have revive mechanic, where a player faints when his health gets to 0, creating a revive circle around him, other players can stand on it to revive him. if after x seconds they don't get revived they bleed out and stay perma death until scene changes or all players die - Multiple VFX added using post processing for cheat death, fainting, reviving, and perma death events. - stopped players from moving and pressing keys when dead - enemies now change target if they try to attack a dead/fainted target.
52 lines
1.3 KiB
C#
52 lines
1.3 KiB
C#
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 SetRemoteDead()
|
|
{
|
|
photonView.RPC(nameof(RPC_SetDeadTrigger), RpcTarget.Others);
|
|
}
|
|
|
|
[PunRPC]
|
|
private void RPC_SetDeadTrigger()
|
|
{
|
|
animatorController.SetDeadTrigger();
|
|
}
|
|
|
|
public void SetRemoteRevived()
|
|
{
|
|
photonView.RPC(nameof(RPC_SetRevivedTrigger), RpcTarget.Others);
|
|
}
|
|
|
|
[PunRPC]
|
|
private void RPC_SetRevivedTrigger()
|
|
{
|
|
animatorController.SetRevivedTrigger();
|
|
}
|
|
|
|
public void SetRemoteTriggerBasedOnAbility(int animationType)
|
|
{
|
|
photonView.RPC(nameof(RPC_SetTriggerBasedOnAbility), RpcTarget.Others, animationType);
|
|
}
|
|
|
|
[PunRPC]
|
|
private void RPC_SetTriggerBasedOnAbility(int animationType)
|
|
{
|
|
animatorController.SetTriggerBasedOnAbility((AbilityAnimationType)animationType);
|
|
}
|
|
}
|