Пример #1
0
    // Update is called once per frame
    void Update()
    {
        if (activated)
        {
            ActionFsm.Execute();

            if (timer > 0)
            {
                timer -= Time.deltaTime;

                if ((int)(timer / (hitFlashLength * 0.125f)) % 2 == 1)
                {
                    this.spriteRenderer.color = hitColor;
                }
                if ((int)(timer / (hitFlashLength * 0.125f)) % 2 == 0)
                {
                    this.spriteRenderer.color = previousColor;
                }

                if (timer <= 0)
                {
                    this.spriteRenderer.color = previousColor;
                }
            }

            //Moving back and forth
        }
    }
Пример #2
0
 // Update is called once per frame
 void FixedUpdate()
 {
     if (activated)
     {
         ActionFsm.FixedExecute();
     }
 }