Exemple #1
0
    // Update is called once per frame
    void Update()
    {
        this.anim.SetFloat("Direction", Parameters.GetDirAnimation(this.direction));

        ActionFsm.Execute();
        StatusFsm.Execute();

        if (frozen)
        {
            spriteRenderer.color = new Color(0.25f, 1f, 1f, 1f);
        }
        else
        {
            spriteRenderer.color = new Color(0.8f + 0.2f * (health / maxHealth),
                                             0.25f + 0.75f * (health / maxHealth),
                                             0.25f + 0.75f * (health / maxHealth), 1f);
        }

        if (this.health <= 0)
        {
            Destroy(this.gameObject);
        }
    }
Exemple #2
0
 void FixedUpdate()
 {
     ActionFsm.FixedExecute();
     StatusFsm.Execute();
 }