浏览代码

Client Character animation playing

Added support for revive action animation playback in the ClientCharacterVisualisation.cs;
/main
sorcerer_king 4 年前
当前提交
71fcd0bd
共有 1 个文件被更改,包括 39 次插入2 次删除
  1. 41
      Assets/BossRoom/Scripts/Client/ClientCharacterVisualization.cs

41
Assets/BossRoom/Scripts/Client/ClientCharacterVisualization.cs


using System;
using MLAPI;
using UnityEngine;
using Cinemachine;

m_NetState = this.transform.parent.gameObject.GetComponent<NetworkCharacterState>();
m_NetState.DoActionEventClient += this.PerformActionFX;
m_NetState.NetworkLifeState.OnValueChanged += OnLifeStateChanged;
//we want to follow our parent on a spring, which means it can't be directly in the transform hierarchy.
m_Parent = transform.parent;

{
//TODO: [GOMPS-13] break this method out into its own class, so we can drive multi-frame graphical effects.
//FIXME: [GOMPS-13] hook this up to information in the ActionDescription.
m_ClientVisualsAnimator.SetInteger("AttackID", 1);
m_ClientVisualsAnimator.SetTrigger("BeginAttack");
switch (data.ActionTypeEnum)
{
case ActionType.TANK_BASEATTACK:
m_ClientVisualsAnimator.SetInteger("AttackID", 1);
m_ClientVisualsAnimator.SetTrigger("BeginAttack");
break;
case ActionType.ARCHER_BASEATTACK:
break;
case ActionType.GENERAL_CHASE:
break;
case ActionType.GENERAL_REVIVE:
m_ClientVisualsAnimator.SetTrigger("Action - Revive");
break;
default:
throw new ArgumentOutOfRangeException();
}
}
private void OnLifeStateChanged(LifeState previousValue, LifeState newValue)
{
switch (newValue)
{
case LifeState.ALIVE:
m_ClientVisualsAnimator.SetTrigger("StandUp");
break;
case LifeState.FAINTED:
m_ClientVisualsAnimator.SetTrigger("FallDown");
break;
case LifeState.DEAD:
m_ClientVisualsAnimator.SetTrigger("Dead");
break;
default:
throw new ArgumentOutOfRangeException(nameof(newValue), newValue, null);
}
}
void Update()

正在加载...
取消
保存