예제 #1
0
 private void OnMouseDown()
 {
     if (canTouch)
     {
         anim.SetTrigger("pose");
         MusicManager.PlayVoice(HeroGlobals.currentid + "_click");
         canTouch = false;
         StartCoroutine(Wait(GameFuncs.GetAnim(anim, "pose").length));
     }
 }
예제 #2
0
    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);
        }
    }
예제 #3
0
 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));
             }
         }
     }
 }
예제 #4
0
 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"));
 }
예제 #5
0
 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"));
 }
예제 #6
0
 public override void Attack(Entity other)
 {
     anim.SetBool("attack", true);
     base.Attack(other);
     StartCoroutine(WaitSetBool(GameFuncs.GetAnim(anim, "attack").length, "attack"));
 }