static public int IsUserName(IntPtr l) { try{ UnityEngine.AnimatorTransitionInfo self = (UnityEngine.AnimatorTransitionInfo)checkSelf(l); System.String a1; checkType(l, 2, out a1); System.Boolean ret = self.IsUserName(a1); pushValue(l, ret); return(1); } catch (Exception e) { LuaDLL.luaL_error(l, e.ToString()); return(0); } }
static bool AnimatorTransitionInfo_IsUserName__String(JSVCall vc, int argc) { int len = argc; if (len == 1) { System.String arg0 = (System.String)JSApi.getStringS((int)JSApi.GetType.Arg); UnityEngine.AnimatorTransitionInfo argThis = (UnityEngine.AnimatorTransitionInfo)vc.csObj; JSApi.setBooleanS((int)JSApi.SetType.Rval, (System.Boolean)(argThis.IsUserName(arg0))); JSMgr.changeJSObj(vc.jsObjID, argThis); } return(true); }
public virtual void Animate(Vector3 movement, bool atking, bool[] skills) { #region AnimatorStateInfo m_anmSttInfo = m_animator.GetCurrentAnimatorStateInfo(0); if (m_anmSttInfo.IsName("0.idle")) { m_agent.Stop(); m_animator.SetBool("moving", movement.magnitude > 0.1f); m_animator.SetBool("atk", atking); m_animator.speed = 1; } else if (m_anmSttInfo.IsName("0.run")) { m_agent.Resume(); m_animator.SetBool("moving", movement.magnitude > 0.1f); m_animator.SetBool("atk", atking); m_animator.speed = PlayerData.GetInstance().moveSpeed / m_baseMoveSpeed; m_agent.speed = PlayerData.GetInstance().moveSpeed; m_agent.angularSpeed = 99999999; } else if (m_anmSttInfo.IsName("0.atk0")) { AtkAnimate(atking, m_anmSttInfo.normalizedTime, 0); } else if (m_anmSttInfo.IsName("0.atk1")) { AtkAnimate(atking, m_anmSttInfo.normalizedTime, 0); } else if (m_anmSttInfo.IsName("0.atk2")) { AtkAnimate(atking, m_anmSttInfo.normalizedTime, 1); } else if (m_anmSttInfo.IsName("0.atk3")) { AtkAnimate(atking, m_anmSttInfo.normalizedTime, 2); if (m_anmSttInfo.normalizedTime > 0.5f) m_animator.SetBool("moving", movement.magnitude > 0.1f); } #endregion #region AnimatorTransitionInfo m_anmTraInfo = m_animator.GetAnimatorTransitionInfo(0); if (m_anmTraInfo.IsUserName("2a")) { m_animator.SetBool("atk", false); m_hasAtked = false; m_agent.angularSpeed = 0; m_agent.speed = 0; Vector3 direction = Vector3.Lerp(transform.position + transform.forward, transform.position + movement, Time.deltaTime * 10); transform.LookAt(direction); m_agent.Stop(); } else if (m_anmTraInfo.IsUserName("a2i") && m_anmTraInfo.IsUserName("a2r")) { m_animator.SetBool("atk", false); m_agent.angularSpeed = 9999999999; m_agent.Resume(); } #endregion }