public bool IsTimeOver() { if (timer.GetElapsedTimeInSeconds() >= current_interval) { return(true); } return(false); }
private void Update() { float elapsed_time = animation_timer.GetElapsedTimeInSeconds(); this.FetchComponent <SpriteRenderer>().sprite = burst_sprite.GetFrameByTime(elapsed_time); if (elapsed_time >= burst_sprite.GetDuration()) { this.DestroyGameObject(); } }
private void Update() { if (Application.isPlaying) { GetComponent <SpriteRenderer>().sprite = current_animation .GetFrameByTime( animation_time.GetElapsedTimeInSeconds() + use_random_offset.ConvertBool(random_offset) ); } else { GetComponent <SpriteRenderer>().sprite = animated_sprite.GetDefaultFrame(); } }