public void Begin() { selfController.RoleAnimator.SetInteger("qteState", 1); targetController.RoleAnimator.SetTrigger("qte_dog_to_human"); selfController.IsQte = true; targetController.IsQte = true; // 给qte目标设置朝向 add by TangJian 2019/3/20 21:47 targetController.SetDirectionInt(-selfController.GetDirectionInt()); LockTarget(); _qteState = QteState.QteRunning; }
public void OnTargetStateEvent(string stateName, AnimatorStateEventType eventType, Animator animator, AnimatorStateInfo stateInfo, int layerIndex, float time) { if (_qteState == QteState.QteRunning) { if (eventType == AnimatorStateEventType.OnStateEnter) { if (stateName == "Qte_DogToHuman_Struggle") { StruggleTimes++; if (StruggleTimes >= 1) { _qteState = QteState.QteFailure; targetController.RoleAnimator.SetTrigger("qte_struggleSuccess"); } } } } }
public void Success() { _qteState = QteState.QteSuccess; Tools.Destroy(this); }