private void OnMouseDown() { if (canTouch) { anim.SetTrigger("pose"); MusicManager.PlayVoice(HeroGlobals.currentid + "_click"); canTouch = false; StartCoroutine(Wait(GameFuncs.GetAnim(anim, "pose").length)); } }
public virtual void Attack(Entity e) { float value = this.infos[2] - e.infos[3];//atk-def int restrict = GetRestrict(e, ref value); if (value <= 1) { value = 1; } e.GetHurt(value, restrict); AnimationClip ac = GameFuncs.GetAnim(anim, "attack"); if (ac.events.Length <= 0) { Invoke("SetReturn", GameFuncs.GetAnim(anim, "attack").length); } }
private void OnCollisionEnter(Collision collision) { if (collision.gameObject.tag == "Enemy") { if (BattleGlobals.currentObj == gameObject)//attack { anim.SetTrigger("attack"); en = collision.gameObject.GetComponent <Enemy>(); if (id == "002") { Attack(en); } else { StartCoroutine(DelayToInvoke.DelayToInvokeDo(() => { BattleGlobals.isReturn = true; }, GameFuncs.GetAnim(anim, "attack").length)); } } } }
public override void GetHurt(float value, int restrict = 0) { anim.SetBool("damage", true); base.GetHurt(value, restrict); StartCoroutine(WaitSetBool(GameFuncs.GetAnim(anim, "damage").length, "damage")); }
public override void Magic(string sid, Entity other = null)//不用 { anim.SetBool("magic", true); base.Magic(sid, other); StartCoroutine(WaitSetBool(GameFuncs.GetAnim(anim, "magic").length, "magic")); }
public override void Attack(Entity other) { anim.SetBool("attack", true); base.Attack(other); StartCoroutine(WaitSetBool(GameFuncs.GetAnim(anim, "attack").length, "attack")); }