public void Hit(TimelineCall options)
 {
     shadowSprite.enabled = false;
     hitCollider.enabled=true;
     stompHitSource.Play();
     dust.SetActive(true);
 }
    public void MoveFist(TimelineCall options)
    {
        Vector2 position2d = Vector2.Lerp(initialFistPosition, transform.position,
            options.parameter == 0 ? options.progress : 1 - options.progress);

        fist.position = new Vector3(position2d.x, position2d.y, 0);
    }
    public void GrowShadow(TimelineCall options)
    {
        if (options.parameter == 1) {
            options.progress = 1 - options.progress;
        }

        shadow.localScale = new Vector2(1, 1) * options.progress;
        shadowSprite.color = shadowSprite.color.A(shadowOpacity.Lerp(options.progress));
    }
 public void HitEnd(TimelineCall options)
 {
     hitCollider.enabled = false;
     blockCollider.enabled = true;
     scene.position = scene.position.X(0);
 }
 public void BlockEnd(TimelineCall options)
 {
     blockCollider.enabled = false;
 }
 public void DustEnd(TimelineCall options)
 {
     dust.SetActive(false);
 }
 public void StopHit(TimelineCall options)
 {
     footCollider.enabled = false;
 }
 public void Kill(TimelineCall options)
 {
     fireManager.RemoveFire(this);
     Destroy(gameObject);
 }
 public void MoveFoot(TimelineCall options)
 {
     transform.position = savedPosition + new Vector2(0, -yLimit) * options.progress;
 }
 public void PlaySound(TimelineCall options)
 {
     //Utils.PlayPitchedClipAt(footSound, gameObject, Random.Range(0.8f, 1.2f));
     GetComponent<AudioSource>().pitch = Random.Range(0.8f, 1.2f);
     GetComponent<AudioSource>().Play();
 }
 public void Hit(TimelineCall options)
 {
     footCollider.enabled = true;
 }
 public void TouchGround(TimelineCall options)
 {
     transform.parent = scene;
     spitFire.SetActive(false);
     burningFire.SetActive(true);
 }
 public void SpitFire(TimelineCall options)
 {
     transform.position = Vector3.Lerp(spitSpawn, target, options.progress);
 }
 public void Shake(TimelineCall options)
 {
     scene.position = scene.position.X(Random.Range(-maxSceneShake, maxSceneShake));
 }
    // ----------------------------------------------------------------------------
    // Private Methods
    // ----------------------------------------------------------------------------
    private void UpdateFXs()
    {
        if (delay <= 0) {
            foreach (TimelineAction action in actions) {
                //UnityEngine.Debug.Log("Check action "+action.finished+": "+time+" / "+ action.from+" > "+action.to);
                if (!action.finished && time >= action.from) {
                    var options = new TimelineCall();

                    options.parameter = action.parameter;
                    options.firstFrame = !action.started;
                    options.delta = time - action.from;
                    options.finishing = finishing;
                    options.duration = action.to - action.from;
                    options.progress = (options.duration > 0) ? options.delta / options.duration : 1;

                    if (options.progress >= 1) {
                        options.progress = 1;
                        action.finished = true;
                    }

                    action.started = true;

                    // Call method
                    action.getMethod().Invoke(action.script, new object[] { options });
                }
            }
        }
    }
 public void Shutdown(TimelineCall options)
 {
     Destroy(gameObject);
 }
 public void EndFire(TimelineCall options)
 {
     burningFire.GetComponentInChildren<Animator>().SetTrigger(Animator.StringToHash("stop"));
 }