void Update() { if (TheGame.Get().IsPaused()) { return; } //Anims animator.SetBool("Jumping", character.IsJumping()); animator.SetBool("InAir", !character.IsGrounded()); animator.SetBool("Crouching", character.IsCrouching()); animator.SetFloat("Speed", character.GetMove().magnitude); animator.SetBool("Climb", character.IsClimbing()); if (character_item != null) { animator.SetBool("Hold", character_item.GetHeldItem() != null); } //Hit flashing render.color = new Color(render.color.r, render.color.g, render.color.b, 1f); if (flash_fx_timer > 0f) { flash_fx_timer -= Time.deltaTime; float alpha = Mathf.Abs(Mathf.Sin(flash_fx_timer * Mathf.PI * 4f)); render.color = new Color(render.color.r, render.color.g, render.color.b, alpha); } }
public void OnClickSave() { if (TheGame.Get()) { TheGame.Get().Save(); } }
public void Save() { PlayerData.Get().current_checkpoint = unique_id; TheGame.Get().Save(); }
private void Start() { TheGame.Get().onPause += (bool paused) => { animator.Rebind(); }; }