Beispiel #1
0
    public override bool Move(Vector2 direction)
    {
        //Debug.Log(fireTrapStat);
        if (fireTrapStat == FireTrapStat.sleep)
        {
            //Debug.Log("anim.Play(idil);");
            anim.Play("idil");
            damage       = 0;
            fireTrapStat = FireTrapStat.prepare;
        }
        else if (fireTrapStat == FireTrapStat.prepare)
        {
            //Debug.Log("anim.Play(beforDanger);");
            anim.Play("beforDanger");
            damage       = 0;
            fireTrapStat = FireTrapStat.danger;
        }
        else if (fireTrapStat == FireTrapStat.danger)
        {
            //Debug.Log("FireTrapStat.danger");
            damage = 1;
            //Debug.Log("anim.Play(danger);");
            anim.Play("danger");

            fireTrapStat = FireTrapStat.sleep;
        }
        //return base.Move(direction);
        return(true);
    }
Beispiel #2
0
 // Start is called before the first frame update
 protected override void Start()
 {
     base.Start();
     nameObject = "trap";
     anim       = GetComponent <Animator>();
     //anim.Play("idil");
     fireTrapStat = FireTrapStat.sleep;
     damage       = 0;
 }